From 1353ab71fd83c41fce41b287583d7f04dbce1ad4 Mon Sep 17 00:00:00 2001 From: Matteo Iervasi Date: Wed, 27 Mar 2024 12:37:47 +0100 Subject: [PATCH 1/2] base-files: Avoid re-splitting in firstboot script Before this change, the firstboot script was not passing shellcheck test as it invoked jffs2reset without quotes, leading to potential re-splitting. Signed-off-by: Matteo Iervasi --- package/base-files/files/sbin/firstboot | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/base-files/files/sbin/firstboot b/package/base-files/files/sbin/firstboot index d9af57d59645bc..9dc020a3b54325 100755 --- a/package/base-files/files/sbin/firstboot +++ b/package/base-files/files/sbin/firstboot @@ -1,3 +1,3 @@ #!/bin/sh -/sbin/jffs2reset $@ +/sbin/jffs2reset "$@" From bf499799fa6a02568b0aaeb926a049fe14086e07 Mon Sep 17 00:00:00 2001 From: Matteo Iervasi Date: Wed, 27 Mar 2024 12:44:28 +0100 Subject: [PATCH 2/2] base-files: Fix potential issues in board_detect script Before this change, the board_detect script was parsing the output of ls to get files in /etc/board.d. The correct method is to use globs. Signed-off-by: Matteo Iervasi --- package/base-files/files/bin/board_detect | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/base-files/files/bin/board_detect b/package/base-files/files/bin/board_detect index 94f45bec53a70a..be4242802a7f0f 100755 --- a/package/base-files/files/bin/board_detect +++ b/package/base-files/files/bin/board_detect @@ -5,8 +5,8 @@ CFG=$1 [ -n "$CFG" ] || CFG=/etc/board.json [ -d "/etc/board.d/" -a ! -s "$CFG" ] && { - for a in $(ls /etc/board.d/*); do - [ -s $a ] || continue; + for a in /etc/board.d/*; do + [ -s "$a" ] || continue; $(. $a) done }