Optimize System Type Handling
This commit is contained in:
parent
fdd5603245
commit
b0e767f9be
1 changed files with 15 additions and 11 deletions
|
@ -5,12 +5,13 @@ set -e # Stop on Errors
|
||||||
function show_help() {
|
function show_help() {
|
||||||
echo "$0 -d <device> [options]"
|
echo "$0 -d <device> [options]"
|
||||||
echo " A Semi-Automatic Archlinux Install Script"
|
echo " A Semi-Automatic Archlinux Install Script"
|
||||||
echo " -d <device> Device to Install to"
|
echo " -d <device> Device to Install to"
|
||||||
echo " -k Kernel Name to Install (default: linux-zen)"
|
echo " -k <kernel> Kernel Name to Install (default: linux-zen)"
|
||||||
echo " -n Network Management: n NetworkMangager, m NetworkManager + ModemManager, (default: none)"
|
echo " -n <nm> Network Management: n NetworkMangager, m NetworkManager + ModemManager, (default: none)"
|
||||||
echo " -l Locale to use (default: de_DE)"
|
echo " -l <locale> Locale to use (default: de_DE)"
|
||||||
echo " -m Console Keymap to use (default: de)"
|
echo " -m <keymap> Console Keymap to use (default: de)"
|
||||||
echo " -b Set System Type to BIOS (default: UEFI)"
|
echo " -t <timezone> Timezone to use (default: Europe/Berlin)"
|
||||||
|
echo " -b Set System Type to BIOS (default: UEFI)"
|
||||||
}
|
}
|
||||||
|
|
||||||
function exit_error() {
|
function exit_error() {
|
||||||
|
@ -38,7 +39,8 @@ function install_network() {
|
||||||
kernel="linux-zen"
|
kernel="linux-zen"
|
||||||
locale="de_DE"
|
locale="de_DE"
|
||||||
keymap="de"
|
keymap="de"
|
||||||
systype="UEFI"
|
timezone="Europe/Berlin"
|
||||||
|
systype="x86_64-efi"
|
||||||
network=0
|
network=0
|
||||||
|
|
||||||
## Get CLI Options
|
## Get CLI Options
|
||||||
|
@ -54,7 +56,8 @@ while getopts 'k:d:n:m:l:h:b?' flag; do
|
||||||
d) device="${OPTARG}" ;;
|
d) device="${OPTARG}" ;;
|
||||||
l) locale="${OPTARG}" ;;
|
l) locale="${OPTARG}" ;;
|
||||||
m) keymap="${OPTARG}" ;;
|
m) keymap="${OPTARG}" ;;
|
||||||
b) systype="BIOS" ;;
|
t) timezone="${OPTARG}" ;;
|
||||||
|
b) systype="i386-pc" ;;
|
||||||
h) hostname="${OPTARG}" ;;
|
h) hostname="${OPTARG}" ;;
|
||||||
?) show_help ;;
|
?) show_help ;;
|
||||||
*) show_help ;;
|
*) show_help ;;
|
||||||
|
@ -90,7 +93,7 @@ if [[ "$(systemd-detect-virt)" == "none" ]]; then
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Paritioning Disk ${device}"
|
echo "Paritioning Disk ${device}"
|
||||||
if [[ "${systype}" == "UEFI" ]]; then
|
if [[ "${systype}" == "x86_64-efi" ]]; then
|
||||||
parted -s "$device" \
|
parted -s "$device" \
|
||||||
mkpart ESP fat32 1MiB 513MiB \
|
mkpart ESP fat32 1MiB 513MiB \
|
||||||
set esp 1 on mkpart \
|
set esp 1 on mkpart \
|
||||||
|
@ -98,6 +101,7 @@ if [[ "${systype}" == "UEFI" ]]; then
|
||||||
|
|
||||||
part_esp="/dev/disk/by-partlabel/ESP"
|
part_esp="/dev/disk/by-partlabel/ESP"
|
||||||
part_root="/dev/disk/by-partlabel/cryptroot"
|
part_root="/dev/disk/by-partlabel/cryptroot"
|
||||||
|
extrapkgs="efibootmgr"
|
||||||
|
|
||||||
partprobe "${device}"
|
partprobe "${device}"
|
||||||
mkfs.fat -F32 -n EFI "${part_esp}"
|
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=@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
|
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
|
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
|
mount "${part_esp}" /mnt/boot/efi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Installing Base System Packages"
|
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"
|
echo "Creating Basic Config Files"
|
||||||
genfstab -U /mnt | sed -e 's#suvolid=.*,##g;s#subvol=/.*##g' >> /mnt/etc/fstab
|
genfstab -U /mnt | sed -e 's#suvolid=.*,##g;s#subvol=/.*##g' >> /mnt/etc/fstab
|
||||||
|
|
Loading…
Reference in a new issue