From 88d87f6d32c900b3fce85dd417577edde2a92a37 Mon Sep 17 00:00:00 2001 From: Xavier Petit <32063953+xpetit@users.noreply.github.com> Date: Sun, 25 Aug 2019 20:22:48 +0100 Subject: [PATCH] Enhance scripts --- scripts/install_client.sh | 5 +---- scripts/system/etc/gdm3/PostSession/Default | 2 ++ .../usr/share/initramfs-tools/scripts/init-premount/reformat | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/scripts/install_client.sh b/scripts/install_client.sh index c54dd4c2..1c6c2647 100755 --- a/scripts/install_client.sh +++ b/scripts/install_client.sh @@ -63,11 +63,8 @@ cp -r system /tmp cd /tmp/system sed -i -e "s|::DISK::|$DISK|g" etc/udev/rules.d/10-local.rules -PART=$(lsblk -pro kname,partlabel | grep 01-tmp-system | cut -d' ' -f1) -sed -i -e "s|::PART::|$PART|g" usr/share/initramfs-tools/scripts/init-premount/reformat - apt-get -y install overlayroot -echo overlayroot=\"device:dev=$PART,recurse=0\" >> /etc/overlayroot.conf +echo overlayroot=\"device:dev=/dev/disk/by-partlabel/01-tmp-system,recurse=0\" >> /etc/overlayroot.conf # Fix permissions find . -type d -exec chmod 755 {} \; diff --git a/scripts/system/etc/gdm3/PostSession/Default b/scripts/system/etc/gdm3/PostSession/Default index 8f2e9bb6..9292367d 100755 --- a/scripts/system/etc/gdm3/PostSession/Default +++ b/scripts/system/etc/gdm3/PostSession/Default @@ -22,3 +22,5 @@ systemctl stop user@1000.service # Make sure the mountpoints are free kill $(lsof -t "$HOME" /mnt) $(ps --no-headers -u student -o pid) umount "$HOME" /mnt +umount /dev/disk/by-partlabel/01-home ||: +wipefs -a /dev/disk/by-partlabel/01-tmp-home diff --git a/scripts/system/usr/share/initramfs-tools/scripts/init-premount/reformat b/scripts/system/usr/share/initramfs-tools/scripts/init-premount/reformat index 4a04b992..3464ead8 100755 --- a/scripts/system/usr/share/initramfs-tools/scripts/init-premount/reformat +++ b/scripts/system/usr/share/initramfs-tools/scripts/init-premount/reformat @@ -15,6 +15,6 @@ esac . /scripts/functions -/bin/mke2fs -F -t ext4 -O ^has_journal ::PART:: > /dev/null 2>&1 +/bin/mke2fs -F -t ext4 -O ^has_journal /dev/disk/by-partlabel/01-tmp-system > /dev/null 2>&1 exit 0