#!/bin/bash -e # vim: set ts=4 sw=4 sts=4 et : ### 04_install_qubes.sh : Prepare chroot instance as a Qubes template echo "--> Alpine linux 04_install_qubes.sh" APKTOOLS_CACHE_DIR="${CACHEDIR}/apk_cache" APK_CUSTOM_REPO_DIR="${PWD}/pkgs-for-template/${DIST}" export APK_CACHE_DIR APK_CUSTOM_REPO_DIR "ALL_PROXY=$REPO_PROXY" set -e if [ "$VERBOSE" -ge 2 ] || [ "$DEBUG" -gt 0 ]; then set -x fi echo " --> Adding Qubes custom repository..." su -c "echo 'https://lab.ilot.io/ayakael/repo-apk/-/raw/v3.18/qubes/r4.1' >> $INSTALLDIR/etc/apk/repositories" wget "https://lab.ilot.io/ayakael/repo-apk/-/raw/v3.18/antoine.martin@protonmail.com-5b3109ad.rsa.pub" -P "$INSTALLDIR"/etc/apk/keys echo " --> Synchronize resolv.conf..." cp /etc/resolv.conf "${INSTALLDIR}/etc/resolv.conf" echo " --> Updating apk repos..." "${SCRIPTSDIR}/alpine-chroot" "$INSTALLDIR" /bin/sh -c \ "apk update; apk upgrade" echo " --> Installing mandatory qubes packages..." "${SCRIPTSDIR}/alpine-chroot" "$INSTALLDIR" /bin/sh -c \ "apk add qubes-vm-dependencies" echo " --> Installing recommended qubes apps" "${SCRIPTSDIR}/alpine-chroot" "$INSTALLDIR" /bin/sh -c \ "apk add qubes-vm-recommended" echo " --> Updating template fstab file..." cat >> "${INSTALLDIR}/etc/fstab" < Configuring system to our preferences..." # add hcv0 to inittab echo "hvc0::respawn:/sbin/getty -L hvc0 115200 vt220" >> "$INSTALLDIR"/etc/inittap # add user:user "${SCRIPTSDIR}/alpine-chroot" "$INSTALLDIR" adduser -D -S user # enable services for i in udev udev-trigger xendriverdomain qubes-qrexec-agent qubes-db qubes-meminfo-writer qubes-sysinit qubes-core-early qubes-core qubes-gui-agent; do "${SCRIPTSDIR}/alpine-chroot" "$INSTALLDIR" rc-update add $i done