personal_scripts

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit 407dbda2f9bd499f0c33372bdcf02c122ea5a634
parent 9754a52f925cd9eb635d179d8115f75dcde3ef2c
Author: mrgrouse <bdmfegys@duck.com>
Date:   Mon, 13 May 2024 00:32:23 -0400

artix-install.sh: add initramfs generator checker; add variable for decrypted root drive; fix minor mistakes

Diffstat:
Martix-install.sh | 27++++++++++++++++++++-------
1 file changed, 20 insertions(+), 7 deletions(-)

diff --git a/artix-install.sh b/artix-install.sh @@ -39,9 +39,11 @@ get_var "Which Drive should be the /boot partition:" boot_drive get_var "Which init system (options: dinit, s6, runit, openrc):" init + + ### FORMATTING DRIVES ### # clear drive -wipe_drive urandom $root_drive +wipe_drive urandom $root_drive && sync # encrypt drive cryptsetup luksFormat $root_drive && sync @@ -52,12 +54,16 @@ mkfs.fat -F 32 $boot_drive && sync # format drive fatlabel $boot_drive ESP && sync # label drive ### MOUNTING DRIVES ### -# TODO: crypto=decrypted drive cryptname=cryptlvm # for further customizabity(?) +crypto=/dev/mapper/$cryptname # decrypted drive name + cryptsetup open $root_drive $cryptname + rtmnt=/mnt # mountpoint of root drive -mount $crypto $rtmnt -mount $boot_drive $rtmnt/boot + +mount $crypto $rtmnt # mount decrypted root drive +mount $boot_drive $rtmnt/boot # mount unencrypted boot drive in /boot of installation + ### INSTALLING MAIN SYSTEM ### get_var "Which kernel would you like to install:" kernel @@ -67,7 +73,7 @@ basestrap /mnt base base-devel $kernel $kernel-headers networkmanager-$init # generate fstab fstabgen -U $rtmnt >> $rtmnt/etc/fstab -artix-chroot $rtmnt # 🤨🤨🤨 +artix-chroot $rtmnt # FIX THIS PLEASE FIXME TODO BIG TIME # set timezome ln -sf /usr/share/zoneinfo/$country/$timezone /etc/localtime @@ -81,5 +87,12 @@ sed -i '1s/^/GRUB_/' file_name grub-mkconfig -o /boot/grub/grub.cfg # build & compress initramfs -# TODO: add compatibility with other initramfs generators -mkinitcpio -P +initramfs_checker () { + which $1 && initramfsgen=$1 +} + +initramfs_checker mkinitcpio || initramfs_checker dracut + +[ initramfsgen == dracut ] && dracut --regenerate-all --force +[ initramfsgen == mkinitcpio ] && mkinitcpio -P +