Skip to content

Commit

Permalink
rockchip basefiles: update setup.sh keep fstab config for /opt
Browse files Browse the repository at this point in the history
  • Loading branch information
lawrencetg committed Feb 17, 2025
1 parent d368aba commit 5211973
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion target/linux/rockchip/armv8/base-files/root/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,17 @@ function init_button() {
}

function clean_fstab() {
while uci -q del fstab.@mount[-1]; do true; done
# delete all entries but keep /opt
local index=0
while uci -q get fstab.@mount[$index]; do
local target=$(uci -q get fstab.@mount[$index].target)
if [ "$target" = "/opt" ]; then
index=$((index + 1))
else
uci -q del fstab.@mount[$index]
# do not increment index because the remaining entries will shift forward after deletion
fi
done
uci commit fstab
}

Expand Down

0 comments on commit 5211973

Please sign in to comment.