# Yino preseed configuration for Debian 13 (Trixie) # Fully unattended install with hardcoded test credentials. # TODO: For production, remove hardcoded passwords and prompt interactively. # Locale and keyboard d-i debian-installer/locale string en_US.UTF-8 d-i keyboard-configuration/xkb-keymap select us # Network — DHCP (needed to pull Hyprland from sid) d-i netcfg/enable boolean true d-i netcfg/choose_interface select auto d-i netcfg/get_hostname string yino d-i netcfg/get_domain string local d-i netcfg/hostname string yino # Mirror — Debian archive (needed for Hyprland from sid) d-i apt-setup/use_mirror boolean true d-i mirror/country string manual d-i mirror/http/hostname string deb.debian.org d-i mirror/http/directory string /debian d-i mirror/http/proxy string # Clock d-i clock-setup/utc boolean true d-i time/zone string UTC # LUKS encryption passphrase (hardcoded for dev/test) d-i partman-crypto/passphrase string yinoyino d-i partman-crypto/passphrase-again string yinoyino d-i partman-crypto/weak_passphrase boolean true # Partitioning — encrypted LVM with btrfs root d-i partman-auto/method string crypto d-i partman-lvm/device_remove_lvm boolean true d-i partman-md/device_remove_md boolean true d-i partman-lvm/confirm boolean true d-i partman-lvm/confirm_nooverwrite boolean true d-i partman-auto-lvm/guided_size string max d-i partman-auto-crypto/erase_disks boolean false d-i partman/default_filesystem string btrfs d-i partman-auto/choose_recipe select atomic 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 # User account (hardcoded for dev/test) d-i passwd/root-login boolean false d-i passwd/user-fullname string Yino User d-i passwd/username string yino d-i passwd/user-password string yinoyino d-i passwd/user-password-again string yinoyino d-i user-setup/allow-password-weak boolean true # Packages — minimal base + essentials tasksel tasksel/first multiselect standard d-i pkgsel/include string sudo btrfs-progs # Don't eject CD (fails in QEMU, causes prompt loop) d-i cdrom-detect/eject boolean false # Skip upgrade check (offline install, nothing to upgrade) d-i pkgsel/upgrade select none # No security/updates services (offline) d-i apt-setup/services-select multiselect # No popularity contest popularity-contest popularity-contest/participate boolean false # GRUB d-i grub-installer/only_debian boolean true d-i grub-installer/bootdev string default # Skip additional media scan d-i apt-setup/cdrom/set-first boolean false d-i apt-setup/cdrom/set-next boolean false d-i apt-setup/cdrom/set-failed boolean false # Skip media integrity check (blocks unattended install) d-i cdrom-checker/start boolean false # Finish d-i finish-install/reboot_in_progress note # Post-install: configure serial console, sid repo, and first-boot desktop setup # NOTE: preseed interprets \n as literal newlines, breaking shell commands. # Use multiple echo commands instead of printf with \n for multi-line files. # Heavy package installation is deferred to a first-boot systemd service. d-i preseed/late_command string \ USER=$(grep ':x:1000:' /target/etc/passwd | cut -d: -f1); \ LOG=/target/var/log/yino-late-command.log; \ echo "=== Yino late_command start ===" > $LOG; \ echo "USER=$USER" >> $LOG; \ echo "--- GRUB serial console ---" >> $LOG; \ sed -i 's/^GRUB_CMDLINE_LINUX_DEFAULT=.*/GRUB_CMDLINE_LINUX_DEFAULT="quiet"/' /target/etc/default/grub; \ sed -i 's/^GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX="console=ttyS0,115200n8 console=tty0"/' /target/etc/default/grub; \ echo 'GRUB_TERMINAL="serial console"' >> /target/etc/default/grub; \ echo 'GRUB_SERIAL_COMMAND="serial --speed=115200 --unit=0 --word=8 --parity=no --stop=1"' >> /target/etc/default/grub; \ in-target update-grub >> $LOG 2>&1; \ echo "--- DNS setup ---" >> $LOG; \ echo "nameserver 1.1.1.1" > /target/etc/resolv.conf; \ echo "--- sid repo ---" >> $LOG; \ echo 'deb http://deb.debian.org/debian sid main contrib non-free-firmware' > /target/etc/apt/sources.list.d/sid.list; \ F=/target/etc/apt/preferences.d/sid-low-priority; \ echo 'Package: *' > $F; \ echo 'Pin: release a=unstable' >> $F; \ echo 'Pin-Priority: 100' >> $F; \ echo "--- first-boot setup script ---" >> $LOG; \ S=/target/usr/local/sbin/yino-first-boot; \ echo '#!/bin/sh' > $S; \ echo 'set -ex' >> $S; \ echo 'LOG=/var/log/yino-first-boot.log' >> $S; \ echo 'exec > "$LOG" 2>&1' >> $S; \ echo 'echo "=== Yino first-boot start ==="' >> $S; \ echo 'USER=$(grep ":x:1000:" /etc/passwd | cut -d: -f1)' >> $S; \ echo 'export DEBIAN_FRONTEND=noninteractive' >> $S; \ echo 'apt-get update' >> $S; \ echo 'apt-get -y install sddm' >> $S; \ echo 'apt-get -y -t unstable install hyprland uwsm foot' >> $S; \ echo 'mkdir -p /etc/sddm.conf.d' >> $S; \ echo 'echo "[Autologin]" > /etc/sddm.conf.d/autologin.conf' >> $S; \ echo 'echo "User=$USER" >> /etc/sddm.conf.d/autologin.conf' >> $S; \ echo 'echo "Session=hyprland-uwsm" >> /etc/sddm.conf.d/autologin.conf' >> $S; \ echo 'echo "" >> /etc/sddm.conf.d/autologin.conf' >> $S; \ echo 'echo "[Theme]" >> /etc/sddm.conf.d/autologin.conf' >> $S; \ echo 'echo "Current=breeze" >> /etc/sddm.conf.d/autologin.conf' >> $S; \ echo 'systemctl enable sddm' >> $S; \ echo 'mkdir -p /usr/share/wayland-sessions' >> $S; \ echo 'echo "[Desktop Entry]" > /usr/share/wayland-sessions/hyprland-uwsm.desktop' >> $S; \ echo 'echo "Name=Hyprland (UWSM)" >> /usr/share/wayland-sessions/hyprland-uwsm.desktop' >> $S; \ echo 'echo "Comment=Hyprland via Universal Wayland Session Manager" >> /usr/share/wayland-sessions/hyprland-uwsm.desktop' >> $S; \ echo 'echo "Exec=uwsm start hyprland.desktop" >> /usr/share/wayland-sessions/hyprland-uwsm.desktop' >> $S; \ echo 'echo "Type=Application" >> /usr/share/wayland-sessions/hyprland-uwsm.desktop' >> $S; \ echo 'echo "DesktopNames=Hyprland" >> /usr/share/wayland-sessions/hyprland-uwsm.desktop' >> $S; \ echo 'UHOME=/home/$USER' >> $S; \ echo 'mkdir -p $UHOME/.config/hyprland' >> $S; \ echo 'F=$UHOME/.config/hyprland/hyprland.conf' >> $S; \ echo 'echo "monitor = ,preferred,auto,1" > $F' >> $S; \ echo 'echo "" >> $F' >> $S; \ echo 'echo "env = WLR_NO_HARDWARE_CURSORS,1" >> $F' >> $S; \ echo 'echo "env = WLR_RENDERER_ALLOW_SOFTWARE,1" >> $F' >> $S; \ echo 'echo "" >> $F' >> $S; \ echo 'echo "exec-once = foot --server" >> $F' >> $S; \ echo 'echo "" >> $F' >> $S; \ echo 'echo "\$mainMod = SUPER" >> $F' >> $S; \ echo 'echo "" >> $F' >> $S; \ echo 'echo "bind = \$mainMod, Return, exec, foot" >> $F' >> $S; \ echo 'echo "bind = \$mainMod SHIFT, Q, killactive" >> $F' >> $S; \ echo 'echo "bind = \$mainMod SHIFT, E, exit" >> $F' >> $S; \ echo 'echo "" >> $F' >> $S; \ echo 'echo "bind = \$mainMod, 1, workspace, 1" >> $F' >> $S; \ echo 'echo "bind = \$mainMod, 2, workspace, 2" >> $F' >> $S; \ echo 'echo "bind = \$mainMod, 3, workspace, 3" >> $F' >> $S; \ echo 'echo "bind = \$mainMod, 4, workspace, 4" >> $F' >> $S; \ echo 'echo "bind = \$mainMod, 5, workspace, 5" >> $F' >> $S; \ echo 'echo "" >> $F' >> $S; \ echo 'echo "bind = \$mainMod, left, movefocus, l" >> $F' >> $S; \ echo 'echo "bind = \$mainMod, right, movefocus, r" >> $F' >> $S; \ echo 'echo "bind = \$mainMod, up, movefocus, u" >> $F' >> $S; \ echo 'echo "bind = \$mainMod, down, movefocus, d" >> $F' >> $S; \ echo 'chown -R 1000:1000 $UHOME/.config' >> $S; \ echo 'systemctl disable yino-first-boot.service' >> $S; \ echo 'rm -f /usr/local/sbin/yino-first-boot' >> $S; \ echo 'echo "=== Yino first-boot done ==="' >> $S; \ chmod 755 $S; \ F=/target/etc/systemd/system/yino-first-boot.service; \ echo '[Unit]' > $F; \ echo 'Description=Yino first-boot desktop setup' >> $F; \ echo 'After=network-online.target' >> $F; \ echo 'Wants=network-online.target' >> $F; \ echo 'ConditionPathExists=/usr/local/sbin/yino-first-boot' >> $F; \ echo '' >> $F; \ echo '[Service]' >> $F; \ echo 'Type=oneshot' >> $F; \ echo 'ExecStart=/usr/local/sbin/yino-first-boot' >> $F; \ echo 'RemainAfterExit=yes' >> $F; \ echo '' >> $F; \ echo '[Install]' >> $F; \ echo 'WantedBy=multi-user.target' >> $F; \ in-target systemctl enable yino-first-boot.service >> $LOG 2>&1; \ echo "=== Yino late_command done ===" >> $LOG