From 42bed5b08dfc79cb76b575cd764d567fc0ad9c41 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Fri, 21 Jul 2023 16:04:50 +0200 Subject: improve arch-install scripts --- arch-install/arch-fix-0.sh | 10 ++++++---- arch-install/arch-setup-0.sh | 17 +++++++++-------- arch-install/arch-setup-1.sh | 4 ++-- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/arch-install/arch-fix-0.sh b/arch-install/arch-fix-0.sh index 65b30bf..7ae7361 100755 --- a/arch-install/arch-fix-0.sh +++ b/arch-install/arch-fix-0.sh @@ -1,5 +1,7 @@ #! /bin/bash +SWPF=/mnt/swapfile + modprobe efivarfs mount -t efivarfs efivarfs /sys/firmware/efi/efivars @@ -11,10 +13,10 @@ mount /dev/sda1 /mnt/boot mount /dev/sda3 /mnt/home echo "SWAPFS" -dd if=/dev/zero of=/mnt/swapfile bs=1M count=512 || exit 1 -chmod 600 /mnt/swapfile || exit 1 -mkswap /mnt/swapfile || exit 1 -swapon /mnt/swapfile || exit 1 +dd if=/dev/zero of=$SWPF bs=1M count=1024 || exit 1 +chmod 600 $SWPF || exit 1 +mkswap $SWPF || exit 1 +swapon $SWPF || exit 1 genfstab -U -p /mnt >> /mnt/etc/fstab2 diff --git a/arch-install/arch-setup-0.sh b/arch-install/arch-setup-0.sh index d64c98b..82135cf 100755 --- a/arch-install/arch-setup-0.sh +++ b/arch-install/arch-setup-0.sh @@ -1,6 +1,7 @@ #! /bin/bash DEV=/dev/sda +SWPF=/mnt/swapfile function say() { @@ -23,7 +24,7 @@ echo "UEFI VARS : $VARS" # http://www.rodsbooks.com/gdisk/sgdisk-walkthrough.html # to retreive size info $ sgdisk -p $DEV # N sectors * 512 / 1024 / 1024 / 1024 -> Gb -say "SGDISK" +say "SGDISK : $DEV" sgdisk -og $DEV || exit 1 sgdisk -n 1::+256M -c 1:efi -t 1:ef02 $DEV || exit 1 sgdisk -n 2::+100G -c 2:rootfs -t 2:8300 $DEV || exit 1 @@ -31,24 +32,24 @@ sgdisk -n 3:: -c 3:homefs -t 3:8300 $DEV || exit 1 #sgdisk -n 3:209979392:976773168 -c 3:homefs -t 3:8300 $DEV || exit 1 sgdisk -p $DEV || exit 1 -say "MKFS" +say "MKFS : $DEV" mkfs.fat -F32 ${DEV}1 || exit 1 mkfs.ext4 -L root ${DEV}2 || exit 1 mkfs.ext4 -L home ${DEV}3 || exit 1 parted $DEV set 1 bios_grub on -say "MOUNT" +say "MOUNT : $DEV" mount ${DEV}2 /mnt mkdir /mnt/boot mount ${DEV}1 /mnt/boot mkdir /mnt/home mount ${DEV}3 /mnt/home -say "SWAPFS" -dd if=/dev/zero of=/mnt/swapfile bs=1M count=512 || exit 1 -chmod 600 /mnt/swapfile || exit 1 -mkswap /mnt/swapfile || exit 1 -swapon /mnt/swapfile || exit 1 +say "SWAPFS : $SWPF" +dd if=/dev/zero of=$SWPF bs=1M count=1024 || exit 1 +chmod 600 $SWPF || exit 1 +mkswap $SWPF || exit 1 +swapon $SWPF || exit 1 say "BASE SYSTEM" pacman -Sy archlinux-keyring diff --git a/arch-install/arch-setup-1.sh b/arch-install/arch-setup-1.sh index a267734..7b08993 100755 --- a/arch-install/arch-setup-1.sh +++ b/arch-install/arch-setup-1.sh @@ -17,14 +17,14 @@ echo "MKINITCPIO" mkinitcpio -p linux echo "GRUB" -#grub-install --target=i386-pc --recheck /dev/sda grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=grub_uefi --recheck grub-mkconfig -o /boot/grub/grub.cfg +ETH=$(ip add | grep '^2' | cut -d ':' -f2 | sed 's/ //g') cat > /etc/systemd/network/10-wired.network << EOF [Match] -Name=enp0s* +Name=$ETH [Network] DHCP=yes -- cgit v1.1-2-g2b99