shimboot/rootfs/opt/setup_rootfs.sh

53 lines
1.2 KiB
Bash
Raw Normal View History

2023-10-20 06:38:45 -04:00
#!/bin/bash
#setup the debian rootfs
#this is meant to be run within the chroot created by debootstrap
set -e
if [ "$DEBUG" ]; then
set -x
fi
custom_repo="https://shimboot.ading.dev/debian"
2023-10-20 08:04:19 -04:00
custom_repo_domain="shimboot.ading.dev"
2023-10-20 06:38:45 -04:00
sources_entry="deb [trusted=yes] ${custom_repo} ${release_name} main"
#add shimboot repos
echo -e "${sources_entry}\n$(cat /etc/apt/sources.list)" > /etc/apt/sources.list
tee -a /etc/apt/preferences << END
Package: *
2023-10-20 08:04:19 -04:00
Pin: origin ${custom_repo_domain}
2023-10-20 06:38:45 -04:00
Pin-Priority: 1001
END
#install the patched systemd
apt-get install -y ca-certificates
apt-get update
apt-get upgrade -y
#install desktop
apt-get install -y task-xfce-desktop cloud-utils
2023-10-20 08:39:43 -04:00
2023-10-20 22:30:02 -04:00
#set up hostname and username
read -p "Enter the hostname for the system: " hostname
echo "${hostname}" > /etc/hostname
tee -a /etc/hosts << END
127.0.0.1 localhost
127.0.1.1 ${hostname}
# The following lines are desirable for IPv6 capable hosts
::1 localhost ip6-localhost ip6-loopback
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
END
2023-10-20 08:39:43 -04:00
echo "Enter a root password:"
passwd root
read -p "Enter the username for the user account: " username
useradd -m -s /bin/bash -G sudo $username
echo "Enter the password for ${username}:"
2023-10-20 22:30:02 -04:00
passwd $username
#clean apt caches
apt-get clean