Skip to content
This repository was archived by the owner on May 3, 2023. It is now read-only.

Commit 8ffb096

Browse files
committed
Workflows: Use truncate to create loop files
1 parent 3a0a210 commit 8ffb096

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

.github/workflows/build-rpi4-lean-openwrt-new.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -199,13 +199,15 @@ jobs:
199199
sudo rm -f /mnt/swapfile
200200
export ROOT_FREE_KB=$(df --block-size=1024 --output=avail / | tail -1)
201201
export ROOT_LOOP_KB=$(expr $ROOT_FREE_KB - 1048576)
202-
export ROOT_LOOP_BYTES=$(expr $ROOT_LOOP_KB \* 1024)
203-
sudo fallocate -l $ROOT_LOOP_BYTES root.img
204-
export ROOT_LOOP_DEVNAME=$(sudo losetup -f -P --show root.img)
202+
# export ROOT_LOOP_BYTES=$(expr $ROOT_LOOP_KB \* 1024)
203+
# sudo fallocate -l $ROOT_LOOP_BYTES /root.img
204+
sudo truncate -s $ROOT_LOOP_KB /root.img
205+
export ROOT_LOOP_DEVNAME=$(sudo losetup -f -P --show /root.img)
205206
export MNT_FREE_KB=$(df --block-size=1024 --output=avail /mnt | tail -1)
206207
export MNT_LOOP_KB=$(expr $MNT_FREE_KB - 102400)
207-
export MNT_LOOP_BYTES=$(expr $MNT_LOOP_KB \* 1024)
208-
sudo fallocate -l $MNT_LOOP_BYTES /mnt/mnt.img
208+
# export MNT_LOOP_BYTES=$(expr $MNT_LOOP_KB \* 1024)
209+
# sudo fallocate -l $MNT_LOOP_BYTES /mnt/mnt.img
210+
sudo truncate -s $MNT_LOOP_KB /mnt/mnt.img
209211
export MNT_LOOP_DEVNAME=$(sudo losetup -f -P --show /mnt/mnt.img)
210212
sudo mkfs.btrfs -f -d raid0 -L combinedisk $ROOT_LOOP_DEVNAME $MNT_LOOP_DEVNAME
211213
sudo mount -o nossd,compress=zstd $ROOT_LOOP_DEVNAME $GITHUB_WORKSPACE

0 commit comments

Comments
 (0)