From dc3a95e4f51be933321b35b7924f08aeac139f0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jens=20M=C3=B6ller?= Date: Fri, 5 Sep 2025 21:16:47 +0200 Subject: [PATCH] Modifications used for T-DOSE 2025 - intermediate commit --- scripts/setup-babelbox.sh | 115 +++++++++++++++++++++++++++++++++++++- 1 file changed, 114 insertions(+), 1 deletion(-) diff --git a/scripts/setup-babelbox.sh b/scripts/setup-babelbox.sh index 0f8035b..76ee143 100644 --- a/scripts/setup-babelbox.sh +++ b/scripts/setup-babelbox.sh @@ -2,7 +2,7 @@ set -e -apt-get install -y git wget +apt-get install -y git wget ctorrent debconf cd /srv wget http://ftp.debian.org/debian/dists/stable/main/installer-amd64/current/images/hd-media/gtk/initrd.gz http://ftp.debian.org/debian/dists/stable/main/installer-amd64/current/images/hd-media/gtk/vmlinuz http://ftp.debian.org/debian/pool/main/u/util-linux/fdisk-udeb_2.33.1-0.1_amd64.udeb mkdir initrd_with_fdisk @@ -12,8 +12,121 @@ dpkg-deb -x ../fdisk-udeb_2.33.1-0.1_amd64.udeb . find . | cpio --create --format='newc' | gzip -9 > ../initrd.gz cd .. rm -rf initrd_with_fdisk fdisk-udeb_2.33.1-0.1_amd64.udeb + +cat <> /srv/download.sh +#!/bin/bash +wget https://cdimage.debian.org/debian-cd/current/amd64/iso-cd/debian-12.10.0-amd64-netinst.iso +#wget https://cdimage.debian.org/debian-cd/current/amd64/bt-dvd/debian-12.10.0-amd64-DVD-1.iso.torrent +#ctorrent debian-12.10.0-amd64-DVD-1.iso.torrent + +EOT + +chmod 755 download.sh + git clone https://salsa.debian.org/installer-team/babelbox.git cd babelbox + +echo "" > preseed_early +cat <> preseed_early +#!/bin/sh + +# Script run at the beginning of the installation (as set in preseed.cfg). + +set -e + +. /usr/share/debconf/confmodule +db_subst babelbox/info LANGNAME "German" || true +db_info babelbox/info || true + +mkdir -p /lib/partman/init.d +cp /hd-media/srv/babelbox/00del_partition /lib/partman/init.d/ + +apt-install alsa-base || true +apt-install alsa-utils || true + +exit 0 + +EOT + +echo "" > langlist +cat <> langlist +de_DE::German +EOT + +echo "" > babelbox-grub +cat <> babelbox-grub +menuentry 'BabelBox install' --class debian --class gnu-linux --class gnu --class os { + insmod part_msdos + insmod ext2 + set root='(hd0,1)' + echo 'Loading Linux ...' + gfxpayload=800x600x16,800x600 + linux /srv/vmlinuz video=vesa:ywrap,mtrr priority=critical console-keymaps-at/keymap=de keyboard-configuration/xkb-keymap=de file=/hd-media/srv/babelbox/preseed.cfg debian-installer/locale=de_DE + echo 'Loading initial ramdisk ...' + initrd /srv/initrd.gz +} + +menuentry 'BabelBox demo' --class debian --class gnu-linux --class gnu --class os { + insmod part_msdos + insmod ext2 + set root='(hd0,5)' + echo 'Loading Linux ...' + gfxpayload=800x600x16,800x600 + linux /vmlinuz root=/dev/sda5 ro quiet + echo 'Loading initial ramdisk ...' + initrd /initrd.img +} +EOT + +echo "" > cronscript +cat <> cronscript +#! /bin/bash + +# Script to prepare babelbox for the next install: switch language to the +# next in the list. Normally run from installed system, but can also be run +# from the base system that controls the babelbox runs. +# It takes the top line from langlist as the next language and moves that +# line to the bottom of the list. + +set -e + +ROOT="" + +if [ -f /BABELBOX ] ; then + ROOT="/mnt" + sleep 30 + + mount /dev/sda1 $ROOT +fi + +cd $ROOT/srv/babelbox + +LANG="de_DE::German" +#NEXTLANG="de_DE:x:German" + +LOCALE=$(echo "$LANG" | cut -d: -f1) +LANGNAME=$(echo "$LANG" | cut -d: -f3) +GRUBLINE=$(echo "$LANG" | cut -d: -f4) + +sed -i "s/LANGNAME \".*\"/LANGNAME \"$LANGNAME\"/" preseed_early + +sed -i "s/locale=.*$/locale=$LOCALE $GRUBLINE/ + s/^\([[:space:]]*\)set default=\"[[:digit:]]*\"$/\1set default=\"2\"/" $ROOT/boot/grub/grub.cfg + +# Comment out the next three lines if you don't want the language to change +#N_LOCALE=$(echo "$NEXTLANG" | cut -d: -f1) +#sed -i "s/:x:/::/;s/^$N_LOCALE::/$N_LOCALE:x:/" langlist + +if [ -z "$ROOT" ]; then + echo "Next language: $LANGNAME" +fi + +exit 0 + +EOT + + + cat babelbox-grub >> /etc/grub.d/40_custom update-grub ./cronscript