diff --git a/pikainstall/debian/changelog b/pikainstall/debian/changelog index a525609..2a675d4 100644 --- a/pikainstall/debian/changelog +++ b/pikainstall/debian/changelog @@ -1,4 +1,4 @@ -pikainstall (1.0-100pika1) pikauwu; urgency=medium +pikainstall (1.0.1-100pika1) pikauwu; urgency=medium * Initial release. diff --git a/pikainstall/debian/control b/pikainstall/debian/control index 9c44616..53f6b07 100644 --- a/pikainstall/debian/control +++ b/pikainstall/debian/control @@ -8,5 +8,5 @@ Rules-Requires-Root: no Package: pikainstall Architecture: linux-any -Depends: ${misc:Depends}, squashfs-tools, arch-install-scripts +Depends: ${misc:Depends}, squashfs-tools, arch-install-scripts, cryptsetup Description: Command line installer for PikaOS diff --git a/pikainstall/usr/lib/pika/pikainstall/pika-install-chroot.sh b/pikainstall/usr/lib/pika/pikainstall/pika-install-chroot.sh index 36d3f21..78bb0d7 100755 --- a/pikainstall/usr/lib/pika/pikainstall/pika-install-chroot.sh +++ b/pikainstall/usr/lib/pika/pikainstall/pika-install-chroot.sh @@ -1,6 +1,11 @@ #! /bin/bash apt remove casper -y apt autoremove -y +if [ -f /tmp/albius-crypttab-root.sh ] +then + chmod +x /tmp/albius-crypttab-root.sh + /tmp/albius-crypttab-root.sh +fi if [ -f /tmp/albius-crypttab.sh ] then chmod +x /tmp/albius-crypttab.sh diff --git a/pikainstall/usr/lib/pika/pikainstall/pikainstall b/pikainstall/usr/lib/pika/pikainstall/pikainstall index 508f869..3869b23 100755 --- a/pikainstall/usr/lib/pika/pikainstall/pikainstall +++ b/pikainstall/usr/lib/pika/pikainstall/pikainstall @@ -6,7 +6,7 @@ import subprocess import os # Version -version="1.0" +version="1.0.1" dist="PikaOS 3" image="/cdrom/casper/filesystem.squashfs" @@ -21,9 +21,13 @@ echo '"'Boot with logging'"' '"'nvidia-drm.modeset=1 root=UUID={ROOT_PART_UUID} echo '"'Boot with safe graphics'"' '"'nvidia-drm.modeset=1 root=UUID={ROOT_PART_UUID} nomodeset ---'"' >> /boot/refind_linux.conf """ -_CRYPTTAB_SETUP_FILE = """#!/usr/bin/bash +_CRYPTTAB_ROOT_SETUP_FILE = """#!/usr/bin/bash cat /etc/crypttab echo "crypt_root UUID={ROOT_PART_UUID} none luks,discard" > /etc/crypttab +""" + +_CRYPTTAB_SETUP_FILE = """#!/usr/bin/bash +cat /etc/crypttab echo "crypt_home UUID={HOME_PART_UUID} /keyfile.txt luks" >> /etc/crypttab touch /keyfile.txt openssl genrsa > /keyfile.txt @@ -131,16 +135,26 @@ subprocess.run(efi_flag_cmd) CHROOT_PATH = listToString(args.root) # Write crypttab script if system has encryption -if home_encrypt == "luks_none": - CRYPTTAB_FILE_PATH = '/tmp/albius-crypttab.sh' - CHROOT_CRYPTTAB_FILE_PATH=os.path.join(dir,file) - with open(CHROOT_CRYPTTAB_FILE_PATH, "w") as file: - albius_crypttab_file = _CRYPTTAB_SETUP_FILE.format( +if root_encrypt != "luks_none": + CRYPTTAB_ROOT_FILE_PATH = '/tmp/albius-crypttab-root.sh' + CHROOT_CRYPTTAB_ROOT_FILE_PATH = os.path.join(CHROOT_PATH,CRYPTTAB_ROOT_FILE_PATH) + with open(CHROOT_CRYPTTAB_ROOT_FILE_PATH, "w") as file: + albius_crypttab_root_file = _CRYPTTAB_ROOT_SETUP_FILE.format( ROOT_PART_UUID=root_uuid, - HOME_PART_UUID=home_uuid, - LUKS_PASSWD=home_passwd, ) - file.write(albius_crypttab_file) + file.write(albius_crypttab_root_file) + +# Write crypttab script if system has encryption +if args.home is not None: + if home_encrypt != "luks_none": + CRYPTTAB_FILE_PATH = '/tmp/albius-crypttab.sh' + CHROOT_CRYPTTAB_FILE_PATH =os .path.join(CHROOT_PATH,CRYPTTAB_FILE_PATH) + with open(CHROOT_CRYPTTAB_FILE_PATH, "w") as file: + albius_crypttab_file = _CRYPTTAB_SETUP_FILE.format( + HOME_PART_UUID=home_uuid, + LUKS_PASSWD=home_passwd, + ) + file.write(albius_crypttab_file) # Write refind script if system has encryption REFIND_FILE_PATH = '/tmp/albius-refind_linux.sh'