Browse Source

Add persistent mode (just set the variable : PERSISTENT=)

content-update
Xavier Petit 5 years ago
parent
commit
8ecb685a96
  1. 50
      scripts/install_client.sh

50
scripts/install_client.sh

@ -63,6 +63,8 @@ ubuntu-drivers install ||:
cp -r system /tmp cp -r system /tmp
cd /tmp/system cd /tmp/system
test -v PERSISTENT && rm -rf etc/gdm3 usr/share/initramfs-tools
# Overwrite with custom files from Git repository # Overwrite with custom files from Git repository
if test -v OVERWRITE; then if test -v OVERWRITE; then
folder=$(echo "$OVERWRITE" | cut -d';' -f1) folder=$(echo "$OVERWRITE" | cut -d';' -f1)
@ -94,36 +96,38 @@ cp --preserve=mode -RT . /
cd $script_dir cd $script_dir
rm -rf /tmp/system rm -rf /tmp/system
sgdisk -n0:0:+32G "$disk" if ! test -v PERSISTENT; then
sgdisk -N0 "$disk" sgdisk -n0:0:+32G "$disk"
sgdisk -c3:01-tmp-home "$disk" sgdisk -N0 "$disk"
sgdisk -c4:01-tmp-system "$disk" sgdisk -c3:01-tmp-home "$disk"
sgdisk -c4:01-tmp-system "$disk"
# Remove fsck because the system partition will be read-only (overlayroot) # Remove fsck because the system partition will be read-only (overlayroot)
rm /usr/share/initramfs-tools/hooks/fsck rm /usr/share/initramfs-tools/hooks/fsck
apt-get -y install overlayroot apt-get -y install overlayroot
echo 'overlayroot="device:dev=/dev/disk/by-partlabel/01-tmp-system,recurse=0"' >> /etc/overlayroot.conf echo 'overlayroot="device:dev=/dev/disk/by-partlabel/01-tmp-system,recurse=0"' >> /etc/overlayroot.conf
update-initramfs -u update-initramfs -u
# Lock root password # Lock root password
passwd -l root passwd -l root
# Disable user password # Disable user password
passwd -d student passwd -d student
# Remove tty # Remove tty
cat <<EOF>> /etc/systemd/logind.conf cat <<EOF>> /etc/systemd/logind.conf
NAutoVTs=0 NAutoVTs=0
ReserveVT=N ReserveVT=N
EOF EOF
# Remove user abilities # Remove user abilities
gpasswd -d student sudo gpasswd -d student sudo
gpasswd -d student lpadmin gpasswd -d student lpadmin
gpasswd -d student sambashare gpasswd -d student sambashare
cp /etc/shadow /etc/shadow- cp /etc/shadow /etc/shadow-
fi
. clean.sh . clean.sh

Loading…
Cancel
Save