Skip to content

Commit b70b0c7

Browse files
committed
firstboot: fixed partition and file system extension
1 parent 78ca22f commit b70b0c7

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

system/overall/crux/root/firstboot

+4-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ case "$1" in
1313
[[ $(free | grep Mem | awk '{print $2}') -lt $((1024*512)) ]] && swap_size=$((1024*512))
1414

1515
if [ -f /root/part ]; then
16-
echo -e "\e[0;37mResizing SD card file-system\x1B[0m"
17-
/sbin/resize2fs -p /dev/${device}${partition} >/dev/null
18-
1916
echo -e "\e[0;37mCreating $(($swap_size/1024))Mb emergency swap area\x1B[0m"
2017
dd if=/dev/zero of=/swap bs=1024 count=$swap_size status=noxfer >/dev/null 2>&1
2118
chown root:root /swap
@@ -41,6 +38,10 @@ case "$1" in
4138
# add part one
4239
touch /root/part
4340

41+
sleep 2
42+
echo -e "\e[0;37mResizing SD card file-system\x1B[0m"
43+
/sbin/resize2fs -p /dev/${device}${partition} >/dev/null
44+
4445
sleep 2
4546
shutdown -r now
4647
fi

system/overall/slackware/tmp/firstboot

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,11 @@ case "$1" in
88
device=$(lsblk -in | grep "/$" | cut -d '-' -f2 | cut -d ' ' -f1 | sed 's/^\([a-z]*\)\([0-9]*\)\(\w*\)/\1\2/')
99
partition=$(lsblk -in | grep "/$" | cut -d '-' -f2 | cut -d ' ' -f1 | grep -oP '(?<=\d)p(\d*)')
1010

11-
1211
# size swap
1312
swap_size=131072
1413
[[ $(free | grep Mem | awk '{print $2}') -lt $((1024*512)) ]] && swap_size=$((1024*512))
1514

1615
if [ -f /tmp/part ]; then
17-
echo -e "\e[0;37mResizing SD card file-system\x1B[0m"
18-
/sbin/resize2fs -p /dev/${device}${partition} >/dev/null
19-
2016
echo -e "\e[0;37mCreating $(($swap_size/1024))Mb emergency swap area\x1B[0m"
2117
dd if=/dev/zero of=/swap bs=1024 count=$swap_size status=noxfer >/dev/null 2>&1
2218
chown root:root /swap
@@ -45,6 +41,10 @@ case "$1" in
4541
# add part one
4642
touch /tmp/part
4743

44+
sleep 2
45+
echo -e "\e[0;37mResizing SD card file-system\x1B[0m"
46+
/sbin/resize2fs -p /dev/${device}${partition} >/dev/null
47+
4848
sleep 2
4949
shutdown -r now
5050
fi

0 commit comments

Comments
 (0)