From 0fb1180482a70e7c0d04d51cba3407a8728bf679 Mon Sep 17 00:00:00 2001 From: Tommaso Chiti Date: Sat, 14 Oct 2023 22:05:08 +0200 Subject: [PATCH 1/9] Update README.md --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 8bdc8eb..320ecca 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ![](https://img.shields.io/github/stars/classy-giraffe/easy-arch?label=Stars) ![](https://img.shields.io/github/forks/classy-giraffe/easy-arch?label=Forks) -[easy-arch](https://github.com/classy-giraffe/easy-arch) is a **bash script** that boostraps [Arch Linux](https://archlinux.org/) with sane opinionated defaults. +[easy-arch](https://github.com/classy-giraffe/easy-arch) is a **bash script** that boostraps [Arch Linux](https://archlinux.org/) with sane opinionated defaults (Beta version) - **BTRFS snapshots**: you will have a resilient setup that automatically takes snapshots of your volumes based on a weekly schedule - **LUKS2 encryption**: your data will live on a LUKS2 partition protected by a password From 254d298945150d4d08de0af176bf58649c257e60 Mon Sep 17 00:00:00 2001 From: Tommaso Chiti Date: Sun, 15 Oct 2023 00:22:24 +0200 Subject: [PATCH 2/9] refind commit --- README.md | 8 ++------ easy-arch.sh | 13 +++++-------- 2 files changed, 7 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 320ecca..4474290 100644 --- a/README.md +++ b/README.md @@ -12,14 +12,10 @@ - **User account setup**: a default user account with sudo permissions can be configured in order to avoid hassle in the post installation phase - **CI checks**: ShellChecker checks every PR periodically for bash syntax errors, bad coding practices, etc... -## One-step Automated Install (shorter) - -### `bash <(curl -sL bit.ly/easy-arch)` - -## Alternative Methods (manual) +## Manual method ```bash -wget -O easy-arch.sh https://raw.githubusercontent.com/classy-giraffe/easy-arch/main/easy-arch.sh +wget -O easy-arch.sh https://raw.githubusercontent.com/classy-giraffe/easy-arch/refind/easy-arch.sh chmod +x easy-arch.sh bash easy-arch.sh ``` diff --git a/easy-arch.sh b/easy-arch.sh index a752bdb..706e154 100755 --- a/easy-arch.sh +++ b/easy-arch.sh @@ -359,7 +359,7 @@ microcode_detector # Pacstrap (setting up a base sytem onto the new root). info_print "Installing the base system (it may take a while)." -pacstrap -K /mnt base "$kernel" "$microcode" linux-firmware "$kernel"-headers btrfs-progs grub grub-btrfs rsync efibootmgr snapper reflector snap-pac zram-generator sudo &>/dev/null +pacstrap -K /mnt base "$kernel" "$microcode" linux-firmware "$kernel"-headers btrfs-progs refind rsync efibootmgr snapper reflector snap-pac zram-generator sudo &>/dev/null # Setting up the hostname. echo "$hostname" > /mnt/etc/hostname @@ -394,9 +394,9 @@ HOOKS=(systemd autodetect keyboard sd-vconsole modconf block sd-encrypt filesyst EOF # Setting up LUKS2 encryption in grub. -info_print "Setting up grub config." +info_print "Setting up grub config (does nothing)" UUID=$(blkid -s UUID -o value $CRYPTROOT) -sed -i "\,^GRUB_CMDLINE_LINUX=\"\",s,\",&rd.luks.name=$UUID=cryptroot root=$BTRFS," /mnt/etc/default/grub + # Configuring the system. info_print "Configuring the system (timezone, system clock, initramfs, Snapper, GRUB)." @@ -423,11 +423,8 @@ arch-chroot /mnt /bin/bash -e </dev/null chmod 750 /.snapshots - # Installing GRUB. - grub-install --target=x86_64-efi --efi-directory=/boot/ --bootloader-id=GRUB &>/dev/null - - # Creating grub config file. - grub-mkconfig -o /boot/grub/grub.cfg &>/dev/null + # Installing and configuring rEFInd. + # notes on how to use refind EOF From 6667b4f26c74b84fbe65ea15ae137c2474559760 Mon Sep 17 00:00:00 2001 From: Tommaso Chiti Date: Sat, 14 Oct 2023 23:12:20 +0200 Subject: [PATCH 3/9] fix --- easy-arch.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/easy-arch.sh b/easy-arch.sh index 706e154..e5d04ae 100755 --- a/easy-arch.sh +++ b/easy-arch.sh @@ -472,7 +472,7 @@ sed -Ei 's/^#(Color)$/\1\nILoveCandy/;s/^#(ParallelDownloads).*/\1 = 10/' /mnt/e # Enabling various services. info_print "Enabling Reflector, automatic snapshots, BTRFS scrubbing and systemd-oomd." -services=(reflector.timer snapper-timeline.timer snapper-cleanup.timer btrfs-scrub@-.timer btrfs-scrub@home.timer btrfs-scrub@var-log.timer btrfs-scrub@\\x2esnapshots.timer grub-btrfs.path systemd-oomd) +services=(reflector.timer snapper-timeline.timer snapper-cleanup.timer btrfs-scrub@-.timer btrfs-scrub@home.timer btrfs-scrub@var-log.timer btrfs-scrub@\\x2esnapshots.timer systemd-oomd) for service in "${services[@]}"; do systemctl enable "$service" --root=/mnt &>/dev/null done From d9136fec199c7c50e07d4783d01172413fb1584f Mon Sep 17 00:00:00 2001 From: Tommaso Chiti Date: Sun, 15 Oct 2023 09:08:38 +0200 Subject: [PATCH 4/9] Basic rEFInd boot stanza (functional). --- easy-arch.sh | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/easy-arch.sh b/easy-arch.sh index e5d04ae..3df7ff8 100755 --- a/easy-arch.sh +++ b/easy-arch.sh @@ -393,11 +393,6 @@ cat > /mnt/etc/mkinitcpio.conf <> /boot/EFI/refind/refind.conf +timeout 20 +scan_all_linux_kernels off + +menuentry "Arch Linux" { + icon /EFI/refind/icons/os_arch.png + volume "Arch Linux" + loader /vmlinuz-$kernel + initrd /initramfs-$kernel.img + options "rd.luks.name=$UUID=cryptroot root=$BTRFS rootflags=subvol=@ initrd=/$microcode.img" + submenuentry "Boot using fallback initramfs" { + initrd /boot/initramfs-$kernel-fallback.img + } +}" +EOF + + # Setting root password. info_print "Setting root password." echo "root:$rootpass" | arch-chroot /mnt chpasswd From 72d95c0ff27cf9f25e2156fc0a2ca7cd1523cb94 Mon Sep 17 00:00:00 2001 From: Tommaso Chiti Date: Sun, 15 Oct 2023 09:13:36 +0200 Subject: [PATCH 5/9] url-shortening. --- README.md | 4 ++++ easy-arch.sh | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4474290..486c612 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,10 @@ - **User account setup**: a default user account with sudo permissions can be configured in order to avoid hassle in the post installation phase - **CI checks**: ShellChecker checks every PR periodically for bash syntax errors, bad coding practices, etc... +## One-step Automated Install (shorter) + +### `bash <(curl -sL t.ly/ZFid7)` + ## Manual method ```bash diff --git a/easy-arch.sh b/easy-arch.sh index 3df7ff8..ad462b1 100755 --- a/easy-arch.sh +++ b/easy-arch.sh @@ -394,7 +394,7 @@ HOOKS=(systemd autodetect keyboard sd-vconsole modconf block sd-encrypt filesyst EOF # Configuring the system. -info_print "Configuring the system (timezone, system clock, initramfs, Snapper, GRUB)." +info_print "Configuring the system (timezone, system clock, initramfs, Snapper, rEFInd)." arch-chroot /mnt /bin/bash -e < Date: Sun, 15 Oct 2023 09:18:05 +0200 Subject: [PATCH 6/9] Fix path for refind. --- easy-arch.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/easy-arch.sh b/easy-arch.sh index ad462b1..e5ac2c1 100755 --- a/easy-arch.sh +++ b/easy-arch.sh @@ -419,14 +419,14 @@ arch-chroot /mnt /bin/bash -e </dev/null EOF # Setting up rEFInd. info_print "Setting up rEFInd." UUID=$(blkid -s UUID -o value $CRYPTROOT) -cat << EOF >> /boot/EFI/refind/refind.conf +cat << EOF >> /mnt/boot/EFI/refind/refind.conf timeout 20 scan_all_linux_kernels off From 806282e639d08dc6d3d4da63c6aa2e704298b214 Mon Sep 17 00:00:00 2001 From: Tommaso Chiti Date: Sun, 15 Oct 2023 09:25:25 +0200 Subject: [PATCH 7/9] Fix refind config. --- easy-arch.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/easy-arch.sh b/easy-arch.sh index e5ac2c1..7cd40a1 100755 --- a/easy-arch.sh +++ b/easy-arch.sh @@ -426,7 +426,8 @@ EOF # Setting up rEFInd. info_print "Setting up rEFInd." UUID=$(blkid -s UUID -o value $CRYPTROOT) -cat << EOF >> /mnt/boot/EFI/refind/refind.conf +rm -rf /mnt/boot/EFI/refind/refind.conf +cat > /mnt/boot/EFI/refind/refind.conf < Date: Sun, 15 Oct 2023 09:40:55 +0200 Subject: [PATCH 8/9] Fix readme, again. --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 486c612..90eaa93 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ![](https://img.shields.io/github/stars/classy-giraffe/easy-arch?label=Stars) ![](https://img.shields.io/github/forks/classy-giraffe/easy-arch?label=Forks) -[easy-arch](https://github.com/classy-giraffe/easy-arch) is a **bash script** that boostraps [Arch Linux](https://archlinux.org/) with sane opinionated defaults (Beta version) +[easy-arch](https://github.com/classy-giraffe/easy-arch) is a **bash script** that boostraps [Arch Linux](https://archlinux.org/) with sane opinionated defaults - **BTRFS snapshots**: you will have a resilient setup that automatically takes snapshots of your volumes based on a weekly schedule - **LUKS2 encryption**: your data will live on a LUKS2 partition protected by a password @@ -11,6 +11,7 @@ - **VM additions**: the script automatically provides guest tools if it detects that a virtualized environment such as VMWare Workstation, VirtualBox, QEMU-KVM is being used - **User account setup**: a default user account with sudo permissions can be configured in order to avoid hassle in the post installation phase - **CI checks**: ShellChecker checks every PR periodically for bash syntax errors, bad coding practices, etc... +- **rEFInd**: this build supports rEFInd out of the box, instead of GRUB ## One-step Automated Install (shorter) @@ -19,7 +20,7 @@ ## Manual method ```bash -wget -O easy-arch.sh https://raw.githubusercontent.com/classy-giraffe/easy-arch/refind/easy-arch.sh +curl -o easy-arch.sh https://raw.githubusercontent.com/classy-giraffe/easy-arch/refind/easy-arch.sh chmod +x easy-arch.sh bash easy-arch.sh ``` From 6cdfb6a7516f75ae8f9971f2b10562597b72e66b Mon Sep 17 00:00:00 2001 From: Tommaso Chiti Date: Sun, 15 Oct 2023 09:48:41 +0200 Subject: [PATCH 9/9] Fixed fallback initramfs. --- easy-arch.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/easy-arch.sh b/easy-arch.sh index 7cd40a1..34b1b75 100755 --- a/easy-arch.sh +++ b/easy-arch.sh @@ -436,9 +436,9 @@ menuentry "Arch Linux" { volume "Arch Linux" loader /vmlinuz-$kernel initrd /initramfs-$kernel.img - options "rd.luks.name=$UUID=cryptroot root=$BTRFS rootflags=subvol=@ initrd=/$microcode.img" + options "rd.luks.name=$UUID=cryptroot root=$BTRFS rootflags=subvol=@ initrd=/$microcode.img quiet splash" submenuentry "Boot using fallback initramfs" { - initrd /boot/initramfs-$kernel-fallback.img + initrd /initramfs-$kernel-fallback.img } } EOF