[OpenWrt-Devel] [PATCH 2/8] brcm2708: remove unneeded base-files
John Crispin
blogic at openwrt.org
Wed Jul 15 03:39:32 EDT 2015
On 15/07/2015 08:20, Álvaro Fernández Rojas wrote:
> You're right, device tree doesn't provide that functionality directly,
> but there's a preinit script which exports it from DT:
> https://github.com/openwrt-es/openwrt/blob/master/package/base-files/files/lib/preinit/10_sysinfo
>
> The LEDs are exported from DT and network config is the same for all
> boards (network script remains untouched).
>
interesting. i was going to propose such a generic script. i am a bit
baffeled that the link you posted adds redundant logic to the tree but
that is a different matter to resolve.
> El 15/7/2015, a las 7:31, John Crispin <blogic at openwrt.org
> <mailto:blogic at openwrt.org>> escribió:
>
>>
>>
>> On 14/07/2015 20:15, Álvaro Fernández Rojas wrote:
>>> Device tree exports board name/model and device LEDs.
>>>
>>
>>
>> this patch makes no sense to me and removes functionality. DT does not
>> provide this functionality at all.
>>
>> John
>>
>>> Signed-off-by: Álvaro Fernández Rojas <noltari at gmail.com
>>> <mailto:noltari at gmail.com>>
>>> ---
>>> .../brcm2708/base-files/etc/uci-defaults/01_leds | 11 -------
>>> target/linux/brcm2708/base-files/lib/brcm2708.sh | 36
>>> ----------------------
>>> .../lib/preinit/03_preinit_do_brcm2708.sh | 9 ------
>>> 3 files changed, 56 deletions(-)
>>> delete mode 100644
>>> target/linux/brcm2708/base-files/etc/uci-defaults/01_leds
>>> delete mode 100755 target/linux/brcm2708/base-files/lib/brcm2708.sh
>>> delete mode 100644
>>> target/linux/brcm2708/base-files/lib/preinit/03_preinit_do_brcm2708.sh
>>>
>>> diff --git
>>> a/target/linux/brcm2708/base-files/etc/uci-defaults/01_leds
>>> b/target/linux/brcm2708/base-files/etc/uci-defaults/01_leds
>>> deleted file mode 100644
>>> index ad52c68..0000000
>>> --- a/target/linux/brcm2708/base-files/etc/uci-defaults/01_leds
>>> +++ /dev/null
>>> @@ -1,11 +0,0 @@
>>> -#!/bin/sh
>>> -#
>>> -# Copyright (C) 2015 OpenWrt.org <http://OpenWrt.org>
>>> -#
>>> -
>>> -. /lib/functions/uci-defaults.sh
>>> -
>>> -ucidef_set_led_mmc "mmc" "MMC" "led0" "mmc0"
>>> -ucidef_commit_leds
>>> -
>>> -exit 0
>>> diff --git a/target/linux/brcm2708/base-files/lib/brcm2708.sh
>>> b/target/linux/brcm2708/base-files/lib/brcm2708.sh
>>> deleted file mode 100755
>>> index 76870c6..0000000
>>> --- a/target/linux/brcm2708/base-files/lib/brcm2708.sh
>>> +++ /dev/null
>>> @@ -1,36 +0,0 @@
>>> -#!/bin/sh
>>> -#
>>> -# Copyright (C) 2015 OpenWrt.org <http://OpenWrt.org>
>>> -#
>>> -
>>> -brcm2708_board_detect() {
>>> - local machine
>>> - local name
>>> -
>>> - machine=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /Hardware/ {print $2}'
>>> /proc/cpuinfo)
>>> -
>>> - case "$machine" in
>>> - BCM2708)
>>> - name="Raspberry Pi"
>>> - ;;
>>> - BCM2709)
>>> - name="Raspberry Pi 2"
>>> - ;;
>>> - esac
>>> -
>>> - [ -z "$name" ] && name="unknown"
>>> -
>>> - [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
>>> -
>>> - echo "$machine" > /tmp/sysinfo/board_name
>>> - echo "$name" > /tmp/sysinfo/model
>>> -}
>>> -
>>> -brcm2708_board_name() {
>>> - local name
>>> -
>>> - [ -f /tmp/sysinfo/board_name ] && name=$(cat
>>> /tmp/sysinfo/board_name)
>>> - [ -z "$name" ] && name="unknown"
>>> -
>>> - echo "$name"
>>> -}
>>> diff --git
>>> a/target/linux/brcm2708/base-files/lib/preinit/03_preinit_do_brcm2708.sh
>>> b/target/linux/brcm2708/base-files/lib/preinit/03_preinit_do_brcm2708.sh
>>> deleted file mode 100644
>>> index e3cf56d..0000000
>>> ---
>>> a/target/linux/brcm2708/base-files/lib/preinit/03_preinit_do_brcm2708.sh
>>> +++ /dev/null
>>> @@ -1,9 +0,0 @@
>>> -#!/bin/sh
>>> -
>>> -do_brcm2708() {
>>> - . /lib/brcm2708.sh
>>> -
>>> - brcm2708_board_detect
>>> -}
>>> -
>>> -boot_hook_add preinit_main do_brcm2708
>>>
>
>
> _______________________________________________
> openwrt-devel mailing list
> openwrt-devel at lists.openwrt.org
> https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
>
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel
More information about the openwrt-devel
mailing list