Bios or Efi, next

This commit is contained in:
git
2024-06-27 16:08:13 +02:00
parent e0492b0c19
commit 159a1cecf5
3 changed files with 27 additions and 14 deletions

View File

@@ -35,8 +35,12 @@ pacman -Sy && \
pacman -S dosfstools freetype2 fuse2 gptfdisk libisoburn mtools os-prober grub efibootmgr && \
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 && \
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=artix --recheck $DISK && \
sed -i "s/#GRUB_ENABLE_CRYPTODISK/GRUB_ENABLE_CRYPTODISK/g" /etc/default/grub
if [ $BIOSorEFI == "EFI"]
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
fi
grub-mkconfig -o /boot/grub/grub.cfg && \
#services

View File

@@ -8,12 +8,9 @@ LVM_N="lvmSystem"
HOSTNAME="4rt1x"
TIMEZONE="Europe/Prague"
USERNAME="warezjoe"
# BIOS or EFI
if [ -f /sys/firmware/efi/fw_platform_size ]; then
BIOSorEFI="EFI"
else
BIOSorEFI="BIOS"
fi
echo $BIOSorEFI

View File

@@ -4,11 +4,19 @@ source env.sh
#Parted
pacman -Sy && \
yes | pacman -S parted && \
parted -s $DISK mklabel gpt && \
parted -s -a optimal $DISK mkpart "primary" "fat32" "0%" "512MiB" && \
parted -s $DISK set 1 esp on && \
parted -s -a optimal $DISK mkpart "primary" "ext4" "512MiB" "100%" && \
yes | pacman -S parted
if [ $BIOSorEFI == "EFI"]
parted -s $DISK mklabel gpt && \
parted -s -a optimal $DISK mkpart "primary" "fat32" "0%" "512MiB" && \
parted -s $DISK set 1 esp on && \
parted -s -a optimal $DISK mkpart "primary" "ext4" "512MiB" "100%"
else
parted -s $DISK mklabel gpt && \
parted -s -a optimal $DISK mkpart "primary" "fat32" "0%" "1MiB" && \
parted -s $DISK set 1 esp on && \
parted -s -a optimal $DISK mkpart "primary" "ext4" "1MiB" "100%"
fi
parted -s $DISK set 2 lvm on && \
#Cryptosetup
@@ -24,16 +32,20 @@ lvcreate -L 10G $LVM_N -n volRoot && \
lvcreate -L 2G $LVM_N -n volHome && \
#Filesystems and mount
mkswap /dev/$LVM_N/volSwap && \
mkfs.fat -n ESP -F 32 $DISK\1 && \
mkswap /dev/$LVM_N/volSwap
if [ $BIOSorEFI == "EFI"]
mkfs.fat -n ESP -F 32 $DISK\1
fi
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 && \
mkdir -p /mnt/boot/efi && \
mount $DISK\1 /mnt/boot/efi && \
if [ $BIOSorEFI == "EFI"]
mkdir -p /mnt/boot/efi && \
mount $DISK\1 /mnt/boot/efi && \
fi
#basestrap, fstab, chroot
basestrap /mnt base base-devel openrc elogind-openrc linux-hardened linux-hardened-headers linux-firmware && \