From 33894187fdafff930958328769c503b6130e511e Mon Sep 17 00:00:00 2001 From: git Date: Fri, 28 Jun 2024 11:19:29 +0200 Subject: [PATCH] Bios and Efi pre-chroot separate --- artix_scripts/after-chroot.sh | 2 +- artix_scripts/pre-chroot-bios.sh | 39 +++++++++++++++++++ .../{pre-chroot.sh => pre-chroot-efi.sh} | 0 3 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 artix_scripts/pre-chroot-bios.sh rename artix_scripts/{pre-chroot.sh => pre-chroot-efi.sh} (100%) diff --git a/artix_scripts/after-chroot.sh b/artix_scripts/after-chroot.sh index a821bee..4dbcfbe 100755 --- a/artix_scripts/after-chroot.sh +++ b/artix_scripts/after-chroot.sh @@ -36,7 +36,7 @@ pacman -S dosfstools freetype2 fuse2 gptfdisk libisoburn mtools os-prober grub e sed -i "s/quiet/quiet resume=UUID=`blkid -s UUID -o value /dev/lvmSystem/volSwap`/g" /etc/default/grub && \ sed -i "s/GRUB_CMDLINE_LINUX=\"\"/GRUB_CMDLINE_LINUX=\"cryptdevice=UUID=`blkid -s UUID -o value $DISK\2`:lvm-system\"/g" /etc/default/grub && \ sed -i "s/#GRUB_ENABLE_CRYPTODISK/GRUB_ENABLE_CRYPTODISK/g" /etc/default/grub -if [ $BIOSorEFI == "EFI"]; then +if [ $BIOSorEFI == "EFI" ]; then grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=artix --recheck $DISK else grub-install --target=i386-pc $DISK --bootloader-id=artix --recheck $DISK diff --git a/artix_scripts/pre-chroot-bios.sh b/artix_scripts/pre-chroot-bios.sh new file mode 100644 index 0000000..5b387a0 --- /dev/null +++ b/artix_scripts/pre-chroot-bios.sh @@ -0,0 +1,39 @@ +#!/bin/bash + +source env.sh + +#Parted +pacman -Sy && \ +yes | pacman -S parted && \ +parted -s $DISK mklabel msdos && \ +parted -s -a optimal $DISK mkpart "primary" "ext4" "0%" "100%" && \ +parted -s $DISK set 1 boot on && \ +parted -s $DISK set 1 lvm on && \ + +#Cryptosetup +cryptsetup luksFormat --type=luks1 $DISK\1 && \ +cryptsetup open $DISK\1 lvm-system && \ + +#Lvm setup +pvcreate /dev/mapper/$CRYPT_N +vgcreate $LVM_N /dev/mapper/$CRYPT_N + +lvcreate -L 2G $LVM_N -n volSwap && \ +lvcreate -L 10G $LVM_N -n volRoot && \ +lvcreate -L 2G $LVM_N -n volHome && \ + +#Filesystems and mount +mkswap /dev/$LVM_N/volSwap && \ +mkfs.ext4 -L volRoot /dev/$LVM_N/volRoot && \ +mkfs.ext4 -L volHome /dev/$LVM_N/volHome && \ +swapon /dev/$LVM_N/volSwap && \ +mount /dev/$LVM_N/volRoot /mnt && \ +mkdir -p /mnt/home && \ +mount /dev/$LVM_N/volHome /mnt/home && \ + +#basestrap, fstab, chroot +basestrap /mnt base base-devel openrc elogind-openrc linux-hardened linux-hardened-headers linux-firmware && \ +fstabgen -U /mnt >> /mnt/etc/fstab && \ +echo "tmpfs /tmp tmpfs rw,nosuid,noatime,nodev,size=4G,mode=1777 0 0" >> /mnt/etc/fstab && \ +cp after-chroot.sh env.sh /mnt/root/ && \ +artix-chroot /mnt /bin/bash \ No newline at end of file diff --git a/artix_scripts/pre-chroot.sh b/artix_scripts/pre-chroot-efi.sh similarity index 100% rename from artix_scripts/pre-chroot.sh rename to artix_scripts/pre-chroot-efi.sh