[openwrt/openwrt] ipq806x: base-files: asrock: fix bootcount include

LEDE Commits lede-commits at lists.infradead.org
Thu May 13 06:13:32 PDT 2021


ynezz pushed a commit to openwrt/openwrt.git, branch master:
https://git.openwrt.org/ce8af0ace04bb43e8156940c771b4058fa83d27a

commit ce8af0ace04bb43e8156940c771b4058fa83d27a
Author: Petr Štetiar <ynezz at true.cz>
AuthorDate: Fri May 7 15:06:48 2021 +0200

    ipq806x: base-files: asrock: fix bootcount include
    
    Fixes following error while executing the init script on the buildhost:
    
     Enabling boot
     ./etc/init.d/bootcount: line 5: /lib/upgrade/asrock.sh: No such file or directory
     Enabling bootcount
    
    While at it fix following shellcheck issue:
    
     base-files/etc/init.d/bootcount line 11:
        if [ $? -eq 0 ]; then
             ^-- SC2181: Check exit code directly with e.g. 'if mycmd;', not indirectly with $?.
    
    Cc: Ansuel Smith <ansuelsmth at gmail.com>
    Cc: Pawel Dembicki <paweldembicki at gmail.com>
    Cc: Christian Lamparter <chunkeey at gmail.com>
    Fixes: 98b86296e67d ("ipq806x: add support for ASRock G10")
    References: https://gitlab.com/ynezz/openwrt/-/jobs/1243290743#L1444
    Signed-off-by: Petr Štetiar <ynezz at true.cz>
---
 target/linux/ipq806x/base-files/etc/init.d/bootcount | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/target/linux/ipq806x/base-files/etc/init.d/bootcount b/target/linux/ipq806x/base-files/etc/init.d/bootcount
index 7a54c34dba..cb32a4ed35 100755
--- a/target/linux/ipq806x/base-files/etc/init.d/bootcount
+++ b/target/linux/ipq806x/base-files/etc/init.d/bootcount
@@ -2,15 +2,12 @@
 
 START=99
 
-. /lib/upgrade/asrock.sh
+. "$IPKG_INSTROOT/lib/upgrade/asrock.sh"
 
 boot() {
 	case $(board_name) in
 	asrock,g10)
-		asrock_bootconfig_mangle "bootcheck"
-		if [ $? -eq 0 ]; then
-			reboot
-		fi
+		asrock_bootconfig_mangle "bootcheck" && reboot
 		;;
 	edgecore,ecw5410)
 		fw_setenv bootcount 0



More information about the lede-commits mailing list