Browse Source

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 <[email protected]>
Cc: Pawel Dembicki <[email protected]>
Cc: Christian Lamparter <[email protected]>
Fixes: 98b86296e67d ("ipq806x: add support for ASRock G10")
References: https://gitlab.com/ynezz/openwrt/-/jobs/1243290743#L1444
Signed-off-by: Petr Štetiar <[email protected]>
Petr Štetiar 4 years ago
parent
commit
ce8af0ace0
1 changed files with 2 additions and 5 deletions
  1. 2 5
      target/linux/ipq806x/base-files/etc/init.d/bootcount

+ 2 - 5
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