From 3bd1844097180ba2bd427ed565de81937a3975e2 Mon Sep 17 00:00:00 2001 From: John Doe Date: Wed, 14 Apr 2021 22:55:23 +0800 Subject: [PATCH] autoupdate: slightly change to use built-in truncate --- scripts/autoupdate.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/scripts/autoupdate.sh b/scripts/autoupdate.sh index 3ea4e6f..ead1981 100644 --- a/scripts/autoupdate.sh +++ b/scripts/autoupdate.sh @@ -11,6 +11,7 @@ proceed_command fdisk proceed_command sfdisk proceed_command losetup proceed_command resize2fs +opkg install coreutils-truncate || true wget -P /tmp https://ghproxy.com/https://raw.githubusercontent.com/klever1988/nanopi-openwrt/zstd-bin/truncate wget -P /tmp https://ghproxy.com/https://raw.githubusercontent.com/klever1988/nanopi-openwrt/zstd-bin/ddnz chmod +x /tmp/truncate /tmp/ddnz @@ -45,7 +46,7 @@ fi mv $board_id.img FriendlyWrt.img bs=`expr $(cat /sys/block/mmcblk0/size) \* 512` -../truncate -s $bs FriendlyWrt.img +truncate -s $bs FriendlyWrt.img || ../truncate -s $bs FriendlyWrt.img echo ", +" | sfdisk -N 2 FriendlyWrt.img lodev=$(losetup -f)