Skip to content

Commit 54629bf

Browse files
committed
fs_partition_resize: avoid unnecessary final 0.5 seconds delay
If the setup partition is detected directly, no additional log will be done. The additional "1/3" log now means that additional 0.5 seconds are waited, before checking again, and the last "3/3" log means that overall 1.5 seconds has been waited, before the final check is done.
1 parent db18f8c commit 54629bf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

rootfs/var/lib/dietpi/services/fs_partition_resize.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@
4545

4646
# Check if the last partition contains a filesystem with DIETPISETUP label
4747
# - Give up to 1.5 seconds time for filesystem and label to be detected: https://github.com/MichaIng/DietPi/issues/6838
48-
SETUP_PART=
48+
SETUP_PART=$(lsblk -no FSTYPE,LABEL "$ROOT_DRIVE" | tail -1)
4949
for i in 1 2 3
5050
do
51-
echo "[ INFO ] Detecting tailing DietPi setup partition $i/3"
52-
SETUP_PART=$(lsblk -no FSTYPE,LABEL "$ROOT_DRIVE" | tail -1)
5351
[[ $SETUP_PART == *[[:alpha:]]* ]] && break
52+
echo "[ INFO ] Detecting tailing DietPi setup partition $i/3"
5453
sleep 0.5
54+
SETUP_PART=$(lsblk -no FSTYPE,LABEL "$ROOT_DRIVE" | tail -1)
5555
done
56-
if [[ $SETUP_PART == *' DIETPISETUP' ]]
56+
if [[ $SETUP_PART == *'DIETPISETUP' ]]
5757
then
5858
SETUP_PART=$(sfdisk -lqo DEVICE "$ROOT_DRIVE" | tail -1)
5959
echo "[ INFO ] Detected trailing DietPi setup partition $SETUP_PART"

0 commit comments

Comments
 (0)