Given the decision was made to not support a GUI installer for a long time, Arch Linux has required expert installation knowledge in recent times. This is a collection of scripts based off the official installation guide that help with automating the install of Arch Linux for my particular needs, which are:
- Using a modern and simple desktop environment
- Developing in C#
- Using general image, video, document, and messaging productivity tools
- Using programs that support a security orientation
- Using a discrete NVIDIA GPU to have
- Excellent gaming performance to replace a console
- Excellent video encoding performance to back up optical media
- Using an ASUS motherboard
- Using ZFS to mirror critical data with redundancy
The file and folder structure of the repository is a template of sorts that others may be able to reuse for their needs. Start with modifying common.sh and then modify other files from there.
- A wired internet connection is available and used for the entire process
- Back up files
- Prepare USB automation drive and UEFI firmware
- Prepare USB installer drive
- Reboot
- Update UEFI firmware
- Installation
- Post installation
Two separate USB drives are needed to support the installation process.
Run the following commands on one USB drive.
sudo sgdisk -Z /dev/sdX
sudo sgdisk -n 1:1M:+4G -t 1:8302 -c 1:files /dev/sdX
mkfs.fat -F32 /dev/sdXN
cp -rf arch-linux-setup-scripts <mounted /dev/sdXN>
cp -f *.CAP <mounted /dev/sdXN>
Download the Arch Linux installer ISO image and then use the following commands on the other USB drive.
sudo sgdisk -Z /dev/sdY
sudo dd if=archlinux-2016.10.01-dual.iso of=/dev/sdY bs=1M
Within the ASUS UEFI menus, browse to the USB automation drive with the new firmware file to perform the update. This may only be done from a FAT32 filesystem.
Boot into the live environment with the two USB drives plugged in and then use the following commands to create a bootable system.
If the USB automation drive contains a LUKS partition that needs to be unlocked, it may be done so by doing:
cryptsetup open /dev/sdX cryptusb
Then, instead of using /dev/sdX, use /dev/mapper/cryptusb to mount the device.
cd ~
mkdir files
mount /dev/sdX files
cd files/boot
./install.sh <block device>
cd ~
umount files
arch-chroot /mnt
mount /dev/sdX /mnt
cd /mnt/boot
./bootstrap.sh
exit
reboot
Log in as root. Use the following commands to minimally configure the system and add a GUI desktop.
mount /dev/sdX /mnt
cd /mnt/chroot
./install.sh
reboot
This is the section containing instructions for doing that after a system has been fully restored with most configurations, most data, and is mostly functional.
ZFS storage is configured for mirroring with a ZFS-on-LUKS approach. LUKS underpins all drives, and systemd-boot unlocks the drives during startup. From there, regular system operations take over with no special configurations--the encryption is transparent to most everything else.
The LTS branches of the Kernel and associated modules are used to prioritize stability and "it just works". After confirming that the ZFS module is available for the LTS Kernel in use, run the following to set up ZFS storage:
sudo ./storage.sh /dev/sdA /dev/sdB
This will create a generic mount point at /data that can be used for anything.
Browse to the GNOME Shell Extensions website, install the GNOME Shell integration browser extension from the banner, and then install the following GNOME Shell extensions:
- ArcMenu
- Dash to Panel
- Night Theme Switcher
The script installs /usr/local/sbin/secure-boot-sign and /etc/pacman.d/hooks/99-secure-boot-sign.hook so kernel and systemd updates automatically trigger signing. Hook 99 is intentionally ordered after the existing 95-systemd-boot.hook, so systemd-boot is copied first and then signed.
-
Reboot into UEFI firmware and open
Boot > Secure Boot. -
Set
OS TypetoWindows UEFI Mode. -
Set
Secure Boot ModetoCustom. -
Open
Key Managementand doClear Secure Boot keys. -
Exit saving changes and reboot into Linux.
-
Create keys, sign bootloader, and enroll keys:
sudo ./chroot/secure-boot.sh -e -
Back up private signing keys and store them securely:
sudo tar -C /var/lib/sbctl -czf ~/sbctl-keys.tar.gz keys -
Reboot into Linux.
-
Verify Secure Boot and signing status (see
Verify Secure Bootbelow).
-
Reboot into UEFI firmware and open
Boot > Secure Boot. -
Set
OS TypetoOther OS. -
Exit saving changes and reboot into Linux.
-
Start and finish Linux install process.
-
Import keys and sign bootloader:
tar -xzf ~/sbctl-keys.tar.gz -C /tmp sudo ./chroot/secure-boot.sh -k /tmp/keys -
Reboot into UEFI firmware and open
Boot > Secure Boot. -
Set
OS TypetoWindows UEFI Mode. -
Exit saving changes and reboot into Linux.
-
Verify Secure Boot and signing status (see
Verify Secure Bootbelow).
If firmware keys were reset or cleared, use the first-time enrollment flow again.
sudo bootctl status
sudo sbctl status
sudo sbctl verify