#!/bin/sh ############################################################################# # # # # # License: See https://install.jamesrayman.com/LICENSE # # # # Instructions: Run the following command after booting into the Arch # # live environment in UEFI mode: # # # # sh <(curl -sSL https://install.jamesrayman.com) # # # # # ############################################################################# export EDITOR="vim" export SH="bash" ls /sys/firmware/efi/efivars >/dev/null 2>/dev/null || ( printf '%s\n' 'Not booted in UEFI mode. Aborting...' exit 1 ) set -eux for resource in \ industry.map.gz \ industry.xkb \ install-industry \ kernelparams \ onchroot \ param \ pkglist \ user-setup do curl -sSL "https://install.jamesrayman.com/$resource" >"$resource" done chmod +x param if lscpu | grep 'Model name' | grep -iq 'intel' then CPU="intel" elif lscpu | grep 'Model name' | grep -iq 'amd' then CPU="amd" else printf '%s\n' 'Unknown processor manufacturer. Aborting...' exit 1 fi export CPU loadkeys "$PWD/industry" set +x printf 'Enter hostname: ' read -r HOST export HOST set -x set +x trap 'stty echo; exit 1' INT stty -echo while while printf 'Choose password: ' read -r PASSWORD printf '\n' [ -z "$PASSWORD" ] do printf 'Password can not be empty.\n' done printf 'Confirm password: ' read -r password printf '\n' [ "$PASSWORD" != "$password" ] do printf 'Passwords do not match.\n' done export PASSWORD stty echo set -x "$EDITOR" pkglist ./param < pkglist > pkglist.tmp mv pkglist.tmp pkglist "$EDITOR" /etc/pacman.d/mirrorlist timedatectl set-ntp true fdisk -l set +x printf 'Enter disk: ' read -r DISK export DISK export DISK1="${DISK}1" export DISK2="${DISK}2" export DISK3="${DISK}3" set -x umount -R /mnt ||: swapoff -a wipefs -a "$DISK" printf "g\nn\n\n\n+550M\nt\n1\nn\n\n\n+2G\nt\n\n19\nn\n\n\n\nw\n" | fdisk "$DISK" mkfs.fat -F32 "$DISK1" mkswap "$DISK2" swapon "$DISK2" mkfs.ext4 -F "$DISK3" mount "$DISK3" /mnt mount --mkdir "$DISK1" /mnt/boot "$EDITOR" kernelparams KERNEL_PARAMETERS="$(./param < kernelparams)" export KERNEL_PARAMETERS pacstrap /mnt $(cat pkglist) genfstab -U /mnt >> /mnt/etc/fstab mkdir -p /mnt/usr/local/share/kbd/keymaps cp industry.map.gz /mnt/usr/local/share/kbd/keymaps/industry.map.gz cp onchroot /mnt/onchroot cp industry.xkb /mnt/industry cp install-industry /mnt/install-industry cp user-setup /mnt/user-setup chmod +x /mnt/onchroot chmod +x /mnt/install-industry chmod +x /mnt/user-setup arch-chroot /mnt /onchroot rm -f /mnt/onchroot rm -f /mnt/industry rm -f /mnt/install-industry rm -f /mnt/user-setup umount -R /mnt shutdown now # vim: ft=sh