Skip to content

Commit

Permalink
v9.1
Browse files Browse the repository at this point in the history
- dietpi-rpi-firmware-migration | Stop services and unmount /boot before editing fstab, to keep the changes minimal if this unmounting fails
  • Loading branch information
MichaIng committed Jan 25, 2024
1 parent eb071d8 commit f843301
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .meta/dietpi-rpi-firmware-migration
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@ G_CHECK_FREESPACE / 200
G_INIT
# Import DietPi-Globals ---------------------------------------------------------------

export DISABLE_SERVICES_START=1
/boot/dietpi/dietpi-update 1
/boot/dietpi/dietpi-services stop

# Temporary rootfs mount
G_EXEC mkdir -p rootfs
Expand All @@ -23,12 +25,12 @@ G_EXEC cp -an /boot/dietpi* rootfs/boot/
G_EXEC chmod -x rootfs/boot/dietpi{.txt,/.??*,/func/dietpi-globals}

# Remount bootfs to /boot/firmware
G_EXEC mkdir -p rootfs/boot/firmware
findmnt -M /boot &> /dev/null && G_EXEC umount /boot
G_EXEC umount rootfs
G_EXEC mkdir -p /boot/firmware
G_EXEC sed -i 's|[[:blank:]]/boot[[:blank:]]| /boot/firmware |' /etc/fstab
G_EXEC systemctl daemon-reload
findmnt -M /boot &> /dev/null && G_EXEC umount /boot
findmnt -M /boot/firmware &> /dev/null || G_EXEC mount /boot/firmware
G_EXEC umount rootfs

# Generate config symlinks
G_EXEC ln -sf firmware/cmdline.txt /boot/cmdline.txt
Expand Down

0 comments on commit f843301

Please sign in to comment.