mirror of
https://github.com/classy-giraffe/easy-arch.git
synced 2025-11-17 19:40:55 +00:00
Merge 563e29e727 into e515b26c07
This commit is contained in:
commit
8e241ebf99
2 changed files with 31 additions and 17 deletions
|
|
@ -2,7 +2,7 @@
|
||||||

|

|
||||||

|

|
||||||
|
|
||||||
[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
|
||||||
|
|
||||||
- **BTRFS snapshots**: you will have a resilient setup that automatically takes snapshots of your volumes based on a weekly schedule
|
- **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
|
- **LUKS2 encryption**: your data will live on a LUKS2 partition protected by a password
|
||||||
|
|
@ -11,15 +11,16 @@
|
||||||
- **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
|
- **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
|
- **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...
|
- **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)
|
## One-step Automated Install (shorter)
|
||||||
|
|
||||||
### `bash <(curl -sL bit.ly/easy-arch)`
|
### `bash <(curl -sL t.ly/ZFid7)`
|
||||||
|
|
||||||
## Alternative Methods (manual)
|
## Manual method
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
wget -O easy-arch.sh https://raw.githubusercontent.com/classy-giraffe/easy-arch/main/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
|
chmod +x easy-arch.sh
|
||||||
bash easy-arch.sh
|
bash easy-arch.sh
|
||||||
```
|
```
|
||||||
|
|
|
||||||
39
easy-arch.sh
39
easy-arch.sh
|
|
@ -359,7 +359,7 @@ microcode_detector
|
||||||
|
|
||||||
# Pacstrap (setting up a base sytem onto the new root).
|
# Pacstrap (setting up a base sytem onto the new root).
|
||||||
info_print "Installing the base system (it may take a while)."
|
info_print "Installing the base system (it may take a while)."
|
||||||
pacstrap -K /mnt base "$kernel" "$microcode" linux-firmware "$kernel"-headers sbctl 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.
|
# Setting up the hostname.
|
||||||
echo "$hostname" > /mnt/etc/hostname
|
echo "$hostname" > /mnt/etc/hostname
|
||||||
|
|
@ -393,13 +393,8 @@ cat > /mnt/etc/mkinitcpio.conf <<EOF
|
||||||
HOOKS=(systemd autodetect keyboard sd-vconsole modconf block sd-encrypt filesystems)
|
HOOKS=(systemd autodetect keyboard sd-vconsole modconf block sd-encrypt filesystems)
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# Setting up LUKS2 encryption in grub.
|
|
||||||
info_print "Setting up grub config."
|
|
||||||
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.
|
# 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 <<EOF
|
arch-chroot /mnt /bin/bash -e <<EOF
|
||||||
|
|
||||||
# Setting up timezone.
|
# Setting up timezone.
|
||||||
|
|
@ -427,14 +422,32 @@ arch-chroot /mnt /bin/bash -e <<EOF
|
||||||
mount -a &>/dev/null
|
mount -a &>/dev/null
|
||||||
chmod 750 /.snapshots
|
chmod 750 /.snapshots
|
||||||
|
|
||||||
# Installing GRUB.
|
# Installing and configuring rEFInd.
|
||||||
grub-install --target=x86_64-efi --efi-directory=/boot/ --bootloader-id=GRUB &>/dev/null
|
refind-install &>/dev/null
|
||||||
|
|
||||||
# Creating grub config file.
|
|
||||||
grub-mkconfig -o /boot/grub/grub.cfg &>/dev/null
|
|
||||||
|
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
# Setting up rEFInd.
|
||||||
|
info_print "Setting up rEFInd."
|
||||||
|
UUID=$(blkid -s UUID -o value $CRYPTROOT)
|
||||||
|
rm -rf /mnt/boot/EFI/refind/refind.conf
|
||||||
|
cat > /mnt/boot/EFI/refind/refind.conf <<EOF
|
||||||
|
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 quiet splash"
|
||||||
|
submenuentry "Boot using fallback initramfs" {
|
||||||
|
initrd /initramfs-$kernel-fallback.img
|
||||||
|
}
|
||||||
|
}
|
||||||
|
EOF
|
||||||
|
|
||||||
|
|
||||||
# Setting root password.
|
# Setting root password.
|
||||||
info_print "Setting root password."
|
info_print "Setting root password."
|
||||||
echo "root:$rootpass" | arch-chroot /mnt chpasswd
|
echo "root:$rootpass" | arch-chroot /mnt chpasswd
|
||||||
|
|
@ -479,7 +492,7 @@ sed -Ei 's/^#(Color)$/\1\nILoveCandy/;s/^#(ParallelDownloads).*/\1 = 10/' /mnt/e
|
||||||
|
|
||||||
# Enabling various services.
|
# Enabling various services.
|
||||||
info_print "Enabling Reflector, automatic snapshots, BTRFS scrubbing and systemd-oomd."
|
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-btrfsd.service 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
|
for service in "${services[@]}"; do
|
||||||
systemctl enable "$service" --root=/mnt &>/dev/null
|
systemctl enable "$service" --root=/mnt &>/dev/null
|
||||||
done
|
done
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue