Bios and Efi pre-chroot separate
This commit is contained in:
@@ -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/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_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
|
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
|
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=artix --recheck $DISK
|
||||||
else
|
else
|
||||||
grub-install --target=i386-pc $DISK --bootloader-id=artix --recheck $DISK
|
grub-install --target=i386-pc $DISK --bootloader-id=artix --recheck $DISK
|
||||||
|
|||||||
39
artix_scripts/pre-chroot-bios.sh
Normal file
39
artix_scripts/pre-chroot-bios.sh
Normal file
@@ -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
|
||||||
Reference in New Issue
Block a user