Skip to content

Commit 38f8c68

Browse files
committed
.
1 parent 8617168 commit 38f8c68

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

lib.sh

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,21 @@ umount_rootfs_all(){
7575
rm "$ROOTFS_LOCK" || fail
7676
}
7777

78+
resize_rootfs_interactive(){
79+
[ -f "$ROOTFS_LOCK" ] && fail "rootfs mounted."
80+
echo "Please enter the rootfs size and press Enter (e.g. 1000M):"
81+
if read ROOTFS_SIZE && [ -n "$ROOTFS_SIZE" ]; then
82+
resize2fs "$ROOTFS_IMG" "$ROOTFS_SIZE" || fail "cannot resize."
83+
else
84+
resize2fs "$ROOTFS_IMG" 512M || fail "cannot resize."
85+
fi
86+
}
87+
7888
install_rootfs(){
7989
[ -f "$ROOTFS_LOCK" ] && fail "rootfs mounted."
8090
rm -fr "$ROOTFS_IMG" || fail
91+
cp rootfs."$ROOTFS_TYPE".base "$ROOTFS_IMG" || fail
92+
resize_rootfs_interactive
8193
mount_rootfs_base
8294
curl "$(get_rootfs_tgz_url)" | tar -xvz -C "$ROOTFS_DIR" || fail "download and extract rootfs: failed."
8395
umount_rootfs_all

0 commit comments

Comments
 (0)