Make sanity checks even stricter and fix efi path

This commit is contained in:
Ward Nakchbandi (Cosmic Fusion) 2024-01-05 21:44:48 +03:00 committed by GitHub
parent 3ef0c27856
commit ee34c01712
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 40 additions and 40 deletions

View File

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

View File

@ -29,8 +29,8 @@ chmod +x /var/albius-refind_linux.sh
refind-install
apt install -y /var/cache/apt/archives/pika-refind-theme*.deb /var/cache/apt/archives/booster*.deb
# EFI workaround for MSI
mkdir -p /boot/EFI/BOOT
cp -vf /boot/EFI/refind/refind_x64.efi /boot/EFI/BOOT/BOOTX64.EFI
mkdir -p /boot/efi/EFI/BOOT
cp -vf /boot/efi/EFI/refind/refind_x64.efi /boot/efi/EFI/BOOT/BOOTX64.EFI
# Remove installer from installed system
apt remove casper vanilla-installer -y || true
apt autoremove -y || true

View File

@ -124,6 +124,37 @@ if args.home is not None:
# Checks
# Make sure mountpoints are not /dev prefixes
if args.root[0].startswith('/dev'):
print("Error: Root mount point is pointed a device, please use a mountpoint.")
exit(1)
if args.boot[0].startswith('/dev'):
print("Error: Boot mount point is pointed a device, please use a mountpoint.")
exit(1)
if args.efi[0].startswith('/dev'):
print("Error: EFI mount point is pointed a device, please use a mountpoint.")
exit(1)
if args.home is not None:
if args.home[0].startswith('/dev'):
print("Error: Home mount point is pointed a device, please use a mountpoint.")
exit(1)
# Make sure All mounts are in the correct place releative to chroot
if args.boot[0] == f"{args.root[0]}/boot":
print("Boot Partition Check: OK!")
else:
print(f"Error: Boot mount point is not in a correct place relative to chroot, please mount it in {args.root[0]}/boot and supply the new mountpoint!")
exit(1)
if args.efi[0] == f"{args.root[0]}/boot/efi":
print("EFI Partition Check: OK!")
else:
print(f"Error: EFI mount point is not in a correct place relative to chroot, please mount it in {args.root[0]}/boot/efi and supply the new mountpoint!")
exit(1)
if args.home is not None:
if args.home[0] == f"{args.root[0]}/home":
print("Home Partition Check: OK!")
else:
print(f"Error: Home mount point is not in a correct place relative to chroot, please mount it in {args.root[0]}/home and supply the new mountpoint!")
exit(1)
# Make sure to avoid any mounts pointing at the same partition
if root_uuid == boot_uuid:
print("Error: Root and Boot are mounted on the same drive, please place boot on it's own partition.")
@ -144,37 +175,6 @@ elif args.home is not None:
elif efi_uuid == home_uuid:
print("Error: EFI and Home are mounted on the same drive, consider removing the -H/--home argument.")
exit(1)
# Make sure mountpoints are not /dev prefixes
if args.root[0].startswith('/dev'):
print("Error: Root mount point is pointed a device, please use a mountpoint.")
exit(1)
if args.boot[0].startswith('/dev'):
print("Error: Boot mount point is pointed a device, please use a mountpoint.")
exit(1)
if args.efi[0].startswith('/dev'):
print("Error: EFI mount point is pointed a device, please use a mountpoint.")
exit(1)
if args.home is not None:
if args.home[0].startswith('/dev'):
print("Error: Home mount point is pointed a device, please use a mountpoint.")
exit(1)
# Make sure All mounts are releative to chroot
if args.boot[0].startswith(args.root[0]):
print("Boot Partition Check: OK!")
else:
print("Error: Boot mount point is not relative to chroot, please mount it some inside the chroot and supply the new mountpoint!")
exit(1)
if args.efi[0].startswith(args.root[0]):
print("EFI Partition Check: OK!")
else:
print("Error: EFI mount point is not relative to chroot, please mount it some inside the chroot and supply the new mountpoint!")
exit(1)
if args.home is not None:
if args.home[0].startswith(args.root[0]):
print("Home Partition Check: OK!")
else:
print("Error: Home mount point is not relative to chroot, please mount it some inside the chroot and supply the new mountpoint!")
exit(1)
# With All Checks Clear and info gathered let's start installing