diff options
| author | Mitchell Riedstra <mitch@riedstra.dev> | 2025-11-25 15:04:40 -0500 |
|---|---|---|
| committer | Mitchell Riedstra <mitch@riedstra.dev> | 2025-11-25 15:04:40 -0500 |
| commit | c87f73273e3e8d6b4781207cc5f671f931f38bf6 (patch) | |
| tree | 07a05f2241eb6b468b4796de0e1a5e736d0142ed /distro/arch-install.sh | |
| parent | c32b46b00ddfd41e58f0d4a3fb0ca96a0f09acb2 (diff) | |
| parent | 6faf64c17a9fe1c5f5ab0f313c1d36c867097ad7 (diff) | |
| download | dotfiles-c87f73273e3e8d6b4781207cc5f671f931f38bf6.tar.gz dotfiles-c87f73273e3e8d6b4781207cc5f671f931f38bf6.tar.xz | |
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'distro/arch-install.sh')
| -rwxr-xr-x | distro/arch-install.sh | 77 |
1 files changed, 77 insertions, 0 deletions
diff --git a/distro/arch-install.sh b/distro/arch-install.sh new file mode 100755 index 0000000..6cfb095 --- /dev/null +++ b/distro/arch-install.sh @@ -0,0 +1,77 @@ +#!/bin/sh +set -ex + +do_edit() { +printf "Edit \"$1\" ? : " +read -r resp +case $resp in + Y|y) arch-chroot "${_install_path}" nvim "$1" ;; + *) ;; +esac +} + +do_chroot() { + arch-chroot "$_install_path" "$@" +} + +_install_path="${INSTALL_PATH:-/mnt}" +_tz="${TZ:-America/New_York}" +_hostname="${INSTALL_HOSTNAME:-arch}" +PACSTRAP="${PACSTRAP:-1}" + +set +x +if ! awk '{print $2}' /proc/mounts | grep -q '^'"$_install_path"'$' ; then + echo "Cannot install to \"$_install_path\" because it is not a mountpoint" + echo "if you've mounted somewhere other than /mnt use:" + echo " env INSTALL_PATH=<path> ./arch-install.sh" + echo where '<path>' is the mount point in question + exit 1 +fi +set -x + +if [ $PACSTRAP -eq 1 ] ; then +pacstrap -K "$_install_path" \ + arch-install-scripts \ + base \ + base-devel \ + cryptsetup \ + dosfstools \ + e2fsprogs \ + efibootmgr \ + git \ + gptfdisk \ + grub \ + linux \ + linux-firmware \ + linux-firmware-marvell \ + lvm2 \ + networkmanager \ + nvim \ + sof-firmware \ + tmux \ + xfsprogs \ + +fi + + +genfstab -U "$_install_path" >> "${_install_path}/etc/fstab" + +do_edit /etc/fstab + +do_edit /etc/locale.gen + +do_chroot locale-gen + +do_chroot ln -sf "/usr/share/zoneinfo/$_tz" /etc/localtime + +do_edit /etc/mkinitcpio.conf + +do_chroot mkinitcpio -p linux + +do_edit /etc/default/grub + +do_chroot grub-install --target=x86_64-efi --removable --efi-directory=/boot/efi + +do_chroot grub-mkconfig -o /boot/grub/grub.cfg + +do_chroot passwd |
