From b13731eb6f28794690aa144d8c83da2f4d5e558e Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Sat, 1 Apr 2023 13:01:39 +0200 Subject: [PATCH] Add a script for setting up arch --- scripts/OS/Arch/setup.sh | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 scripts/OS/Arch/setup.sh diff --git a/scripts/OS/Arch/setup.sh b/scripts/OS/Arch/setup.sh new file mode 100644 index 00000000..1754ba5d --- /dev/null +++ b/scripts/OS/Arch/setup.sh @@ -0,0 +1,36 @@ +#!/bin/bash +pushd "${BASH_SOURCE%/*}" > /dev/null; + +ARCH_TIMEZONE="${ARCH_TIMEZONE:-Europe/Zurich}"; +ARCH_DISK="${ARCH_DISK}"; +ARCH_HOSTNAME="${ARCH_HOSTNAME}"; +ARCH_MOUNT_ROOT="${ARCH_MOUNT_ROOT:-"/mnt"}"; +ARCH_LANG="en_US.UTF-8"; +ARCH_KEYMAP="de_CH-latin1"; +LOCALE_PATTERN="\(de_CH\|en_US\)"; + +loadkeys "$ARCH_KEYMAP"; +timedatectl set-timezone "$ARCH_TIMEZONE"; +. "./partition.sh"; +pacstrap -K "$ARCH_MOUNT_ROOT" base linux linux-firmware networkmanager; +genfstab -U "$ARCH_MOUNT_ROOT" >> "$ARCH_MOUNT_ROOT/etc/fstab"; + +sudo --chroot="$ARCH_MOUNT_ROOT" . ./init.sh; + +sudo --chroot="$ARCH_MOUNT_ROOT" ln -sf /usr/share/zoneinfo/Europe/Zurich /etc/localtime; +sudo --chroot="$ARCH_MOUNT_ROOT" hwclock --systohc; + +sudo --chroot="$ARCH_MOUNT_ROOT" sed -i "s/#$LOCALE_PATTERN/\1/" /etc/locale.gen; +sudo --chroot="$ARCH_MOUNT_ROOT" locale-gen; +sudo --chroot="$ARCH_MOUNT_ROOT" echo "LANG=$ARCH_LANG" >> /etc/locale.conf; +sudo --chroot="$ARCH_MOUNT_ROOT" echo "KEYMAP=$ARCH_KEYMAP" >> /etc/vconsole.conf; + +sudo --chroot="$ARCH_MOUNT_ROOT" echo "$ARCH_HOSTNAME" > /etc/hostname; +sudo --chroot="$ARCH_MOUNT_ROOT" mkinitcpio -P; + +echo "Please choose a password for the user \`root\`"; +sudo --chroot="$ARCH_MOUNT_ROOT" passwd; + +sudo --chroot="$ARCH_MOUNT_ROOT" . ../../Software/GRUB/install.sh; + +popd > /dev/null;