Files
arch-installer/post-chroot.sh
2022-02-25 18:22:57 +01:00

39 lines
1.2 KiB
Bash

#!/bin/sh
# bash script to be runned on installation with chroot
# takes as an argument the root password to be set
INSTALL_LOCATION="192.168.1.42"
# 3.3 Time Zone
ln -sf /usr/share/zoneinfo/Europe/Madrid /etc/localtime
# 3.4 Localization
echo "en_US.UTF8-8 UTF-8" >> /etc/locale.gen
#locale-gen
echo "LANG=en_US.UTF-8" > /etc/locale.conf
# 3.5 Network config
echo "$2" > /etc/hostname
# 3.6 initramfs
# this is not necesary
# 3.7 root password
echo "root:$1" | chpasswd
#echo "set root password to $1"
# 3.8 bootloader
grub-install --target=x86_64-efi --efi-directory=/efi --bootloader-id=GRUB
grub-mkconfig -o /boot/grub/grub.cfg
# 4 finalize
# configure network
echo "[Match]" > /etc/systemd/network/20-wired.network
echo "Name=enp1s0" >> /etc/systemd/network/20-wired.network
echo "[Network]" >> /etc/systemd/network/20-wired.network
echo "DHCP=yes" >> /etc/systemd/network/20-wired.network
echo "DNS=1.1.1.1" >> /etc/systemd/network/20-wired.network
# enable networkd
systemctl enable systemd-networkd
# enable resolved
systemctl enable systemd-resolved
# curl the installation script
curl $INSTALL_LOCATION/xabs.sh > /home/xabs.sh
# cleanup
rm /home/post-chroot.sh
sh xabs.sh