2022-07-15 11:59:26 +02:00
|
|
|
#! /bin/bash
|
|
|
|
|
|
|
|
error=0; trap 'error=$(($?>$error?$?:$error))' ERR # save maximum error code
|
|
|
|
|
|
|
|
FAI=/var/lib/bernconfig
|
|
|
|
target=/
|
|
|
|
|
2023-06-01 15:25:01 +02:00
|
|
|
apt-get install -y libnss3-tools cmake gnome-tweaks fonts-firacode
|
2022-07-15 11:59:26 +02:00
|
|
|
|
|
|
|
rsync --archive \
|
|
|
|
--exclude /etc/apt \
|
|
|
|
--exclude /usr/share/keyrings \
|
|
|
|
--exclude /etc/ssh \
|
|
|
|
$FAI/simplefiles/PARTICIPANT/ $target
|
|
|
|
|
|
|
|
rsync --archive \
|
|
|
|
--exclude /etc/systemd/timesyncd.conf.d \
|
|
|
|
--exclude /etc/hosts \
|
|
|
|
--exclude /etc/nftables.conf \
|
|
|
|
--exclude /root \
|
|
|
|
$FAI/simplefiles/CONTESTANT/ $target
|
|
|
|
|
|
|
|
$ROOTCMD dconf update
|
|
|
|
|
|
|
|
# Install soi header
|
|
|
|
tar --overwrite -xf $FAI/downloads/soi-header.tar.gz -C $target/usr/local/include --strip-components=2 soi-header/include/
|
|
|
|
|
|
|
|
|
2023-06-01 15:25:01 +02:00
|
|
|
sed -i 's|"homepage": ".*"|"homepage": "https://finals.soi.ch/"|' $target/etc/chromium/master_preferences
|
|
|
|
sed -i 's|"homepage_is_newtabpage": true,|"homepage_is_newtabpage": false,|' $target/etc/chromium/master_preferences
|
|
|
|
|
|
|
|
# Disable sleep
|
|
|
|
$ROOTCMD systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target
|
|
|
|
|
2022-07-15 11:59:26 +02:00
|
|
|
# Disable panels in gnome-control-center
|
|
|
|
DISABLE_DESKTOP="$ROOTCMD dpkg-statoverride --force-statoverride-add --update --add root root 640"
|
|
|
|
$DISABLE_DESKTOP /usr/share/applications/gnome-bluetooth-panel.desktop
|
|
|
|
$DISABLE_DESKTOP /usr/share/applications/gnome-online-accounts-panel.desktop
|
|
|
|
$DISABLE_DESKTOP /usr/share/applications/gnome-sharing-panel.desktop
|
|
|
|
|
2023-06-01 15:25:01 +02:00
|
|
|
# Add a default keyring to avoid a prompt to create one when launching Chromium
|
|
|
|
mkdir -p $target/etc/skel/.local/share/keyrings/
|
|
|
|
chmod og= $target/etc/skel/.local/share/keyrings/
|
|
|
|
echo -n "Default_keyring" > $target/etc/skel/.local/share/keyrings/default
|
|
|
|
cat > $target/etc/skel/.local/share/keyrings/Default_keyring.keyring << EOF
|
|
|
|
[keyring]
|
|
|
|
display-name=Default keyring
|
|
|
|
ctime=0
|
|
|
|
mtime=0
|
|
|
|
lock-on-idle=false
|
|
|
|
lock-after=false
|
|
|
|
EOF
|
|
|
|
chmod og= $target/etc/skel/.local/share/keyrings/Default_keyring.keyring
|
|
|
|
|
2022-07-15 11:59:26 +02:00
|
|
|
# Auto login
|
2023-06-01 15:25:01 +02:00
|
|
|
sed -i 's/# AutomaticLoginEnable = true/AutomaticLoginEnable = true/g' $target/etc/gdm3/daemon.conf
|
|
|
|
sed -i 's/# AutomaticLogin = user1/AutomaticLogin = contestant/g' $target/etc/gdm3/daemon.conf
|
2022-07-15 11:59:26 +02:00
|
|
|
|
|
|
|
exit $error
|