[LEDE-DEV] [PATCH v2 1/3] base-files: add/convert generic board detection scripts

Piotr Dymacz pepe2k at gmail.com
Tue May 9 02:51:15 PDT 2017


Hello Roman,

Your mail addresses in from header and in SoB line don't match.
Also, some questions inline, below.

On 09.05.2017 11:16, Roman Yeryomin wrote:
> Signed-off-by: Roman Yeryomin <roman at advem.lv>
> ---
>  package/base-files/files/lib/board_detect.sh                 |  9 +++++++++
>  package/base-files/files/lib/preinit/03_preinit_board_detect | 11 +++++++++++
>  package/base-files/files/lib/preinit/10_sysinfo              | 10 ----------
>  3 files changed, 20 insertions(+), 10 deletions(-)
>  create mode 100644 package/base-files/files/lib/board_detect.sh
>  create mode 100644 package/base-files/files/lib/preinit/03_preinit_board_detect
>  delete mode 100644 package/base-files/files/lib/preinit/10_sysinfo
>
> diff --git a/package/base-files/files/lib/board_detect.sh b/package/base-files/files/lib/board_detect.sh
> new file mode 100644
> index 0000000..e2f0f89
> --- /dev/null
> +++ b/package/base-files/files/lib/board_detect.sh
> @@ -0,0 +1,9 @@
> +board_detect()
> +{
> +	[ -d /proc/device-tree ] || return
> +	mkdir -p /tmp/sysinfo
> +	[ -e /tmp/sysinfo/board_name ] || \
> +		echo "$(strings /proc/device-tree/compatible | head -1)" > /tmp/sysinfo/board_name
> +	[ ! -e /tmp/sysinfo/model -a -e /proc/device-tree/model ] && \
> +		echo "$(cat /proc/device-tree/model)" > /tmp/sysinfo/model
> +}
> diff --git a/package/base-files/files/lib/preinit/03_preinit_board_detect b/package/base-files/files/lib/preinit/03_preinit_board_detect
> new file mode 100644
> index 0000000..739ab02
> --- /dev/null
> +++ b/package/base-files/files/lib/preinit/03_preinit_board_detect
> @@ -0,0 +1,11 @@
> +#!/bin/sh
> +#
> +# Copyright (c) 2017 The Linux Foundation. All rights reserved.

Why LF? Shouldn't you use here your own copyright or none at all?

What's more, does it really make sense for you to copyright shell code 
which length is almost the same as the copyright line?

--
Cheers,
Piotr

> +#
> +
> +do_board_detect()
> +{
> +	. /lib/board_detect.sh && board_detect
> +}
> +
> +boot_hook_add preinit_main do_board_detect
> diff --git a/package/base-files/files/lib/preinit/10_sysinfo b/package/base-files/files/lib/preinit/10_sysinfo
> deleted file mode 100644
> index 65b5096..0000000
> --- a/package/base-files/files/lib/preinit/10_sysinfo
> +++ /dev/null
> @@ -1,10 +0,0 @@
> -do_sysinfo_generic() {
> -	[ -d /proc/device-tree ] || return
> -	mkdir -p /tmp/sysinfo
> -	[ -e /tmp/sysinfo/board_name ] || \
> -		echo "$(strings /proc/device-tree/compatible | head -1)" > /tmp/sysinfo/board_name
> -	[ ! -e /tmp/sysinfo/model -a -e /proc/device-tree/model ] && \
> -		echo "$(cat /proc/device-tree/model)" > /tmp/sysinfo/model
> -}
> -
> -boot_hook_add preinit_main do_sysinfo_generic
>




More information about the Lede-dev mailing list