Skip to content

Commit 0f6668b

Browse files
committed
delay get_rootfs_tgz_url
1 parent d9ecf92 commit 0f6668b

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

install.alpine.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,6 @@ get_rootfs_tgz_url(){
1515
echo "http://dl-cdn.alpinelinux.org/alpine/edge/releases/armhf/$(get_rootfs_tgz_filename)"
1616
}
1717

18-
install_tgz_rootfs "$(get_rootfs_tgz_url)"
18+
install_tgz_rootfs "get_rootfs_tgz_url"
1919

2020
quit

install.ubuntu.1904.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44

55
[ -f "$ROOTFS_IMG" ] && fail "rootfs exist.Please remove it and continue."
66

7-
install_tgz_rootfs "http://mirrors.ustc.edu.cn/ubuntu-cdimage/ubuntu-base/releases/19.04/release/ubuntu-base-19.04-base-armhf.tar.gz"
7+
get_rootfs_tgz_url(){
8+
echo "http://mirrors.ustc.edu.cn/ubuntu-cdimage/ubuntu-base/releases/19.04/release/ubuntu-base-19.04-base-armhf.tar.gz"
9+
}
10+
11+
install_tgz_rootfs "get_rootfs_tgz_url"
812

913
quit

lib.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,12 @@ resize_rootfs_interactive(){
133133
}
134134

135135
install_tgz_rootfs(){
136-
local ROOTFS_TGZ_URL="$1"
137136
[ -f "$ROOTFS_LOCK" ] && fail "rootfs mounted."
138137
rm -fr "$ROOTFS_IMG" || fail
139138
cp rootfs."$ROOTFS_TYPE".base "$ROOTFS_IMG" || fail
140139
resize_rootfs_interactive
141140
mount_rootfs_base
141+
local ROOTFS_TGZ_URL="$("$1")" # Delay
142142
curl "$ROOTFS_TGZ_URL" | tar -xvz -C "$ROOTFS_DIR" || fail "download and extract rootfs: failed."
143143
umount_rootfs_all
144144
}

0 commit comments

Comments
 (0)