archbox/chroot_setup.bash

26 lines
646 B
Bash
Raw Normal View History

2020-10-28 03:02:56 +00:00
#!/bin/bash
err(){
echo "$(tput bold)$(tput setaf 1)==> $@ $(tput sgr0)"
exit 1
}
msg(){
echo "$(tput bold)$(tput setaf 2)==> $@ $(tput sgr0)"
}
msg "Initializing pacman keyrings..."
pacman-key --init
pacman-key --populate archlinux
msg "Installing essential packages..."
2020-10-31 23:51:53 +00:00
pacman -Syu base base-devel xorg pulseaudio --noconfirm
2020-10-28 03:02:56 +00:00
msg "Creating user account..."
2020-11-08 15:36:35 +00:00
CHROOT_USER="$(cat /tmp/archbox_user)"
2020-10-28 03:02:56 +00:00
useradd -m $CHROOT_USER
gpasswd -a $CHROOT_USER wheel
echo "Enter root password"
passwd
echo "Enter $CHROOT_USER password"
passwd $CHROOT_USER
sed -i 's/# %wheel ALL=(ALL) NOPASSWD: ALL/%wheel ALL=(ALL) NOPASSWD: ALL/g' /etc/sudoers