sbin/overlayRoot.sh aktualisiert

This commit is contained in:
2024-12-12 23:29:18 +01:00
parent 56f754c0ee
commit 735f5be839

View File

@@ -1,17 +1,19 @@
#!/bin/bash #!/bin/bash
# This script will mount the root filesystem read-only and overlay it with a temporary tempfs # Dieses Skript wird das Root-Dateisystem schreibgeschützt einbinden und es mit einem temporären tmpfs-Overlay versehen.
# Install:
# copy this script to /sbin/overlayRoot.sh and add "init=/sbin/overlayRoot.sh" to the cmdline.txt
# file in the raspbian image's boot partition.
# #
# Execute the following commands as root: # Installation:
# Kopiere dieses Skript nach /sbin/overlayRoot.sh und füge "init=/sbin/overlayRoot.sh" zur cmdline.txt-Datei
# in der Boot-Partition des Raspbian-Images hinzu.
#
# Führe die folgenden Befehle als root aus:
# sudo dphys-swapfile swapoff # sudo dphys-swapfile swapoff
# sudo dphys-swapfile uninstall # sudo dphys-swapfile uninstall
# sudo update-rc.d dphys-swapfile remove # sudo update-rc.d dphys-swapfile remove
# #
# To install software, run upgrades and do other changes to the raspberry setup, simply remove the init=/sbin/overlayRoot.sh # Um Software zu installieren, Upgrades durchzuführen und andere Änderungen an der Raspberry-Konfiguration vorzunehmen,
# entry from the cmdline.txt file and reboot, make the changes, add the init= entry and reboot once more. # entferne einfach den Eintrag "init=/sbin/overlayRoot.sh" aus der cmdline.txt-Datei und starte das System neu.
# Nimm die gewünschten Änderungen vor, füge den init= Eintrag wieder hinzu und starte erneut neu.
set -e set -e
fail() { fail() {
@@ -49,7 +51,7 @@ mkdir -p /overlay/newroot/overlay/ro /overlay/newroot/overlay/rw
grep -v "$rootDev" /overlay/lower/etc/fstab > /overlay/newroot/etc/fstab grep -v "$rootDev" /overlay/lower/etc/fstab > /overlay/newroot/etc/fstab
cat <<EOF >> /overlay/newroot/etc/fstab cat <<EOF >> /overlay/newroot/etc/fstab
# Das originale Root-Dateisystem wurde durch overlayRoot.sh entfernt. # Das originale Root-Dateisystem wurde durch overlayRoot.sh entfernt.
# Diese Änderung ist temporär. Die originale fstab ist in /ro/etc/fstab verfügbar. # Diese änderung ist temporär. Die originale fstab ist in /overlay/ro/etc/fstab verfügbar.
EOF EOF
# Root wechseln und alte Root aufräumen # Root wechseln und alte Root aufräumen