Skip to content

Commit

Permalink
v9.5
Browse files Browse the repository at this point in the history
- DietPi-Software/FS_partition_resize | Sync write buffer to disk before reboots, when we just did some important updates or changes. A proper shutdown sequence implies this, but just do it as failsafe step: #6827 (comment)
  • Loading branch information
MichaIng committed Jun 2, 2024
1 parent 311da5b commit a3a4b37
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dietpi/dietpi-software
Original file line number Diff line number Diff line change
Expand Up @@ -14422,7 +14422,7 @@ _EOF_
# Create a persistent flag to not repeat G_AGDUG and rule out a reboot loop when kernel modules remain missing
G_EXEC eval '> /boot/dietpi/.skip_distro_upgrade'
# Perform a reboot if required as of missing kernel modules
G_CHECK_KERNEL || { G_DIETPI-NOTIFY 2 'A reboot is done to finalise the kernel upgrade'; reboot; }
G_CHECK_KERNEL || { G_DIETPI-NOTIFY 2 'A reboot is done to finalise the kernel upgrade'; sync; reboot; }
fi

# Global PW
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Assure that ifupdown-pre always waits for udev to settle: https://dietpi.com/forum/t/dietpi-8-2-2-wireguard-doesnt-start-after-reboot/6415/28
# Assure that ifupdown-pre always waits for udev to settle: https://dietpi.com/forum/t/6415/28
# Assure it finishes before ifup@.service instances start: https://github.com/MichaIng/DietPi/issues/6951
[Unit]
Wants=network-pre.target
Expand Down
5 changes: 3 additions & 2 deletions rootfs/var/lib/dietpi/services/fs_partition_resize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
> /dietpi_skip_partition_resize
systemctl enable dietpi-fs_partition_resize
echo '[ INFO ] Rebooting to load the new partition table'
sync
reboot
exit 0
}
Expand Down Expand Up @@ -117,7 +118,7 @@

# Maximise root filesystem if type is supported
case $ROOT_FSTYPE in
'ext'[234]) resize2fs "$ROOT_DEV" || reboot;; # Reboot if resizing fails: https://github.com/MichaIng/DietPi/issues/6149
'ext'[234]) resize2fs "$ROOT_DEV" || REBOOT=1;; # Reboot if resizing fails: https://github.com/MichaIng/DietPi/issues/6149
'f2fs')
mount -o remount,ro /
resize.f2fs "$ROOT_DEV"
Expand All @@ -131,7 +132,7 @@
esac

# Reboot if needed
(( $REBOOT )) && reboot
(( $REBOOT )) && { sync; reboot; }

exit "$EXIT_CODE"
}

0 comments on commit a3a4b37

Please sign in to comment.