diff --git a/pikainstall/usr/lib/pika/pikainstall/pika-install-host.sh b/pikainstall/usr/lib/pika/pikainstall/pika-install-host.sh index ef9186c..53f3880 100755 --- a/pikainstall/usr/lib/pika/pikainstall/pika-install-host.sh +++ b/pikainstall/usr/lib/pika/pikainstall/pika-install-host.sh @@ -1,22 +1,28 @@ #! /bin/bash + +# Mount host partitions to chroot mkdir -pv "$1"/media/cdrom mount --bind /cdrom "$1"/media/cdrom -mount --rbind /dev "$1"/dev -mount --rbind /dev/pts "$1"/dev/pts -mount --rbind /proc "$1"/proc -mount --rbind /sys "$1"/sys -mount --rbind /run "$1"/run +mount --bind /dev "$1/dev" +mount -t tmpfs run "$1/run" -o mode=0755,nosuid,nodev +mount -t proc proc "$1/proc" -o nosuid,nodev,noexec +mount -t sysfs sys "$1/sys" -o nosuid,nodev,noexec,ro +# Delete unwanted kernels rm -rfv "$1"/boot/*arch* +# Copy cdrom pool to apt cache mkdir -p "$1"/var/cache/apt/archives cp -rvf /cdrom/pool/main/* "$1"/var/cache/apt/archives/ +# Run Chroot Commands mkdir -pv "$1"/usr/lib/pika/pikainstall/ cp -rvf /usr/lib/pika/pikainstall/pika-install-chroot.sh "$1"/usr/lib/pika/pikainstall/ chroot "$1" /bin/bash -c "/usr/lib/pika/pikainstall/pika-install-chroot.sh" +# Setup Disk Encryption if [ -f /var/albius-crypttab-manual.sh ] then chmod +x /var/albius-crypttab-manual.sh /var/albius-crypttab-manual.sh fi +# Setup Swaps if [ -f /tmp/pika-installer-gtk4-swaplist ] then for i in $(cat /tmp/pika-installer-gtk4-swaplist) @@ -24,3 +30,9 @@ then echo "UUID="$(blkid -s UUID -o value $i)" none swap sw 0 0" >> "$1"/etc/fstab done fi +# Unmount host partitions from chroot +umount "$1/media/cdrom" || umount -lf "$1/media/cdrom" || true +umount "$1/dev" || umount -lf "$1/dev" || true +umount "$1/run" || umount -lf "$1/run" || true +umount "$1/proc" || umount -lf "$1/proc" || true +umount "$1/sys" || umount -lf "$1/sys" || true