diff options
Diffstat (limited to 'archauto.sh')
-rwxr-xr-x | archauto.sh | 26 |
1 files changed, 22 insertions, 4 deletions
diff --git a/archauto.sh b/archauto.sh index 4f8ce69..d478355 100755 --- a/archauto.sh +++ b/archauto.sh @@ -1,5 +1,9 @@ #!/bin/bash +# enable for debugging (single stepping line by line) +#set -x +#trap read debug + exec > >(tee -i logfile.txt) exec 2>&1 @@ -10,13 +14,22 @@ PARTITION_BOOT=1 PARTITION_ROOT=2 LABEL_ROOT=ROOT MOUNT_PATH=/mnt -HOST=192.168.130.1 +HOST=192.168.120.1 HTTP_SERVER=http://${HOST}:8088 -IP=192.168.130.2 +IP=192.168.120.101 +NETWORK=192.168.120.0 NETMASK=255.255.255.0 PREFIX=24 HOSTNAME=arch32 +# set up networking +ip addr add dev eth0 ${IP} +ip route add to ${NETWORK}/${PREFIX} dev eth0 via ${HOST} +ip route add to default dev eth0 via ${HOST} +cat > /etc/resolv.conf <<EOF +nameserver 8.8.8.8 +EOF + # create early SSH access echo 'root:xx' | chpasswd @@ -65,8 +78,11 @@ cat >${MOUNT_PATH}/etc/pacman.d/mirrorlist <<EOF Server = ${HTTP_SERVER}/mirror/\$arch/\$repo EOF +# pin the architecture +sed -i 's/^Architecture.*/Architecture=i686/' ${MOUNT_PATH}/etc/pacman.conf + echo "Test if we can update the system inside chroot." -arch-chroot ${MOUNT_PATH} pacman -Syyu +arch-chroot ${MOUNT_PATH} pacman -Syyu --noconfirm echo "Install /etc/fstab" genfstab -L -p ${MOUNT_PATH} > ${MOUNT_PATH}/etc/fstab @@ -74,8 +90,8 @@ genfstab -L -p ${MOUNT_PATH} > ${MOUNT_PATH}/etc/fstab echo "Installing boot loader.." arch-chroot ${MOUNT_PATH} pacman --noconfirm -S grub -arch-chroot ${MOUNT_PATH} grub-mkconfig -o /boot/grub/grub.cfg arch-chroot ${MOUNT_PATH} grub-install --force /dev/vda +arch-chroot ${MOUNT_PATH} grub-mkconfig -o /boot/grub/grub.cfg echo "Configuring base system.." @@ -97,6 +113,8 @@ Address=${IP}/${PREFIX} Gateway=${HOST} EOF +ln -sf ../run/systemd/resolve/stub-resolv.conf /etc/resolv.conf + arch-chroot ${MOUNT_PATH} systemctl enable systemd-networkd arch-chroot ${MOUNT_PATH} systemctl enable systemd-resolved |