fix file writers maybe?

This commit is contained in:
Ward from fusion-voyager-3 2023-10-20 18:27:56 +03:00
parent 0bba839821
commit 4038e43c68
3 changed files with 21 additions and 15 deletions

View File

@ -1,4 +1,4 @@
pikainstall (1.0.1-100pika1) pikauwu; urgency=medium pikainstall (1.0.2-100pika1) pikauwu; urgency=medium
* Initial release. * Initial release.

View File

@ -1,18 +1,18 @@
#! /bin/bash #! /bin/bash
apt remove casper -y apt remove casper -y
apt autoremove -y apt autoremove -y
if [ -f /tmp/albius-crypttab-root.sh ] if [ -f /var/albius-crypttab-root.sh ]
then then
chmod +x /tmp/albius-crypttab-root.sh chmod +x /var/albius-crypttab-root.sh
/tmp/albius-crypttab-root.sh /var/albius-crypttab-root.sh
fi fi
if [ -f /tmp/albius-crypttab.sh ] if [ -f /var/albius-crypttab.sh ]
then then
chmod +x /tmp/albius-crypttab.sh chmod +x /var/albius-crypttab.sh
/tmp/albius-crypttab.sh /var/albius-crypttab.sh
fi fi
chmod +x /tmp/albius-refind_linux.sh chmod +x /var/albius-refind_linux.sh
/tmp/albius-refind_linux.sh /var/albius-refind_linux.sh
refind-install refind-install
apt install -y /var/cache/apt/archives/pika-refind-theme*.deb apt install -y /var/cache/apt/archives/pika-refind-theme*.deb
apt install -y /var/cache/apt/archives/booster*.deb apt install -y /var/cache/apt/archives/booster*.deb

View File

@ -6,7 +6,7 @@ import subprocess
import os import os
# Version # Version
version="1.0.1" version="1.0.2"
dist="PikaOS 3" dist="PikaOS 3"
image="/cdrom/casper/filesystem.squashfs" image="/cdrom/casper/filesystem.squashfs"
@ -136,8 +136,10 @@ CHROOT_PATH = listToString(args.root)
# Write crypttab script if system has encryption # Write crypttab script if system has encryption
if root_encrypt != "luks_none": if root_encrypt != "luks_none":
CRYPTTAB_ROOT_FILE_PATH = '/tmp/albius-crypttab-root.sh' CRYPTTAB_ROOT_FILE_PATH = '/var/albius-crypttab-root.sh'
CHROOT_CRYPTTAB_ROOT_FILE_PATH = os.path.join(CHROOT_PATH,CRYPTTAB_ROOT_FILE_PATH) CHROOT_CRYPTTAB_ROOT_FILE_PATH = os.path.join(CHROOT_PATH,CRYPTTAB_ROOT_FILE_PATH)
print("writing to:")
print(CHROOT_CRYPTTAB_ROOT_FILE_PATH)
with open(CHROOT_CRYPTTAB_ROOT_FILE_PATH, "w") as file: with open(CHROOT_CRYPTTAB_ROOT_FILE_PATH, "w") as file:
albius_crypttab_root_file = _CRYPTTAB_ROOT_SETUP_FILE.format( albius_crypttab_root_file = _CRYPTTAB_ROOT_SETUP_FILE.format(
ROOT_PART_UUID=root_uuid, ROOT_PART_UUID=root_uuid,
@ -147,8 +149,10 @@ if root_encrypt != "luks_none":
# Write crypttab script if system has encryption # Write crypttab script if system has encryption
if args.home is not None: if args.home is not None:
if home_encrypt != "luks_none": if home_encrypt != "luks_none":
CRYPTTAB_FILE_PATH = '/tmp/albius-crypttab.sh' CRYPTTAB_FILE_PATH = '/var/albius-crypttab.sh'
CHROOT_CRYPTTAB_FILE_PATH = os.path.join(CHROOT_PATH,CRYPTTAB_FILE_PATH) CHROOT_CRYPTTAB_FILE_PATH = os.path.join(CHROOT_PATH,CRYPTTAB_FILE_PATH)
print("writing to:")
print(CHROOT_CRYPTTAB_FILE_PATH)
with open(CHROOT_CRYPTTAB_FILE_PATH, "w") as file: with open(CHROOT_CRYPTTAB_FILE_PATH, "w") as file:
albius_crypttab_file = _CRYPTTAB_SETUP_FILE.format( albius_crypttab_file = _CRYPTTAB_SETUP_FILE.format(
HOME_PART_UUID=home_uuid, HOME_PART_UUID=home_uuid,
@ -157,8 +161,10 @@ if args.home is not None:
file.write(albius_crypttab_file) file.write(albius_crypttab_file)
# Write refind script if system has encryption # Write refind script if system has encryption
REFIND_FILE_PATH = '/tmp/albius-refind_linux.sh' REFIND_FILE_PATH = '/var/albius-refind_linux.sh'
CHROOT_REFIND_FILE_PATH=os.path.join(dir,file) CHROOT_REFIND_FILE_PATH = os.path.join(CHROOT_PATH,REFIND_FILE_PATH)
print("writing to:")
print(CHROOT_REFIND_FILE_PATH)
with open(CHROOT_REFIND_FILE_PATH, "w") as file: with open(CHROOT_REFIND_FILE_PATH, "w") as file:
refind_crypttab_file = _REFIND_SETUP_FILE.format( refind_crypttab_file = _REFIND_SETUP_FILE.format(
ROOT_PART_UUID=root_uuid, ROOT_PART_UUID=root_uuid,