diff --git a/archinstall.sh b/archinstall.sh index 52c26aa..21cdfb3 100755 --- a/archinstall.sh +++ b/archinstall.sh @@ -5,12 +5,13 @@ set -e # Stop on Errors function show_help() { echo "$0 -d [options]" echo " A Semi-Automatic Archlinux Install Script" - echo " -d Device to Install to" - echo " -k Kernel Name to Install (default: linux-zen)" - echo " -n Network Management: n NetworkMangager, m NetworkManager + ModemManager, (default: none)" - echo " -l Locale to use (default: de_DE)" - echo " -m Console Keymap to use (default: de)" - echo " -b Set System Type to BIOS (default: UEFI)" + echo " -d Device to Install to" + echo " -k Kernel Name to Install (default: linux-zen)" + echo " -n Network Management: n NetworkMangager, m NetworkManager + ModemManager, (default: none)" + echo " -l Locale to use (default: de_DE)" + echo " -m Console Keymap to use (default: de)" + echo " -t Timezone to use (default: Europe/Berlin)" + echo " -b Set System Type to BIOS (default: UEFI)" } function exit_error() { @@ -38,7 +39,8 @@ function install_network() { kernel="linux-zen" locale="de_DE" keymap="de" -systype="UEFI" +timezone="Europe/Berlin" +systype="x86_64-efi" network=0 ## Get CLI Options @@ -54,7 +56,8 @@ while getopts 'k:d:n:m:l:h:b?' flag; do d) device="${OPTARG}" ;; l) locale="${OPTARG}" ;; m) keymap="${OPTARG}" ;; - b) systype="BIOS" ;; + t) timezone="${OPTARG}" ;; + b) systype="i386-pc" ;; h) hostname="${OPTARG}" ;; ?) show_help ;; *) show_help ;; @@ -90,7 +93,7 @@ if [[ "$(systemd-detect-virt)" == "none" ]]; then fi echo "Paritioning Disk ${device}" -if [[ "${systype}" == "UEFI" ]]; then +if [[ "${systype}" == "x86_64-efi" ]]; then parted -s "$device" \ mkpart ESP fat32 1MiB 513MiB \ set esp 1 on mkpart \ @@ -98,6 +101,7 @@ if [[ "${systype}" == "UEFI" ]]; then part_esp="/dev/disk/by-partlabel/ESP" part_root="/dev/disk/by-partlabel/cryptroot" + extrapkgs="efibootmgr" partprobe "${device}" mkfs.fat -F32 -n EFI "${part_esp}" @@ -136,12 +140,12 @@ mount -o ssd,noatime,space_cache.compress=zstd,autodefrag,discard=async,subvol=@ mount -o ssd,noatime,space_cache.compress=zstd,autodefrag,discard=async,subvol=@machines "${crypt_root}" /mnt/var/lib/machines mount -o ssd,noatime,space_cache.compress=zstd,autodefrag,discard=async,subvol=@portables "${crypt_root}" /mnt/var/lib/portables chattr +C /mnt/var/log /mnt/var/cache/pacman/pkg -if [[ "${systype}" == "UEFI" ]]; then +if [[ "${systype}" == "x86_64-efi" ]]; then mount "${part_esp}" /mnt/boot/efi fi echo "Installing Base System Packages" -pacstrap /mnt base $kernel $microcode $firmware btrfs-progs grub grub-btrfs snapper vim git tmux htop lsof strace openssh +pacstrap /mnt base $kernel $microcode $firmware $extrapkgs btrfs-progs grub grub-btrfs snapper vim git tmux htop lsof strace openssh echo "Creating Basic Config Files" genfstab -U /mnt | sed -e 's#suvolid=.*,##g;s#subvol=/.*##g' >> /mnt/etc/fstab