diff --git a/.gitignore b/.gitignore index 3ebcd6e..7db8ddb 100644 --- a/.gitignore +++ b/.gitignore @@ -1,28 +1,12 @@ -/.build -/.lock -/.stage -/binary -/binary.contents -/binary.deb -/binary-*.iso -/binary.iso.zsync -/binary.packages -/binary.udeb -/config -/live-image-*.contents -/live-image-*.deb -/live-image-*.files -/live-image-*.iso -/live-image-*.iso.zsync -/live-image-*.packages -/live-image-*.udeb -/cache -/chroot -/chroot.files -/chroot.packages.install -/chroot.packages.live -/hdd-*.vdi -/target -/extra_config -/liox-* -/build.log +*.raw +*.img +*.qcow2 +*.iso +cache/ +.cache/ +mnt/ +liox_tmp/ +result +result-fd +qemushared/rootfs.tar.zstd +contest.env diff --git a/apt-keys/microsoft.asc b/apt-keys/microsoft.asc new file mode 100644 index 0000000..1b619e6 --- /dev/null +++ b/apt-keys/microsoft.asc @@ -0,0 +1,19 @@ +-----BEGIN PGP PUBLIC KEY BLOCK----- +Version: BSN Pgp v1.1.0.0 + +mQENBFYxWIwBCADAKoZhZlJxGNGWzqV+1OG1xiQeoowKhssGAKvd+buXCGISZJwT +LXZqIcIiLP7pqdcZWtE9bSc7yBY2MalDp9Liu0KekywQ6VVX1T72NPf5Ev6x6DLV +7aVWsCzUAF+eb7DC9fPuFLEdxmOEYoPjzrQ7cCnSV4JQxAqhU4T6OjbvRazGl3ag +OeizPXmRljMtUUttHQZnRhtlzkmwIrUivbfFPD+fEoHJ1+uIdfOzZX8/oKHKLe2j +H632kvsNzJFlROVvGLYAk2WRcLu+RjjggixhwiB+Mu/A8Tf4V6b+YppS44q8EvVr +M+QvY7LNSOffSO6Slsy9oisGTdfE39nC7pVRABEBAAG0N01pY3Jvc29mdCAoUmVs +ZWFzZSBzaWduaW5nKSA8Z3Bnc2VjdXJpdHlAbWljcm9zb2Z0LmNvbT6JATQEEwEI +AB4FAlYxWIwCGwMGCwkIBwMCAxUIAwMWAgECHgECF4AACgkQ6z6Urb4SKc+P9gf/ +diY2900wvWEgV7iMgrtGzx79W/PbwWiOkKoD9sdzhARXWiP8Q5teL/t5TUH6TZ3B +ENboDjwr705jLLPwuEDtPI9jz4kvdT86JwwG6N8gnWM8Ldi56SdJEtXrzwtlB/Fe +6tyfMT1E/PrJfgALUG9MWTIJkc0GhRJoyPpGZ6YWSLGXnk4c0HltYKDFR7q4wtI8 +4cBu4mjZHZbxIO6r8Cci+xxuJkpOTIpr4pdpQKpECM6x5SaT2gVnscbN0PE19KK9 +nPsBxyK4wW0AvAhed2qldBPTipgzPhqB2gu0jSryil95bKrSmlYJd1Y1XfNHno5D +xfn5JwgySBIdWWvtOI05gw== +=zPfd +-----END PGP PUBLIC KEY BLOCK----- diff --git a/config_overlay/archives/sublime.key.chroot b/apt-keys/sublimehq-pub.asc similarity index 53% rename from config_overlay/archives/sublime.key.chroot rename to apt-keys/sublimehq-pub.asc index 3f11304..d83a218 100644 --- a/config_overlay/archives/sublime.key.chroot +++ b/apt-keys/sublimehq-pub.asc @@ -60,3 +60,60 @@ Ret0lkql+RTCtyWh95sr1kgGyyQCyF/Jv7NSntcQlJL3whphCpOkvOvK+HlBoY5U McvDuGKIXk111Z3nrF4DeIIc/U6ICQ== =CCk2 -----END PGP PUBLIC KEY BLOCK----- +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQINBFkQsPABEACnBDDC1d1e6h3CH0VNjJ/gtExITglzThVvPADCFBOFpwUKgqnf +mEj6Rx/citX3QO1MAwyACCP7UsFad7JDNpBWHRBGGGZFQE1EYOvXccWN4dqMyH11 +06+GtzPuMRxo+qEpWzGbIGHDZH9GVjCM0QykHZQawJShPdnsgpYuDtGMlvNQKLk7 +eSNGsHZ/NxHeYbC8Ung4ts48a2N0js+dayv1DVSZI8L9TnzbgxkOTcUqytBhub7u +ZygYzalzvqN9BiHVsTXi2rd7T/XfK7Zl0rawOHQUQavY/5IsUuRmqKwimmM6dkcu +9500nwQTDkFB6Q50IsL9pZVf2tXT70OpKDTMiTlK9VkJNnKFIHdFfZkk/O3opFhR +jI7iD41sgSVH5X176lzS2nd15GGn3qW2jSVXZ7XnlgUML4GqJVKU+T//WQjudVkF +bpfeTCOzkxj9wF0ixW64MxhkOoaHDreFhKdyn9yjSWId8m4igS+pe1xHJKREZwTR +1kgQY8Od0eOxyyvZQlQons6Ac80gF0220Z2+qnpEawhGGOKBDmh8tgQkw4s+nJc5 +cHIB5o9oyhRo0R9yA7kj7D/bymN1uu7fYFnGOhwJ0jTW3LEKohRLJVgC14C/i44+ +1XZB6lOF98TcmjY7plBB1eSSBFk9mfHsb7PH2DE17xTczHC4mpLxd5w+WwARAQAB +tCxTdWJsaW1lIEhRIFB0eSBMdGQgPHN1cHBvcnRAc3VibGltZXRleHQuY29tPokC +NAQTAQIAHgUCWRCw8AIbLwMLCQcEFQoJCAUWAgMBAAIeAQIXgAAKCRDKRkqaIi0j +0LQsD/93IlZevTYbg9NmTPsVZx9zlBLO9qAIb4co+dOk9Fohc7FMYSevenpA7PTl +O+3yARJhqqB75+7u5LatjEyYo/VEpvZhDyhorPUHshoIcHnsDpC+Ua5zq42efNdl +PE9Vr3klVR7gKbX2FxjqUL5SE6/YLIIr2PhpdbbMQbOCH6s4kXklsVysjRu7k0Ip +U4XF90s4inXTILMruA8LdW59q6dg5Ej4tUv54d9//Jl2Rz0z8TbguYPwFEHaXRNv +hNv0oFnjt16sZENaar81E+icw7laHxGKPnZ1XRUlvsa40/hTYj62yBGzUhLbWPHv +Os7UrIkvsyiE+53cDfEfoFh/e6yLzkSEv12xwhk4p5GjeLnkgC7Wu4VHBZDj9atO +Muwtcxk/eNpdXKg0VA1+Zo1qCuLad7ciaSKGHTasGSEVUjvtnDMPaAzvc8o0kmi4 +lzZl6jHeDq2IKrgkT/FKEF9HrER7mFp+mjlVp65AM/xwZ7Ja23ocnuAVz4j9S5s4 +iz6dkdJNYkzZiZ67TMth+1Qc0D6LoTwHufMJQHUmUE1+ffRKOpXim4CE21eO+WbX +vOcPh20Khv4E7O4h669+i5Oz9w/qDK2pVEYwiS/7LxaSoYaLHg1xJWk1sQx4gryF +vkhZMlN+2B3cJD4XISa65TWhDSMyWrwElnXchfEc90svjkG/nw== +=bBxZ +-----END PGP PUBLIC KEY BLOCK----- +-----BEGIN PGP PUBLIC KEY BLOCK----- + +mQINBGkJdvYBEADWhdySHM8j/ADp4YuVsnB6RkLVJoQI9A50uMiuDuNk8f05NpZJ +29bStn4m4/sB0jM2L7L6DK6IneHvU+6oUfsMylevZ6SrsjTibt3Ado7vmtEfXz1q +zZ1QbExJpYBXzUNGIIdsdUGgtkTO6dBPzZWA9zhsN8BkMJEJfnJgyJXV7eXqiHUa +LIfCFKy3f97BrLss/bXLY2d3d1J/14uoGhnpTV1udurw/i4F7WrpigauUAyKqvWc +pSCY6iXFGAhX7wTAKnkC7o/nRI4HxpZA01bUt43BMMM0S71xxW54kN/JVRRsVXEt +gE+ZgYB5UG9NjSIkF695PEqjtgv35tpkKnDU94m7Ws+yc51DkyW/6KgGO2FScxkD +bymF8VJl7JO9rZUcA60x45bmbPU6ex1BT4BIiE14mZMrOH80TmmgJDuU1KljMDL0 +L+ts4tsv5haPRDByOhLhQeuRRMnbhhQAQeP9oi3SvLl1by76ztwy25wvfkwC4Hrm +O4KoeuDeoP5wrlIVkJv4BO9y0jJypQ+YjSxS3hvChtZjIaNygjzV+fRf9OqVeZV/ +S0Lg7jgcDL6B1IMSbXp4uPTAkfciDjaNhgIXiK4jhSQZMLmJvKs0UQdIO09cTCUV +7qTx2IPP8A/VpXAJFLpw3NQGY50uLSYwR5DlOqn726rNF2xGgfLPcOqunQARAQAB +tCxTdWJsaW1lIEhRIFB0eSBMdGQgPHN1cHBvcnRAc3VibGltZXRleHQuY29tPokC +UQQTAQoAOxYhBOvHM7eKqzUtx3O/hX/i+hLPbjjyBQJpCXb2AhsDBQsJCAcCAiIC +BhUKCQgLAgQWAgMBAh4HAheAAAoJEH/i+hLPbjjy3HkQALMuihzYrqTzeM4j8FAN +V2y+cz/myqDsB+Z8Xnfj8/ZP7mA0hBOe87yV6lna2naaWm2p0uMFgpRc8qZ1Hgha +lBIfkprWBlukynFnUlGRzs449ayhieFQK7nHPz5R+d/1ZK1wVeHd7VWqR8vBw7G1 +Lc/ZHZCYLVh2DA23UgFBIOosIUAaaa2c2Xv1y5ljEDiRWxq64vgInSzcHjAydaIo +joT5tEYLYLPbXPQ/jSywsDSszkVAdGVJShaQLMY3+w5z7cszhQlcK3IuPCTjIdG+ +p7FGLimzmmjctkpGW1mHuoY58fPfcB7dTAo2sCkhh0+Vuml9ullI/8HVxQ/fGDV1 +XrBXE56psff+F2LYKBxAQTjTGGJlIQ77LDOKzLs7cbwF040LNnTnpDsXFUnIK8p5 +IPm+U+I8lAtudio5VZNj9NHiYyPfYXHRi2P85yDunoI5NxoxTcUFtjrozp2H23OF +jbY1kZVH/i94kaNkbikzFT42xw4XyMxg2QbtHn6376pJ3bRMNsE397UrZ4c9Cve5 +wW7nALCu2N74dFiPJSeJK9XBieEvTS43sIWDaLpQgZlc6Msd/3sYnygc71LR5Zdm +/g98Eq55oyqp8tOTSyH2Hnyerk3Qg2juFNe1qUXbHdDRZbr3DKOj1FRAZDmiHCc/ +AwZ5B2NwXZBg532zpvLNBlhp +=hSCO +-----END PGP PUBLIC KEY BLOCK----- diff --git a/config_overlay/apt/remove-bluedevil.pref b/apt-preferences/remove-bluedevil.pref similarity index 100% rename from config_overlay/apt/remove-bluedevil.pref rename to apt-preferences/remove-bluedevil.pref diff --git a/config_overlay/apt/remove-bluetooth.pref b/apt-preferences/remove-bluetooth.pref similarity index 100% rename from config_overlay/apt/remove-bluetooth.pref rename to apt-preferences/remove-bluetooth.pref diff --git a/apt-preferences/remove-grub-shim.pref b/apt-preferences/remove-grub-shim.pref new file mode 100644 index 0000000..cd22292 --- /dev/null +++ b/apt-preferences/remove-grub-shim.pref @@ -0,0 +1,15 @@ +Package: shim-signed +Pin: version * +Pin-Priority: -1 + +Package: shim-signed-common +Pin: version * +Pin-Priority: -1 + +Package: shim-helpers-amd64-signed +Pin: version * +Pin-Priority: -1 + +Package: shim-unsigned +Pin: version * +Pin-Priority: -1 diff --git a/config_overlay_contest/apt/remove-ifupdown.pref b/apt-preferences/remove-ifupdown.pref similarity index 100% rename from config_overlay_contest/apt/remove-ifupdown.pref rename to apt-preferences/remove-ifupdown.pref diff --git a/config_overlay/apt/remove-kdeconnect.pref b/apt-preferences/remove-kdeconnect.pref similarity index 100% rename from config_overlay/apt/remove-kdeconnect.pref rename to apt-preferences/remove-kdeconnect.pref diff --git a/config_overlay/apt/remove-kwalletmanager.pref b/apt-preferences/remove-kwalletmanager.pref similarity index 100% rename from config_overlay/apt/remove-kwalletmanager.pref rename to apt-preferences/remove-kwalletmanager.pref diff --git a/config_overlay/apt/remove-modemmanager.pref b/apt-preferences/remove-modemmanager.pref similarity index 100% rename from config_overlay/apt/remove-modemmanager.pref rename to apt-preferences/remove-modemmanager.pref diff --git a/config_overlay_contest/apt/remove-network-manager.pref b/apt-preferences/remove-network-manager.pref similarity index 100% rename from config_overlay_contest/apt/remove-network-manager.pref rename to apt-preferences/remove-network-manager.pref diff --git a/config_overlay/apt/remove-packagekit.pref b/apt-preferences/remove-packagekit.pref similarity index 100% rename from config_overlay/apt/remove-packagekit.pref rename to apt-preferences/remove-packagekit.pref diff --git a/config_overlay/apt/remove-partitionmanager.pref b/apt-preferences/remove-partitionmanager.pref similarity index 100% rename from config_overlay/apt/remove-partitionmanager.pref rename to apt-preferences/remove-partitionmanager.pref diff --git a/config_overlay/apt/remove-plasmadiscover.pref b/apt-preferences/remove-plasmadiscover.pref similarity index 100% rename from config_overlay/apt/remove-plasmadiscover.pref rename to apt-preferences/remove-plasmadiscover.pref diff --git a/config_overlay/archives/sublime.list.chroot b/apt-sources/sublime-text.list similarity index 100% rename from config_overlay/archives/sublime.list.chroot rename to apt-sources/sublime-text.list diff --git a/config_overlay_amd64/archives/vscode.list.chroot b/apt-sources/vscode.list similarity index 100% rename from config_overlay_amd64/archives/vscode.list.chroot rename to apt-sources/vscode.list diff --git a/auto/build b/auto/build deleted file mode 100755 index f8d8346..0000000 --- a/auto/build +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh - -set -e - -lb build noauto "${@}" 2>&1 | tee build.log diff --git a/auto/clean b/auto/clean deleted file mode 100755 index 69874ee..0000000 --- a/auto/clean +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/sh - -set -e - -lb clean noauto "${@}" - -rm -f config/binary config/bootstrap config/chroot config/common config/source -rm -f build.log diff --git a/auto/config b/auto/config deleted file mode 100755 index 8a00864..0000000 --- a/auto/config +++ /dev/null @@ -1,46 +0,0 @@ -#!/bin/sh - -set -e - -case "$LIOX_ARCH" in - i386) - LX_ARCHS=i386 - LX_FLAVS=686-pae - ;; - amd64) - LX_ARCHS=amd64 - LX_FLAVS=amd64 - ;; - *) - echo "Please specify LIOX_ARCH (i386 or amd64)" - exit 1 - ;; -esac - -# '--debian-installer-distribution daily' is a workaround to make d-i kernel and -# live image modules match. -lb config noauto \ - --architectures $LX_ARCHS \ - --linux-flavours $LX_FLAVS \ - --distribution bookworm \ - --archive-areas "main contrib non-free non-free-firmware" \ - --debian-installer live \ - --debian-installer-distribution bookworm \ - --debootstrap-options "--include=ca-certificates,openssl" \ - --hdd-size 7600 \ - --security true \ - --updates true \ - "${@}" - -cp -rT config_overlay config - -# This is required because Visual Studio Code doesn't have a 32-bit repo at the -# moment, so we need to have a way to diverge configurations between i386/amd64. -if [ "${LIOX_ARCH}" = "amd64" ]; then - cp -rT config_overlay_amd64 config -fi - -if [ -n "${LIOX_CONTEST}" ]; then - cp -rT config_overlay_contest config - ./contest-config -fi diff --git a/changeimg b/changeimg deleted file mode 100755 index 974bc4c..0000000 --- a/changeimg +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/sh - -# A tool to manipulate a VDI image. Useful for adding/removing users, -# changing passwords, setting up ssh keys, etc. without starting the VM. - -# Requires 'shift', so might not work with all shells. We are interested -# in dash and bash only anyway. - -set -e - -OP="$1" - -fatal() { - printf %s\\n "fatal error: $@" - exit 1 -} - -setup() { - DISK="$2" - [ ! -f "$DISK" ] && fatal "usage: $0 setup " - [ ! -b /dev/nbd0 ] && fatal "/dev/nbd0 not found, maybe run modprobe nbd?" - if [ -z "`pgrep qemu-nbd`" ]; then - qemu-nbd -c /dev/nbd0 "$DISK" || fatal "qemu-nbd -c /dev/nbd0 failed" - fi - [ ! -b /dev/mapper/nbd0p1 ] && kpartx -sa /dev/nbd0 - [ ! -b /dev/mapper/nbd0p1 ] && fatal "kpartx -sa /dev/nbd0 failed" - mkdir -p target - if [ ! -f target/vmlinuz ]; then - mount /dev/mapper/nbd0p1 target || fatal "mount /dev/mapper/nbd0p1 failed" - fi - echo Setup successful -} - -cleanup() { - if [ -f target/vmlinuz ]; then - umount target || fatal "umount target failed" - fi - [ -b /dev/mapper/nbd0p1 ] && kpartx -d /dev/nbd0 - [ -b /dev/mapper/nbd0p1 ] && fatal "kpartx -d /dev/nbd0 failed" - [ -n "`pgrep qemu-nbd`" ] && qemu-nbd -d /dev/nbd0 - [ -n "`pgrep qemu-nbd`" ] && fatal "seems like qemu-nbd still running" - echo Cleanup successful -} - -local_run() { - SCRIPT="$2" - [ ! -x "$SCRIPT" ] && fatal "usage: changeimg local_run " - [ ! -f target/vmlinuz ] && fatal "run setup first" - - cp "$SCRIPT" target/tmp/liox_tmp - shift; - exec chroot target tmp/liox_tmp "$@" -} - -chroot() { - [ ! -f target/vmlinuz ] && fatal "run setup first" - [ -z "$2" ] && exec chroot target /bin/bash -i - shift; - exec chroot target "$@" -} - -case $OP in - setup ) - setup "$@" - ;; - local_run ) - local_run "$@" - ;; - chroot ) - chroot "$@" - ;; - cleanup ) - cleanup "$@" - ;; - * ) - echo "Usage: $0 (setup|local_run|chroot|cleanup)" ;; -esac diff --git a/changeimg_raw b/changeimg_raw deleted file mode 100755 index 9e77ef0..0000000 --- a/changeimg_raw +++ /dev/null @@ -1,86 +0,0 @@ -#!/bin/bash -set -euo pipefail - -# A tool to manipulate a VDI image. Useful for adding/removing users, -# changing passwords, setting up ssh keys, etc. without starting the VM. - -OP=${1-} - -fatal() { - printf %s\\n "fatal error: $@" - exit 1 -} - -_get_loopdev() { - DISK=$1 - losetup -a | awk -F: "/$(basename ${DISK})/ { print \$1 }" -} - -setup() { - DISK="${2-}" - [ ! -f "$DISK" ] && fatal "usage: $0 setup " - LOOPDEV=`_get_loopdev ${DISK}` - if [ -z "$LOOPDEV" ]; then - LOOPDEV=`losetup -fv $DISK | awk '{ print $NF; exit }'` - fi - if [ -z "$LOOPDEV" ]; then - fatal "failed to attach $DISK to /dev/loopX" - fi - LOOPP1=/dev/mapper/${LOOPDEV#/dev/}p1 - [ ! -b $LOOPP1 ] && kpartx -sa $LOOPDEV - [ ! -b $LOOPP1 ] && fatal "kpartx -sa $LOOPDEV failed" - mkdir -p target - if [ ! -f target/vmlinuz ]; then - mount $LOOPP1 target || fatal "mount $LOOPP1 failed" - fi - echo Setup successful -} - -cleanup() { - DISK="${2-}" - [ ! -f "$DISK" ] && fatal "usage: $0 setup " - if [ -f target/vmlinuz ]; then - umount target || fatal "umount target failed" - fi - LOOPDEV=`_get_loopdev ${DISK}` - LOOPP1=/dev/mapper/${LOOPDEV#/dev/}p1 - [ -b $LOOPP1 ] && kpartx -d $LOOPDEV - [ -b $LOOPP1 ] && fatal "kpartx -d $LOOPDEV failed" - [ -n "`_get_loopdev ${DISK}`" ] && losetup -d $LOOPDEV - [ -n "`_get_loopdev ${DISK}`" ] && fatal "losetup -d $LOOPDEV failed" - echo Cleanup successful -} - -local_run() { - SCRIPT="$2" - [ ! -x "$SCRIPT" ] && fatal "usage: changeimg local_run " - [ ! -f target/vmlinuz ] && fatal "run setup first" - - cp "$SCRIPT" target/tmp/liox_tmp - shift; - exec chroot target tmp/liox_tmp "$@" -} - -chroot() { - [ ! -f target/vmlinuz ] && fatal "run setup first" - [ -z "$2" ] && exec chroot target /bin/bash -i - shift; - exec chroot target "$@" -} - -case $OP in - setup ) - setup "$@" - ;; - local_run ) - local_run "$@" - ;; - chroot ) - chroot "$@" - ;; - cleanup ) - cleanup "$@" - ;; - * ) - echo "Usage: $0 (setup|local_run|chroot|cleanup)" ;; -esac diff --git a/config_overlay_contest/includes.chroot/etc/modprobe.d/pcspeaker-blacklist.conf b/chroot-overlay/etc/modprobe.d/pcspeaker-blacklist.conf similarity index 100% rename from config_overlay_contest/includes.chroot/etc/modprobe.d/pcspeaker-blacklist.conf rename to chroot-overlay/etc/modprobe.d/pcspeaker-blacklist.conf diff --git a/config_overlay/includes.chroot/etc/sddm.conf.d/00-general.conf b/chroot-overlay/etc/sddm.conf.d/00-general.conf similarity index 100% rename from config_overlay/includes.chroot/etc/sddm.conf.d/00-general.conf rename to chroot-overlay/etc/sddm.conf.d/00-general.conf diff --git a/config_overlay/includes.chroot/etc/sddm.conf.d/01-theme.conf b/chroot-overlay/etc/sddm.conf.d/01-theme.conf similarity index 100% rename from config_overlay/includes.chroot/etc/sddm.conf.d/01-theme.conf rename to chroot-overlay/etc/sddm.conf.d/01-theme.conf diff --git a/chroot-overlay/etc/skel/.config/Code/User/settings.json b/chroot-overlay/etc/skel/.config/Code/User/settings.json new file mode 100644 index 0000000..50358ad --- /dev/null +++ b/chroot-overlay/etc/skel/.config/Code/User/settings.json @@ -0,0 +1,3 @@ +{ + "chat.disableAIFeatures": true +} diff --git a/config_overlay/includes.chroot/etc/skel/.config/codeblocks/default.conf b/chroot-overlay/etc/skel/.config/codeblocks/default.conf similarity index 95% rename from config_overlay/includes.chroot/etc/skel/.config/codeblocks/default.conf rename to chroot-overlay/etc/skel/.config/codeblocks/default.conf index f6a213b..8bd8674 100644 --- a/config_overlay/includes.chroot/etc/skel/.config/codeblocks/default.conf +++ b/chroot-overlay/etc/skel/.config/codeblocks/default.conf @@ -27,7 +27,7 @@ - + diff --git a/config_overlay/includes.chroot/etc/skel/.config/kactivitymanagerdrc b/chroot-overlay/etc/skel/.config/kactivitymanagerdrc similarity index 100% rename from config_overlay/includes.chroot/etc/skel/.config/kactivitymanagerdrc rename to chroot-overlay/etc/skel/.config/kactivitymanagerdrc diff --git a/config_overlay/includes.chroot/etc/skel/.config/kcminputrc b/chroot-overlay/etc/skel/.config/kcminputrc similarity index 100% rename from config_overlay/includes.chroot/etc/skel/.config/kcminputrc rename to chroot-overlay/etc/skel/.config/kcminputrc diff --git a/config_overlay/includes.chroot/etc/skel/.config/kdeglobals b/chroot-overlay/etc/skel/.config/kdeglobals similarity index 100% rename from config_overlay/includes.chroot/etc/skel/.config/kdeglobals rename to chroot-overlay/etc/skel/.config/kdeglobals diff --git a/config_overlay/includes.chroot/etc/skel/.config/kscreenlockerrc b/chroot-overlay/etc/skel/.config/kscreenlockerrc similarity index 100% rename from config_overlay/includes.chroot/etc/skel/.config/kscreenlockerrc rename to chroot-overlay/etc/skel/.config/kscreenlockerrc diff --git a/config_overlay/includes.chroot/etc/skel/.config/kwinrc b/chroot-overlay/etc/skel/.config/kwinrc similarity index 100% rename from config_overlay/includes.chroot/etc/skel/.config/kwinrc rename to chroot-overlay/etc/skel/.config/kwinrc diff --git a/config_overlay/includes.chroot/etc/skel/.config/kxkbrc b/chroot-overlay/etc/skel/.config/kxkbrc similarity index 100% rename from config_overlay/includes.chroot/etc/skel/.config/kxkbrc rename to chroot-overlay/etc/skel/.config/kxkbrc diff --git a/config_overlay/includes.chroot/etc/skel/.config/plasma-localerc b/chroot-overlay/etc/skel/.config/plasma-localerc similarity index 100% rename from config_overlay/includes.chroot/etc/skel/.config/plasma-localerc rename to chroot-overlay/etc/skel/.config/plasma-localerc diff --git a/config_overlay/includes.chroot/etc/skel/.config/plasma-org.kde.plasma.desktop-appletsrc b/chroot-overlay/etc/skel/.config/plasma-org.kde.plasma.desktop-appletsrc similarity index 100% rename from config_overlay/includes.chroot/etc/skel/.config/plasma-org.kde.plasma.desktop-appletsrc rename to chroot-overlay/etc/skel/.config/plasma-org.kde.plasma.desktop-appletsrc diff --git a/config_overlay/includes.chroot/etc/skel/.config/plasmarc b/chroot-overlay/etc/skel/.config/plasmarc similarity index 100% rename from config_overlay/includes.chroot/etc/skel/.config/plasmarc rename to chroot-overlay/etc/skel/.config/plasmarc diff --git a/config_overlay_contest/includes.chroot/etc/skel/.config/powermanagementprofilesrc b/chroot-overlay/etc/skel/.config/powermanagementprofilesrc similarity index 100% rename from config_overlay_contest/includes.chroot/etc/skel/.config/powermanagementprofilesrc rename to chroot-overlay/etc/skel/.config/powermanagementprofilesrc diff --git a/config_overlay/includes.chroot/etc/skel/Desktop/Docs/GDB.html b/chroot-overlay/etc/skel/Desktop/Docs/GDB.html similarity index 100% rename from config_overlay/includes.chroot/etc/skel/Desktop/Docs/GDB.html rename to chroot-overlay/etc/skel/Desktop/Docs/GDB.html diff --git a/config_overlay/includes.chroot/etc/skel/Desktop/SciTE.desktop b/chroot-overlay/etc/skel/Desktop/SciTE.desktop similarity index 100% rename from config_overlay/includes.chroot/etc/skel/Desktop/SciTE.desktop rename to chroot-overlay/etc/skel/Desktop/SciTE.desktop diff --git a/config_overlay_amd64/includes.chroot/etc/skel/Desktop/code.desktop b/chroot-overlay/etc/skel/Desktop/code.desktop similarity index 100% rename from config_overlay_amd64/includes.chroot/etc/skel/Desktop/code.desktop rename to chroot-overlay/etc/skel/Desktop/code.desktop diff --git a/config_overlay/includes.chroot/etc/skel/Desktop/codeblocks.desktop b/chroot-overlay/etc/skel/Desktop/codeblocks.desktop similarity index 100% rename from config_overlay/includes.chroot/etc/skel/Desktop/codeblocks.desktop rename to chroot-overlay/etc/skel/Desktop/codeblocks.desktop diff --git a/config_overlay/includes.chroot/etc/skel/Desktop/emacs.desktop b/chroot-overlay/etc/skel/Desktop/emacs.desktop similarity index 100% rename from config_overlay/includes.chroot/etc/skel/Desktop/emacs.desktop rename to chroot-overlay/etc/skel/Desktop/emacs.desktop diff --git a/config_overlay/includes.chroot/etc/skel/Desktop/firefox-esr.desktop b/chroot-overlay/etc/skel/Desktop/firefox-esr.desktop similarity index 100% rename from config_overlay/includes.chroot/etc/skel/Desktop/firefox-esr.desktop rename to chroot-overlay/etc/skel/Desktop/firefox-esr.desktop diff --git a/config_overlay/includes.chroot/etc/skel/Desktop/geany.desktop b/chroot-overlay/etc/skel/Desktop/geany.desktop similarity index 100% rename from config_overlay/includes.chroot/etc/skel/Desktop/geany.desktop rename to chroot-overlay/etc/skel/Desktop/geany.desktop diff --git a/config_overlay/includes.chroot/etc/skel/Desktop/gvim.desktop b/chroot-overlay/etc/skel/Desktop/gvim.desktop similarity index 100% rename from config_overlay/includes.chroot/etc/skel/Desktop/gvim.desktop rename to chroot-overlay/etc/skel/Desktop/gvim.desktop diff --git a/config_overlay/includes.chroot/etc/skel/Desktop/org.gnome.gedit.desktop b/chroot-overlay/etc/skel/Desktop/org.gnome.gedit.desktop similarity index 100% rename from config_overlay/includes.chroot/etc/skel/Desktop/org.gnome.gedit.desktop rename to chroot-overlay/etc/skel/Desktop/org.gnome.gedit.desktop diff --git a/config_overlay/includes.chroot/etc/skel/Desktop/org.kde.kate.desktop b/chroot-overlay/etc/skel/Desktop/org.kde.kate.desktop similarity index 100% rename from config_overlay/includes.chroot/etc/skel/Desktop/org.kde.kate.desktop rename to chroot-overlay/etc/skel/Desktop/org.kde.kate.desktop diff --git a/config_overlay/includes.chroot/etc/skel/Desktop/org.kde.kcalc.desktop b/chroot-overlay/etc/skel/Desktop/org.kde.kcalc.desktop similarity index 100% rename from config_overlay/includes.chroot/etc/skel/Desktop/org.kde.kcalc.desktop rename to chroot-overlay/etc/skel/Desktop/org.kde.kcalc.desktop diff --git a/config_overlay/includes.chroot/etc/skel/Desktop/org.kde.kdevelop.desktop b/chroot-overlay/etc/skel/Desktop/org.kde.kdevelop.desktop similarity index 100% rename from config_overlay/includes.chroot/etc/skel/Desktop/org.kde.kdevelop.desktop rename to chroot-overlay/etc/skel/Desktop/org.kde.kdevelop.desktop diff --git a/config_overlay/includes.chroot/etc/skel/Desktop/org.kde.konsole.desktop b/chroot-overlay/etc/skel/Desktop/org.kde.konsole.desktop similarity index 100% rename from config_overlay/includes.chroot/etc/skel/Desktop/org.kde.konsole.desktop rename to chroot-overlay/etc/skel/Desktop/org.kde.konsole.desktop diff --git a/config_overlay/includes.chroot/etc/skel/Desktop/sublime_text.desktop b/chroot-overlay/etc/skel/Desktop/sublime_text.desktop similarity index 100% rename from config_overlay/includes.chroot/etc/skel/Desktop/sublime_text.desktop rename to chroot-overlay/etc/skel/Desktop/sublime_text.desktop diff --git a/chroot-overlay/etc/systemd/network/10-wired.network b/chroot-overlay/etc/systemd/network/10-wired.network new file mode 100644 index 0000000..97e8a1f --- /dev/null +++ b/chroot-overlay/etc/systemd/network/10-wired.network @@ -0,0 +1,8 @@ +[Match] +Name=eth* en* + +[Network] +DHCP=yes + +[DHCPv4] +ClientIdentifier=mac diff --git a/config_overlay/includes.chroot/etc/systemd/network/99-default.link b/chroot-overlay/etc/systemd/network/99-default.link similarity index 100% rename from config_overlay/includes.chroot/etc/systemd/network/99-default.link rename to chroot-overlay/etc/systemd/network/99-default.link diff --git a/config_overlay_contest/includes.chroot/etc/systemd/sleep.conf b/chroot-overlay/etc/systemd/sleep.conf similarity index 81% rename from config_overlay_contest/includes.chroot/etc/systemd/sleep.conf rename to chroot-overlay/etc/systemd/sleep.conf index d90609b..adc7685 100644 --- a/config_overlay_contest/includes.chroot/etc/systemd/sleep.conf +++ b/chroot-overlay/etc/systemd/sleep.conf @@ -1,2 +1,3 @@ +[Sleep] AllowSuspend=no AllowHibernation=no diff --git a/chroot-overlay/etc/vscode/policy.json b/chroot-overlay/etc/vscode/policy.json new file mode 100644 index 0000000..c1219ac --- /dev/null +++ b/chroot-overlay/etc/vscode/policy.json @@ -0,0 +1,13 @@ +{ + "ChatAgentExtensionTools": false, + "ChatAgentMode": false, + "ChatHooks": false, + "ChatMCP": "none", + "ChatToolsAutoApprove": false, + "ChatToolsEligibleForAutoApproval": "", + "McpGalleryServiceUrl": "", + "ChatToolsTerminalEnableAutoApprove": false, + "EnableFeedback": false, + "TelemetryLevel": "off", + "UpdateMode": "none" +} diff --git a/config_overlay/includes.chroot/etc/xdg/mimeapps.list b/chroot-overlay/etc/xdg/mimeapps.list similarity index 100% rename from config_overlay/includes.chroot/etc/xdg/mimeapps.list rename to chroot-overlay/etc/xdg/mimeapps.list diff --git a/config_overlay/includes.chroot/usr/lib/firefox-esr/mozilla.cfg b/chroot-overlay/usr/lib/firefox-esr/mozilla.cfg similarity index 100% rename from config_overlay/includes.chroot/usr/lib/firefox-esr/mozilla.cfg rename to chroot-overlay/usr/lib/firefox-esr/mozilla.cfg diff --git a/config_overlay/includes.chroot/usr/share/firefox-esr/browser/defaults/preferences/00-liox.js b/chroot-overlay/usr/share/firefox-esr/browser/defaults/preferences/00-liox.js similarity index 100% rename from config_overlay/includes.chroot/usr/share/firefox-esr/browser/defaults/preferences/00-liox.js rename to chroot-overlay/usr/share/firefox-esr/browser/defaults/preferences/00-liox.js diff --git a/config_overlay_contest/includes.chroot/usr/share/liox-config/boot-entry.csv b/chroot-overlay/usr/share/liox-config/boot-entry.csv similarity index 100% rename from config_overlay_contest/includes.chroot/usr/share/liox-config/boot-entry.csv rename to chroot-overlay/usr/share/liox-config/boot-entry.csv diff --git a/config_overlay_contest/includes.chroot/usr/share/liox-config/bootmuncher.py b/chroot-overlay/usr/share/liox-config/bootmuncher.py similarity index 100% rename from config_overlay_contest/includes.chroot/usr/share/liox-config/bootmuncher.py rename to chroot-overlay/usr/share/liox-config/bootmuncher.py diff --git a/config_overlay_contest/includes.chroot/usr/share/liox-config/d-i_hooks b/chroot-overlay/usr/share/liox-config/d-i_hooks similarity index 100% rename from config_overlay_contest/includes.chroot/usr/share/liox-config/d-i_hooks rename to chroot-overlay/usr/share/liox-config/d-i_hooks diff --git a/config_overlay_contest/includes.chroot/usr/share/liox-config/downgrade_codeblocks.sh b/chroot-overlay/usr/share/liox-config/downgrade_codeblocks.sh similarity index 100% rename from config_overlay_contest/includes.chroot/usr/share/liox-config/downgrade_codeblocks.sh rename to chroot-overlay/usr/share/liox-config/downgrade_codeblocks.sh diff --git a/config_overlay_contest/includes.chroot/usr/share/liox-config/init_resize.sh b/chroot-overlay/usr/share/liox-config/init_resize.sh similarity index 100% rename from config_overlay_contest/includes.chroot/usr/share/liox-config/init_resize.sh rename to chroot-overlay/usr/share/liox-config/init_resize.sh diff --git a/chroot-overlay/usr/share/liox-config/install_vscode_ext.sh b/chroot-overlay/usr/share/liox-config/install_vscode_ext.sh new file mode 100755 index 0000000..9186b4b --- /dev/null +++ b/chroot-overlay/usr/share/liox-config/install_vscode_ext.sh @@ -0,0 +1,52 @@ +#!/usr/bin/env bash + +set -euo pipefail + +if [ "$(id -u)" -ne 0 ]; then + echo "Please run as root" + exit 1 +fi + +if [ "$#" -lt 1 ]; then + echo "Usage: $0 " + exit 1 +fi + +FIRST_USER="$1" +shift +OTHER_USERS=("$@") +EXTENSION_NAME="ms-vscode.cpptools-extension-pack" + +echo "Will install vscode extension: '$EXTENSION_NAME'" +echo "Will install from internet for user: ${FIRST_USER}" +if [ "${#OTHER_USERS[@]}" -ne 0 ]; then + echo "Will install from cached VSIXs for users: ${OTHER_USERS[@]}" +fi + +cleanup_tmpdir() { + echo "Removing ${VSIX_TMP_DIR}" + rm -rf "${VSIX_TMP_DIR}" +} + +VSIX_TMP_DIR="$(mktemp -d /tmp/vscode-vsix.XXXXXXXXX)" +trap cleanup_tmpdir EXIT + +echo "Installing from internet for ${FIRST_USER}" +sudo -u "${FIRST_USER}" code --install-extension ${EXTENSION_NAME} +install_args=() +final_install_args=() +for f in "/home/${FIRST_USER}/.config/Code/CachedExtensionVSIXs/"*; do + vsix_file="${VSIX_TMP_DIR}/$(basename "${f}").vsix" + mv "${f}" "${vsix_file}" + if [[ "$(basename "${f}")" == "${EXTENSION_NAME}"* ]]; then + final_install_args+=(--install-extension "${vsix_file}") + else + install_args+=(--install-extension "${vsix_file}") + fi +done +chmod 777 "${VSIX_TMP_DIR}" +for user in "${OTHER_USERS[@]}"; do + echo "Installing from VSIXs for ${user}" + sudo -u "${user}" code ${install_args[@]} + sudo -u "${user}" code ${final_install_args[@]} +done diff --git a/config_overlay/includes.chroot/usr/share/liox-config/lmio-logo-center.png b/chroot-overlay/usr/share/liox-config/lmio-logo-center.png similarity index 100% rename from config_overlay/includes.chroot/usr/share/liox-config/lmio-logo-center.png rename to chroot-overlay/usr/share/liox-config/lmio-logo-center.png diff --git a/config_overlay/includes.chroot/usr/share/liox-config/lmio-logo-left.png b/chroot-overlay/usr/share/liox-config/lmio-logo-left.png similarity index 100% rename from config_overlay/includes.chroot/usr/share/liox-config/lmio-logo-left.png rename to chroot-overlay/usr/share/liox-config/lmio-logo-left.png diff --git a/config_overlay_contest/includes.chroot/usr/share/liox-config/patches/grub-config.patch b/chroot-overlay/usr/share/liox-config/patches/grub-config.patch similarity index 100% rename from config_overlay_contest/includes.chroot/usr/share/liox-config/patches/grub-config.patch rename to chroot-overlay/usr/share/liox-config/patches/grub-config.patch diff --git a/config_overlay_contest/includes.chroot/usr/share/liox-config/patches/unrestrict-default-grub-entry.patch b/chroot-overlay/usr/share/liox-config/patches/unrestrict-default-grub-entry.patch similarity index 100% rename from config_overlay_contest/includes.chroot/usr/share/liox-config/patches/unrestrict-default-grub-entry.patch rename to chroot-overlay/usr/share/liox-config/patches/unrestrict-default-grub-entry.patch diff --git a/config_overlay_contest/includes.chroot/usr/share/liox-config/post-inst-overlay/etc/network/interfaces b/chroot-overlay/usr/share/liox-config/post-inst-overlay/etc/network/interfaces similarity index 100% rename from config_overlay_contest/includes.chroot/usr/share/liox-config/post-inst-overlay/etc/network/interfaces rename to chroot-overlay/usr/share/liox-config/post-inst-overlay/etc/network/interfaces diff --git a/config_overlay/includes.chroot/usr/share/liox-config/sddm-numlock.sh b/chroot-overlay/usr/share/liox-config/sddm-numlock.sh similarity index 100% rename from config_overlay/includes.chroot/usr/share/liox-config/sddm-numlock.sh rename to chroot-overlay/usr/share/liox-config/sddm-numlock.sh diff --git a/config_overlay_contest/includes.chroot/usr/share/liox-config/start-contest.sh b/chroot-overlay/usr/share/liox-config/start-contest.sh similarity index 100% rename from config_overlay_contest/includes.chroot/usr/share/liox-config/start-contest.sh rename to chroot-overlay/usr/share/liox-config/start-contest.sh diff --git a/config_overlay_contest/includes.chroot/usr/share/liox-config/stop-contest.sh b/chroot-overlay/usr/share/liox-config/stop-contest.sh similarity index 100% rename from config_overlay_contest/includes.chroot/usr/share/liox-config/stop-contest.sh rename to chroot-overlay/usr/share/liox-config/stop-contest.sh diff --git a/config_overlay/includes.chroot/usr/share/sddm/themes/breeze/theme.conf.user b/chroot-overlay/usr/share/sddm/themes/breeze/theme.conf.user similarity index 100% rename from config_overlay/includes.chroot/usr/share/sddm/themes/breeze/theme.conf.user rename to chroot-overlay/usr/share/sddm/themes/breeze/theme.conf.user diff --git a/chroot-script.sh b/chroot-script.sh new file mode 100755 index 0000000..3463490 --- /dev/null +++ b/chroot-script.sh @@ -0,0 +1,152 @@ +#!/usr/bin/env bash +set -xeuo pipefail + +if [ -f /tmp/contest.env ]; then + source /tmp/contest.env +fi + +CTRL_KEY="${CTRL_KEY:-nonsecret}" +LIOADMIN_PWD="${LIOADMIN_PWD:-lioadmin}" +GRUB_PWD="${GRUB_PWD:-grub}" +HOSTNAME="${HOSTNAME:-lioxbox}" + +TIMEZONE="Europe/Vilnius" + +export LANG=C.UTF-8 +export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +export HOME=/root +export SHELL=/bin/bash +export TERM=xterm +export DEBIAN_FRONTEND=noninteractive + +apt -y install lsb-release +CODENAME=$(lsb_release --codename --short) +cat > /etc/apt/sources.list << EOF +deb https://deb.debian.org/debian/ ${CODENAME} main contrib non-free non-free-firmware +deb-src https://deb.debian.org/debian/ ${CODENAME} main contrib non-free non-free-firmware + +deb https://security.debian.org/debian-security ${CODENAME}-security main contrib non-free non-free-firmware +deb-src https://security.debian.org/debian-security ${CODENAME}-security main contrib non-free non-free-firmware + +deb https://deb.debian.org/debian/ ${CODENAME}-updates main contrib non-free non-free-firmware +deb-src https://deb.debian.org/debian/ ${CODENAME}-updates main contrib non-free non-free-firmware +EOF + +apt -y update + +rm /etc/localtime +echo "${TIMEZONE}" > /etc/timezone +dpkg-reconfigure -f noninteractive tzdata + +apt -y install locales +echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen +echo "lt_LT.UTF-8 UTF-8" >> /etc/locale.gen +echo "pl_PL.UTF-8 UTF-8" >> /etc/locale.gen +echo "ru_RU.UTF-8 UTF-8" >> /etc/locale.gen +echo "LANG=\"en_US.UTF-8\"" > /etc/default/locale +locale-gen + +echo "${HOSTNAME}" > /etc/hostname +cat > /etc/hosts << EOF +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 +EOF + +apt -y install linux-image-amd64 firmware-linux grub-efi debconf-utils gpg + +mkdir -p /etc/apt/sources.list.d/ +cp ./apt-sources/* /etc/apt/sources.list.d/ +mkdir -p /etc/apt/trusted.gpg.d/ +gpg --dearmor -o /etc/apt/trusted.gpg.d/sublimehq-pub.gpg < /apt-keys/sublimehq-pub.asc +gpg --dearmor -o /etc/apt/trusted.gpg.d/microsoft.gpg < /apt-keys/microsoft.asc +apt -y update + +echo "iptables-persistent iptables-persistent/autosave_v4 boolean true" | debconf-set-selections +echo "iptables-persistent iptables-persistent/autosave_v6 boolean true" | debconf-set-selections +echo "keyboard-configuration keyboard-configuration/variant select English (US)" | debconf-set-selections + +apt -y install \ + task-laptop firmware-iwlwifi apt-file apt-transport-https manpages systemd-resolved \ + plasma-desktop kwin-x11 sddm sddm-theme-breeze xserver-xorg xserver-xorg-video-all \ + dolphin konsole kwrite ark gwenview okular kcalc \ + libreoffice-calc libreoffice-impress libreoffice-kf6 libreoffice-plasma libreoffice-writer \ + firefox-esr wget curl dnsutils tsocks bridge-utils ntpsec iptables-persistent whois rfkill \ + joe gedit scite geany geany-plugins codeblocks codeblocks-contrib \ + kate emacs nano kdevelop neovim vim vim-gtk3 sublime-text code \ + zsh mc strace lsof tree screen iotop tmux htop kpartx units locate bash-completion \ + git make gcc g++ gdb gdb-doc ddd valgrind clang \ + python3 ruby \ + python3-requests \ + /packages/*.deb + +cp -rf /chroot-overlay/* / + +for P in $(ls /usr/share/liox-config/patches/*.patch); do + patch -d/ -p0 < ${P} +done +echo "GRUB_DISABLE_OS_PROBER=true" >> /etc/default/grub + +mkdir -p /etc/olimp-control +echo -n "${CTRL_KEY}" > /etc/olimp-control/key +chown root:root /etc/olimp-control/key +chmod 400 /etc/olimp-control/key + +USER_LIST=() +function make_user() +{ + local USERNAME="$1" + local PASSWORD_HASH=$(echo "$2" | mkpasswd -s -m sha-512) + USER_LIST+=("${USERNAME}") + useradd -m -s /bin/bash -p "${PASSWORD_HASH}" "${USERNAME}" +} + +make_user lioadmin "${LIOADMIN_PWD}" +usermod -a -G sudo lioadmin + +if [[ -v D0_PWD ]]; then + make_user d0 "${D0_PWD}" +fi +if [[ -v D1_PWD ]]; then + make_user d1 "${D1_PWD}" +fi +if [[ -v D2_PWD ]]; then + make_user d2 "${D2_PWD}" +fi +/usr/share/liox-config/install_vscode_ext.sh "${USER_LIST[@]}" + +GRUB_PWD_HASH=$(printf "%s\n%s" "${GRUB_PWD}" "${GRUB_PWD}" | grub-mkpasswd-pbkdf2 | awk '/grub.pbkdf/{print$NF}') +mkdir -p /boot/grub +cat > /boot/grub/custom.cfg < /etc/fstab +UUID=${EFI_UUID} /boot/efi vfat umask=0077 0 1 +UUID=${SWAP_UUID} swap swap defaults 0 0 +UUID=${ROOT_UUID} / ext4 defaults,errors=remount-ro 0 1 +EOF +update-initramfs -u -k all +grub-install --removable --no-nvram --target=x86_64-efi "${BLOCK_DEVICE}" +update-grub +rm -rf /etc/apt/apt.conf.d/99cache /chroot-script.sh + +systemctl enable systemd-networkd +systemctl enable systemd-resolved + +systemctl disable apt-daily-upgrade.timer +systemctl disable apt-daily.timer + +cat >> /etc/hosts < \ -# - -#d-i partman-auto-raid/recipe string \ -# 1 2 0 ext3 / \ -# /dev/sda1#/dev/sdb1 \ -# . \ -# 1 2 0 swap - \ -# /dev/sda5#/dev/sdb5 \ -# . \ -# 0 2 0 ext3 /home \ -# /dev/sda6#/dev/sdb6 \ -# . - -# For additional information see the file partman-auto-raid-recipe.txt -# included in the 'debian-installer' package or available from D-I source -# repository. - -# This makes partman automatically partition without confirmation. -d-i partman-md/confirm boolean true -d-i partman-partitioning/confirm_write_new_label boolean true -d-i partman/choose_partition select finish -d-i partman/confirm boolean true -d-i partman/confirm_nooverwrite boolean true - -## Controlling how partitions are mounted -# The default is to mount by UUID, but you can also choose "traditional" to -# use traditional device names, or "label" to try filesystem labels before -# falling back to UUIDs. -#d-i partman/mount_style select uuid - -### Base system installation -# Configure APT to not install recommended packages by default. Use of this -# option can result in an incomplete system and should only be used by very -# experienced users. -#d-i base-installer/install-recommends boolean false - -# The kernel image (meta) package to be installed; "none" can be used if no -# kernel is to be installed. -#d-i base-installer/kernel/image string linux-image-686 - -### Apt setup -# Choose, if you want to scan additional installation media -# (default: false). -d-i apt-setup/cdrom/set-first boolean false -# You can choose to install non-free firmware. -d-i apt-setup/non-free-firmware boolean true -# You can choose to install non-free and contrib software. -d-i apt-setup/non-free boolean true -d-i apt-setup/contrib boolean true -# Uncomment the following line, if you don't want to have the sources.list -# entry for a DVD/BD installation image active in the installed system -# (entries for netinst or CD images will be disabled anyway, regardless of -# this setting). -#d-i apt-setup/disable-cdrom-entries boolean true -# Uncomment this if you don't want to use a network mirror. -#d-i apt-setup/use_mirror boolean false -# Select which update services to use; define the mirrors to be used. -# Values shown below are the normal defaults. -#d-i apt-setup/services-select multiselect security, updates -#d-i apt-setup/security_host string security.debian.org - -# Additional repositories, local[0-9] available -#d-i apt-setup/local0/repository string \ -# http://local.server/debian stable main -#d-i apt-setup/local0/comment string local server -# Enable deb-src lines -#d-i apt-setup/local0/source boolean true -# URL to the public key of the local repository; you must provide a key or -# apt will complain about the unauthenticated repository and so the -# sources.list line will be left commented out. -#d-i apt-setup/local0/key string http://local.server/key -# or one can provide it in-line by base64 encoding the contents of the -# key file (with `base64 -w0`) and specifying it thus: -#d-i apt-setup/local0/key string base64://LS0tLS1CRUdJTiBQR1AgUFVCTElDIEtFWSBCTE9DSy0tLS0tCi4uLgo= -# The content of the key file is checked to see if it appears to be ASCII-armoured. -# If so it will be saved with an ".asc" extension, otherwise it gets a '.gpg' extension. -# "keybox database" format is currently not supported. (see generators/60local in apt-setup's source) - -# By default the installer requires that repositories be authenticated -# using a known gpg key. This setting can be used to disable that -# authentication. Warning: Insecure, not recommended. -#d-i debian-installer/allow_unauthenticated boolean true - -# Uncomment this to add multiarch configuration for i386 -#d-i apt-setup/multiarch string i386 - - -### Package selection -#tasksel tasksel/first multiselect standard, web-server, kde-desktop - -# Or choose to not get the tasksel dialog displayed at all (and don't install -# any packages): -#d-i pkgsel/run_tasksel boolean false - -# Individual additional packages to install -#d-i pkgsel/include string openssh-server build-essential -# Whether to upgrade packages after debootstrap. -# Allowed values: none, safe-upgrade, full-upgrade -#d-i pkgsel/upgrade select none - -# You can choose, if your system will report back on what software you have -# installed, and what software you use. The default is not to report back, -# but sending reports helps the project determine what software is most -# popular and should be included on the first CD/DVD. -#popularity-contest popularity-contest/participate boolean false - -### Boot loader installation -# Grub is the boot loader (for x86). - -# This is fairly safe to set, it makes grub install automatically to the UEFI -# partition/boot record if no other operating system is detected on the machine. -d-i grub-installer/only_debian boolean true - -# This one makes grub-installer install to the UEFI partition/boot record, if -# it also finds some other OS, which is less safe as it might not be able to -# boot that other OS. -d-i grub-installer/with_other_os boolean true - -# Due notably to potential USB sticks, the location of the primary drive can -# not be determined safely in general, so this needs to be specified: -#d-i grub-installer/bootdev string /dev/sda -# To install to the primary device (assuming it is not a USB stick): -d-i grub-installer/bootdev string default - -# Make GRUB install \EFI\Boot\bootx64.efi binary for best compatibility -# with different UEFI implementations. -d-i grub-installer/force-efi-extra-removable boolean true -grub-efi-amd64 grub2/force_efi_extra_removable boolean true - -# Alternatively, if you want to install to a location other than the UEFI -# parition/boot record, uncomment and edit these lines: -#d-i grub-installer/only_debian boolean false -#d-i grub-installer/with_other_os boolean false -#d-i grub-installer/bootdev string (hd0,1) -# To install grub to multiple disks: -#d-i grub-installer/bootdev string (hd0,1) (hd1,1) (hd2,1) - -# Optional password for grub, either in clear text -#d-i grub-installer/password password r00tme -#d-i grub-installer/password-again password r00tme -# or encrypted using an MD5 hash, see grub-md5-crypt(8). -#d-i grub-installer/password-crypted password [MD5 hash] - -# Use the following option to add additional boot parameters for the -# installed system (if supported by the bootloader installer). -# Note: options passed to the installer will be added automatically. -#d-i debian-installer/add-kernel-opts string nousb - -### Finishing up the installation -# During installations from serial console, the regular virtual consoles -# (VT1-VT6) are normally disabled in /etc/inittab. Uncomment the next -# line to prevent this. -#d-i finish-install/keep-consoles boolean true - -# Avoid that last message about the install being complete. -d-i finish-install/reboot_in_progress note - -# This will prevent the installer from ejecting the CD during the reboot, -# which is useful in some situations. -#d-i cdrom-detect/eject boolean false - -# This is how to make the installer shutdown when finished, but not -# reboot into the installed system. -#d-i debian-installer/exit/halt boolean true -# This will power off the machine instead of just halting it. -#d-i debian-installer/exit/poweroff boolean true - -### Preseeding other packages -# Depending on what software you choose to install, or if things go wrong -# during the installation process, it's possible that other questions may -# be asked. You can preseed those too, of course. To get a list of every -# possible question that could be asked during an install, do an -# installation, and then run these commands: -# debconf-get-selections --installer > file -# debconf-get-selections >> file - -#### Advanced options -### Running custom commands during the installation -# d-i preseeding is inherently not secure. Nothing in the installer checks -# for attempts at buffer overflows or other exploits of the values of a -# preconfiguration file like this one. Only use preconfiguration files from -# trusted locations! To drive that home, and because it's generally useful, -# here's a way to run any shell command you'd like inside the installer, -# automatically. - -# This first command is run as early as possible, just after -# preseeding is read. -#d-i preseed/early_command string anna-install some-udeb -# This command is run immediately before the partitioner starts. It may be -# useful to apply dynamic partitioner preseeding that depends on the state -# of the disks (which may not be visible when preseed/early_command runs). -#d-i partman/early_command \ -# string debconf-set partman-auto/disk "$(list-devices disk | head -n1)" -# This command is run just before the install finishes, but when there is -# still a usable /target directory. You can chroot to /target and use it -# directly, or use the apt-install and in-target commands to easily install -# packages and run commands in the target system. -#d-i preseed/late_command string apt-install zsh; in-target chsh -s /bin/zsh - diff --git a/config_overlay/includes.chroot/etc/initramfs-tools/conf.d/loop_options b/config_overlay/includes.chroot/etc/initramfs-tools/conf.d/loop_options deleted file mode 100644 index acb67d1..0000000 --- a/config_overlay/includes.chroot/etc/initramfs-tools/conf.d/loop_options +++ /dev/null @@ -1,27 +0,0 @@ -export LOOPROOT= -export LOOPFSTYPE=ntfs-3g -export LOOPSRC= -export LOOPGET= -export LIOXWIPE= - -for x in $(cat /proc/cmdline); do - case $x in - looproot=*) - LOOPROOT=${x#looproot=} - case $LOOPROOT in - UUID=*) - LOOPROOT="/dev/disk/by-uuid/${LOOPROOT#UUID=}" - ;; - esac - ;; - loopsrc=*) - LOOPSRC=${x#loopsrc=} - ;; - loopget=*) - LOOPGET=${x#loopget=} - ;; - lioxwipe=*) - LIOXWIPE=${x#lioxwipe=} - ;; - esac -done diff --git a/config_overlay/includes.chroot/etc/initramfs-tools/hooks/loop_mount b/config_overlay/includes.chroot/etc/initramfs-tools/hooks/loop_mount deleted file mode 100755 index 1b5fa21..0000000 --- a/config_overlay/includes.chroot/etc/initramfs-tools/hooks/loop_mount +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -set -e - -case "${1}" in - prereqs) - echo "" - exit 0 - ;; -esac - -. /usr/share/initramfs-tools/hook-functions -copy_exec /sbin/kpartx /sbin/ -copy_exec /usr/bin/wget /usr/bin/ -copy_exec /usr/bin/xz /usr/bin/ -copy_exec /bin/gzip /usr/bin/ -copy_exec /bin/mount /usr/bin/ -copy_exec /bin/rm /usr/bin/ - -exit 0 diff --git a/config_overlay/includes.chroot/etc/initramfs-tools/scripts/init-premount/loop_mount b/config_overlay/includes.chroot/etc/initramfs-tools/scripts/init-premount/loop_mount deleted file mode 100755 index 94d20dc..0000000 --- a/config_overlay/includes.chroot/etc/initramfs-tools/scripts/init-premount/loop_mount +++ /dev/null @@ -1,142 +0,0 @@ -#!/bin/sh - -set -e - -case "${1}" in - prereqs) - echo "ntfs_3g" - exit 0 - ;; -esac - -. /scripts/functions - -if [ "x${LOOPROOT}" != "x" ]; then - lprootp=/mnt/looproot - lprootd=/dev/loop0 - - sleep 2 - modprobe loop - mkdir -p ${lprootp} - - _log_msg "Mounting ${LOOPROOT} to ${lprootp} ...\n" - /usr/bin/mount ${LOOPROOT} ${lprootp} || { - rc=$? - log_failure_msg "mounting failed ${rc}" - exit ${rc} - } - _log_msg "... mounting done.\n" - - case ${LIOXWIPE} in - 1) - _log_msg "Deleting liox-*.raw from ${LOOPROOT}\n" - /usr/bin/rm -v -f ${LOOPROOT}/liox-*.raw - ;; - 2) - _log_msg "Deleting liox-*.raw* from ${LOOPROOT}\n" - /usr/bin/rm -v -f ${LOOPROOT}/liox-*.raw* - ;; - 3) - _log_msg "Deleting liox-*.raw* from ${LOOPROOT}\n" - /usr/bin/rm -v -f ${LOOPROOT}/liox-*.raw* - _log_msg "Dropping to shell\n" - exec /bin/sh - exit 1 - ;; - esac - - _log_msg "Will attempt to use ${LOOPSRC} from ${LOOPROOT} as loop mounted drive\n" - loopfile=${lprootp}/${LOOPSRC} - if [ -f ${loopfile} ]; then - log_success_msg "loop drive file exists and is $(stat -c %s ${loopfile}) bytes" - elif [ "x${LOOPGET}" != "x" ]; then - _log_msg "Loop drive file does not exist, will attempt to fetch it from ${LOOPGET}\n" - - set +e - _log_msg "Configuring networking ...\n" - configure_networking - _log_msg "... configuring done\n" - set -e - - _log_msg "Starting wget -P ${lprootp} -c ${LOOPGET} ...\n" - /usr/bin/wget -P ${lprootp} -c ${LOOPGET} || { - rc=$? - log_failure_msg "wget failed ${rc}" - exit ${rc} - } - _log_msg "... wget finished\n" - - outfile=${LOOPGET##http*/} - out_ext=${outfile##*.} - out_with_stripped_ext=${outfile%.*} - - _log_msg "Assuming that we fetched file ${outfile}\n" - case ${out_ext} in - xz) - _log_msg "Decompressing xz'ed image ...\n" - /usr/bin/xz --keep -v -d ${lprootp}/${outfile} || { - rc=$? - log_failure_msg "xz failed ${rc}" - exit ${rc} - } - _log_msg "... decompressing done\n" - ;; - gz) - _log_msg "Decompressing gzip'ed image ...\n" - /usr/bin/gzip -v -d ${lprootp}/${outfile} > ${lprootp}/${out_with_stripped_ext} || { - rc=$? - log_failure_msg "gzip failed ${rc}" - exit ${rc} - } - _log_msg "... decompressing done\n" - ;; - raw) - _log_msg "Fetched file with .raw extension, nothing else to do\n" - ;; - *) - log_failure_msg "fetched file with unsupported extension, failing" - exit 1 - ;; - esac - - if [ ! -f ${loopfile} ]; then - log_failure_msg "loop drive file still does not exist" - exit 1 - fi - - unset outfile - unset out_ext - unset out_with_stripped_ext - else - log_failure_msg "loop drive file does not exist and no fetch source configured" - exit 1 - fi - - _log_msg "Setting up loop device ${lprootd} from ${loopfile} ...\n" - losetup ${lprootd} ${loopfile} || { - rc=$? - log_failure_msg "losetup failed ${rc}" - exit ${rc} - } - _log_msg "... losetup done\n" - - _log_msg "Probing loop device for partitions ...\n" - kpartx -a ${lprootd} || { - rc=$? - log_failure_msg "kpartx failed ${rc}" - exit ${rc} - } - _log_msg "... probing done\n" - - _log_msg "Recording ntfs-3g driver in no-kill list\n" - mkdir -p /run/sendsigs.omit.d - pidof mount.ntfs-3g >> /run/sendsigs.omit.d/ntfs-3g || true - - unset loopfile - unset lprootp - unset lprootd - - log_success_msg "setup loop mounted root" -fi - -exit 0 diff --git a/config_overlay/includes.chroot/etc/locale.nopurge b/config_overlay/includes.chroot/etc/locale.nopurge deleted file mode 100644 index 40976f1..0000000 --- a/config_overlay/includes.chroot/etc/locale.nopurge +++ /dev/null @@ -1,19 +0,0 @@ -# clean up man pages -MANDELETE - -# delete new locales without bothering -DONTBOTHERNEWLOCALE - -# list of locales to keep -en -en_US -en_US.UTF-8 -lt -lt_LT -lt_LT.UTF-8 -pl -pl_PL -pl_PL.UTF-8 -ru -ru_RU -ru_RU.UTF-8 diff --git a/config_overlay/package-lists/liox.list.chroot b/config_overlay/package-lists/liox.list.chroot deleted file mode 100644 index a7df43a..0000000 --- a/config_overlay/package-lists/liox.list.chroot +++ /dev/null @@ -1,33 +0,0 @@ -task-laptop - -plasma-desktop kwin-x11 sddm sddm-theme-breeze xserver-xorg -dolphin konsole kwrite ark gwenview okular - -firefox-esr wget -libreoffice-writer libreoffice-calc libreoffice-impress -libreoffice-kf5 libreoffice-plasma - -xserver-xorg-video-all - -vim vim-gtk3 joe gedit scite geany geany-plugins codeblocks codeblocks-contrib -kate sublime-text -kdevelop -neovim - -zsh mc emacs nano git - -make gcc g++ gdb ddd valgrind clang - -ruby python3 - -strace lsof tree curl dnsutils screen -iotop tmux htop kpartx tsocks units mlocate -bridge-utils bash-completion rfkill apt-file ntp locales -iptables-persistent -localepurge -firmware-iwlwifi - -gdb-doc manpages - -python3-requests -kcalc diff --git a/config_overlay_amd64/archives/vscode.key.chroot b/config_overlay_amd64/archives/vscode.key.chroot deleted file mode 100644 index 6e319d4..0000000 --- a/config_overlay_amd64/archives/vscode.key.chroot +++ /dev/null @@ -1,19 +0,0 @@ ------BEGIN PGP PUBLIC KEY BLOCK----- -Version: GnuPG v1.4.7 (GNU/Linux) - -mQENBFYxWIwBCADAKoZhZlJxGNGWzqV+1OG1xiQeoowKhssGAKvd+buXCGISZJwT -LXZqIcIiLP7pqdcZWtE9bSc7yBY2MalDp9Liu0KekywQ6VVX1T72NPf5Ev6x6DLV -7aVWsCzUAF+eb7DC9fPuFLEdxmOEYoPjzrQ7cCnSV4JQxAqhU4T6OjbvRazGl3ag -OeizPXmRljMtUUttHQZnRhtlzkmwIrUivbfFPD+fEoHJ1+uIdfOzZX8/oKHKLe2j -H632kvsNzJFlROVvGLYAk2WRcLu+RjjggixhwiB+Mu/A8Tf4V6b+YppS44q8EvVr -M+QvY7LNSOffSO6Slsy9oisGTdfE39nC7pVRABEBAAG0N01pY3Jvc29mdCAoUmVs -ZWFzZSBzaWduaW5nKSA8Z3Bnc2VjdXJpdHlAbWljcm9zb2Z0LmNvbT6JATUEEwEC -AB8FAlYxWIwCGwMGCwkIBwMCBBUCCAMDFgIBAh4BAheAAAoJEOs+lK2+EinPGpsH -/32vKy29Hg51H9dfFJMx0/a/F+5vKeCeVqimvyTM04C+XENNuSbYZ3eRPHGHFLqe -MNGxsfb7C7ZxEeW7J/vSzRgHxm7ZvESisUYRFq2sgkJ+HFERNrqfci45bdhmrUsy -7SWw9ybxdFOkuQoyKD3tBmiGfONQMlBaOMWdAsic965rvJsd5zYaZZFI1UwTkFXV -KJt3bp3Ngn1vEYXwijGTa+FXz6GLHueJwF0I7ug34DgUkAFvAs8Hacr2DRYxL5RJ -XdNgj4Jd2/g6T9InmWT0hASljur+dJnzNiNCkbn9KbX7J/qK1IbR8y560yRmFsU+ -NdCFTW7wY0Fb1fWJ+/KTsC4= -=J6gs ------END PGP PUBLIC KEY BLOCK----- diff --git a/config_overlay_amd64/package-lists/liox-amd64.list.chroot b/config_overlay_amd64/package-lists/liox-amd64.list.chroot deleted file mode 100644 index 01b2d72..0000000 --- a/config_overlay_amd64/package-lists/liox-amd64.list.chroot +++ /dev/null @@ -1 +0,0 @@ -code diff --git a/config_overlay_contest/includes.chroot/etc/systemd/network/10-wired.network b/config_overlay_contest/includes.chroot/etc/systemd/network/10-wired.network deleted file mode 100644 index 6e3be93..0000000 --- a/config_overlay_contest/includes.chroot/etc/systemd/network/10-wired.network +++ /dev/null @@ -1,5 +0,0 @@ -[Match] -Name=eth* enxc* - -[Network] -DHCP=yes diff --git a/config_overlay_contest/includes.chroot/usr/share/liox-config/install_vscode_ext.sh b/config_overlay_contest/includes.chroot/usr/share/liox-config/install_vscode_ext.sh deleted file mode 100755 index 71a8ff8..0000000 --- a/config_overlay_contest/includes.chroot/usr/share/liox-config/install_vscode_ext.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/sh - -set -e - -if [ "$(id -u)" -ne 0 ]; then - echo "Please run as root" - exit -fi - -if [ "$#" -ne 1 ]; then - echo "Usage: $0 " - exit -fi - -if [ ! -d "/home/$1" ]; then - echo "User $1 does not exist" -else - VSCODE_DIR=/home/$1/.vscode/extensions - su - $1 -c "mkdir -p $VSCODE_DIR" - if [ ! -f "$VSCODE_DIR/extensions.json" ]; then - echo "Creating extensions.json" - echo "[]" > "$VSCODE_DIR/extensions.json" - chown $1:$1 "$VSCODE_DIR/extensions.json" - fi - su - $1 -c "code --extensions-dir $VSCODE_DIR --install-extension ms-vscode.cpptools-extension-pack" - echo "Removing VSIXs" - rm -f /home/$1/.config/Code/CachedExtensionVSIXs/* -fi diff --git a/config_overlay_contest/package-lists/liox-contest.list.chroot b/config_overlay_contest/package-lists/liox-contest.list.chroot deleted file mode 100644 index cf6ebf3..0000000 --- a/config_overlay_contest/package-lists/liox-contest.list.chroot +++ /dev/null @@ -1 +0,0 @@ -systemd-resolved \ No newline at end of file diff --git a/config_overlay_inactive/README.md b/config_overlay_inactive/README.md deleted file mode 100644 index 9dde876..0000000 --- a/config_overlay_inactive/README.md +++ /dev/null @@ -1,6 +0,0 @@ -includes.chroot/etc/skel/.config/Code/User/settings.json - Disables Intellisense cache for C/C++ extension, useful to limit disk consumption and I/O when constrained - -includes.chroot/usr/lib/systemd/system/lmio-networking.service -includes.chroot/usr/share/liox-config/static_or_dhcp.py - Determine networking setup based on MAC address diff --git a/config_overlay_inactive/includes.chroot/etc/skel/.config/Code/User/settings.json b/config_overlay_inactive/includes.chroot/etc/skel/.config/Code/User/settings.json deleted file mode 100644 index e3d7583..0000000 --- a/config_overlay_inactive/includes.chroot/etc/skel/.config/Code/User/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "C_Cpp.intelliSenseCacheSize": 0 -} diff --git a/config_overlay_inactive/includes.chroot/usr/lib/systemd/system/lmio-networking.service b/config_overlay_inactive/includes.chroot/usr/lib/systemd/system/lmio-networking.service deleted file mode 100644 index 3773a33..0000000 --- a/config_overlay_inactive/includes.chroot/usr/lib/systemd/system/lmio-networking.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=LMIO networking -Before=network-pre.target - -[Install] -WantedBy=network-pre.target - -[Service] -Type=oneshot -WorkingDirectory=/usr/share/liox-config -ExecStart=/usr/bin/python3 static_or_dhcp.py diff --git a/config_overlay_inactive/includes.chroot/usr/share/liox-config/static_or_dhcp.py b/config_overlay_inactive/includes.chroot/usr/share/liox-config/static_or_dhcp.py deleted file mode 100755 index 1c4ee0f..0000000 --- a/config_overlay_inactive/includes.chroot/usr/share/liox-config/static_or_dhcp.py +++ /dev/null @@ -1,65 +0,0 @@ -#!/usr/bin/env python -# -*- coding: utf-8 -*- - -ifaces_dhcp = ''' -source /etc/network/interfaces.d/* - -auto lo -iface lo inet loopback - -allow-hotplug eth0 -iface eth0 inet dhcp -''' - -ifaces_static = ''' -source /etc/network/interfaces.d/* - -auto lo -iface lo inet loopback - -allow-hotplug eth0 -iface eth0 inet static - address {{ipaddr}} - netmask 255.255.255.0 - gateway 192.168.1.1 -''' - -addrlist = { - 'd0:50:99:40:90:cd': '192.168.1.140', - 'd0:50:99:40:8f:22': '192.168.1.141', - 'd0:50:99:40:8f:1a': '192.168.1.142', - 'd0:50:99:40:8f:38': '192.168.1.143', - 'd0:50:99:40:8f:32': '192.168.1.144', - 'd0:50:99:40:8f:3c': '192.168.1.145', - 'd0:50:99:40:91:c3': '192.168.1.146', - 'd0:50:99:40:8f:30': '192.168.1.147', - 'd0:50:99:39:aa:5e': '192.168.1.148', - 'd0:50:99:40:8f:2c': '192.168.1.149', - '78:24:af:3b:71:10': '192.168.1.160', - 'e0:3f:49:b5:2b:b7': '192.168.1.161', - 'e0:3f:49:b5:2b:a4': '192.168.1.162', - 'e0:3f:49:b5:2a:ab': '192.168.1.163', - 'e0:3f:49:b5:2b:b5': '192.168.1.164', - 'e0:3f:49:b5:2b:b3': '192.168.1.165', - 'e0:3f:49:b5:2b:ad': '192.168.1.166', - 'e0:3f:49:b5:1e:9e': '192.168.1.167', - '78:24:af:3b:70:d0': '192.168.1.168', - 'e0:3f:49:b5:2b:ae': '192.168.1.169', -} - - -def main(): - with open('/sys/class/net/eth0/address', 'r') as f: - mac = f.readline()[:-1].lower() - print("My MAC is", mac) - if mac in addrlist: - ifaces = ifaces_static[1:].replace('{{ipaddr}}', addrlist[mac]) - else: - ifaces = ifaces_dhcp[1:] - f = open('/etc/network/interfaces', 'w') - f.write(ifaces) - f.close() - - -if __name__ == '__main__': - main() diff --git a/create-image.sh b/create-image.sh new file mode 100755 index 0000000..0496ebb --- /dev/null +++ b/create-image.sh @@ -0,0 +1,118 @@ +#!/usr/bin/env bash +set -euo pipefail + +if [ $(id -u) -ne 0 ] +then + echo "Script must be run as root" + exit 1 +fi + +IMAGE_SIZE_MB=16384 +SWAP_SIZE_MB=4096 +ARCH="amd64" +BUILD_DIR="./mnt" +DEBOOTSTRAP_CACHE_DIR="./.cache/debootstrap" +APT_CACHE_DIR="./.cache/apt" +BUILD_IMAGE="./liox.img" + +if [ -d "${BUILD_DIR}" ] +then + echo "Directory \`${BUILD_DIR}\` exists" + exit 1 +fi + +if [ -f "${BUILD_IMAGE}" ] +then + read -p "Image \`${BUILD_IMAGE}\` already exists. Rebuild? [y/N] " prompt + if [[ "${prompt}" != "y" && "${prompt}" != "Y" ]] + then + echo "Aborting" + exit 1 + fi +else + echo "Creating new image" + qemu-img create -f raw "${BUILD_IMAGE}" "${IMAGE_SIZE_MB}M" +fi + +set -x +BLOCK_DEVICE=$(sudo losetup --show -f "${BUILD_IMAGE}") +SWAP_END=$((513+SWAP_SIZE_MB)) +EFIPART="${BLOCK_DEVICE}p1" +SWAPPART="${BLOCK_DEVICE}p2" +ROOTPART="${BLOCK_DEVICE}p3" +parted -s "${BLOCK_DEVICE}" \ + mklabel gpt \ + mkpart ESP fat32 1MiB 513MiB \ + set 1 boot on set 1 esp on \ + mkpart primary linux-swap 513MiB "${SWAP_END}MiB" \ + mkpart primary ext4 "${SWAP_END}MiB" 100% +mkfs.fat -F32 "${EFIPART}" +mkswap "${SWAPPART}" +mkfs.ext4 "${ROOTPART}" +mkdir -p "${BUILD_DIR}" +mount "${ROOTPART}" "${BUILD_DIR}" +mkdir -p "${BUILD_DIR}/boot/efi" +mount "${EFIPART}" "${BUILD_DIR}/boot/efi" + +mkdir -p "${DEBOOTSTRAP_CACHE_DIR}" "${APT_CACHE_DIR}" +debootstrap \ + --cache-dir=$(realpath "${DEBOOTSTRAP_CACHE_DIR}") \ + --arch "${ARCH}" \ + stable "${BUILD_DIR}" https://deb.debian.org/debian + +mkdir -p "${BUILD_DIR}/var/cache/apt/archives" +mkdir -p "${BUILD_DIR}/chroot-overlay" +mkdir -p "${BUILD_DIR}/apt-keys" +mkdir -p "${BUILD_DIR}/apt-sources" +mkdir -p "${BUILD_DIR}/packages" +mount -t tmpfs chroot_tmp "${BUILD_DIR}/tmp" +mount --make-rslave --rbind /proc "${BUILD_DIR}/proc" +mount --make-rslave --rbind /sys "${BUILD_DIR}/sys" +mount --make-rslave --rbind /dev "${BUILD_DIR}/dev" +# mount --make-rslave --rbind /run "${BUILD_DIR}/run" +mount --bind "${APT_CACHE_DIR}" "${BUILD_DIR}/var/cache/apt/archives" +mount --make-rslave --rbind -o ro ./chroot-overlay "${BUILD_DIR}/chroot-overlay" +mount --make-rslave --rbind -o ro ./apt-keys "${BUILD_DIR}/apt-keys" +mount --make-rslave --rbind -o ro ./apt-sources "${BUILD_DIR}/apt-sources" +mount --make-rslave --rbind -o ro ./packages "${BUILD_DIR}/packages" + +function cleanup_mounts() +{ + umount "${BUILD_DIR}/tmp" + umount -l "${BUILD_DIR}/proc" + umount -l "${BUILD_DIR}/sys" + umount -l "${BUILD_DIR}/dev" + # umount -l "${BUILD_DIR}/run" + umount "${BUILD_DIR}/var/cache/apt/archives" + umount "${BUILD_DIR}/boot/efi" + umount -l "${BUILD_DIR}/chroot-overlay" + umount -l "${BUILD_DIR}/apt-keys" + umount -l "${BUILD_DIR}/apt-sources" + umount -l "${BUILD_DIR}/packages" + rmdir "${BUILD_DIR}/chroot-overlay" + rmdir "${BUILD_DIR}/apt-keys" + rmdir "${BUILD_DIR}/apt-sources" + rmdir "${BUILD_DIR}/packages" + umount "${BUILD_DIR}" + losetup -d "${BLOCK_DEVICE}" + rmdir "${BUILD_DIR}" +} +trap cleanup_mounts EXIT + +cp ./chroot-script.sh "${BUILD_DIR}" +if [ -f ./contest.env ]; then + cp ./contest.env "${BUILD_DIR}/tmp/" +fi +cat << EOF > "${BUILD_DIR}/etc/apt/apt.conf.d/99cache" +Binary::apt::APT::Keep-Downloaded-Packages "true"; +APT::Keep-Downloaded-Packages "true"; +EOF +mkdir -p "${BUILD_DIR}/etc/apt/preferences.d" +cp ./apt-preferences/* "${BUILD_DIR}/etc/apt/preferences.d" +chroot "${BUILD_DIR}" /bin/bash -c \ + "/bin/env -i \ + BLOCK_DEVICE=${BLOCK_DEVICE} \ + EFIPART=${EFIPART} \ + SWAPPART=${SWAPPART} \ + ROOTPART=${ROOTPART} \ + /bin/bash /chroot-script.sh" diff --git a/config_overlay_contest/packages/olimp-control_1.4-1_all.deb b/packages/olimp-control_1.4-1_all.deb similarity index 100% rename from config_overlay_contest/packages/olimp-control_1.4-1_all.deb rename to packages/olimp-control_1.4-1_all.deb diff --git a/qemushared/load.sh b/qemushared/load.sh new file mode 100755 index 0000000..9d1d4c8 --- /dev/null +++ b/qemushared/load.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env sh +mkdir -p /mnt/disk +set -xe +apk add e2fsprogs dosfstools parted zstd lsblk blkid mount tar + +parted -s /dev/sda \ + mklabel gpt \ + mkpart ESP fat32 1MiB 513MiB \ + set 1 boot on \ + set 1 esp on \ + mkpart primary ext4 513MiB 100% + +yes | mkfs.fat -F32 /dev/sda1 +yes | mkfs.ext4 /dev/sda2 + +mount /dev/sda2 /mnt/disk +tar --numeric-owner -xpf /mnt/rootfs/rootfs.tar.zstd -C /mnt/disk +mkdir -p /mnt/disk/boot/efi +mount /dev/sda1 /mnt/disk/boot/efi + +EFI_UUID=$(blkid -s UUID -o value /dev/sda1) +ROOT_UUID=$(blkid -s UUID -o value /dev/sda2) +cat << EOF > /mnt/disk/etc/fstab +UUID=${EFI_UUID} /boot/efi vfat umask=0077 0 1 +UUID=${ROOT_UUID} / ext4 defaults,errors=remount-ro 0 1 +EOF + +mount --make-rslave --rbind /proc /mnt/disk/proc +mount --make-rslave --rbind /dev /mnt/disk/dev +chroot /mnt/disk /bin/bash -c 'export PATH=$PATH:/sbin && grub-install --target=x86_64-efi --removable /dev/sda && update-grub' +poweroff diff --git a/qemushared/loaddirect.sh b/qemushared/loaddirect.sh new file mode 100755 index 0000000..36c026b --- /dev/null +++ b/qemushared/loaddirect.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env sh +set -xe +mount /dev/sda2 /mnt/disk +mount /dev/sda1 /mnt/disk/boot/efi +mount --make-rslave --rbind /proc /mnt/disk/proc +mount --make-rslave --rbind /dev /mnt/disk/dev +chroot /mnt/disk /bin/bash -c 'export PATH=$PATH:/sbin && grub-install --target=x86_64-efi --removable /dev/sda && update-grub' +poweroff diff --git a/startliox.sh b/startliox.sh new file mode 100755 index 0000000..56d2685 --- /dev/null +++ b/startliox.sh @@ -0,0 +1,4 @@ +qemu-system-x86_64 \ + -bios $(nix-build '' -A OVMF.fd)/FV/OVMF.fd \ + -m 4G -smp 2 -accel kvm \ + -drive file=./liox.img,format=raw