############################################################################### # Aamsveen Audio Kiosk - Linux Mint 22.3 / Ubiquity # # WARNING: # # The selected target disk is COMPLETELY ERASED. # # The installer deliberately excludes the USB installer media. # # The target disk is partitioned as GPT and contains: # # 1 MiB BIOS Boot partition # 538 MiB EFI System Partition # ~remaining Linux root filesystem # 2 GiB swap # # The BIOS Boot partition allows GRUB to install when the installer itself # is booted in legacy BIOS mode. # # The EFI System Partition allows GRUB to install when booted in UEFI mode. ############################################################################### ############################################################################### # Debconf ############################################################################### d-i debconf/priority string critical ############################################################################### # Locale ############################################################################### d-i debian-installer/locale string nl_NL ############################################################################### # Keyboard ############################################################################### d-i keyboard-configuration/xkb-keymap select us(euro) d-i keyboard-configuration/layoutcode string us d-i keyboard-configuration/variantcode string euro d-i keyboard-configuration/ask_detect boolean false ############################################################################### # Network ############################################################################### d-i netcfg/choose_interface select auto ############################################################################### # Time zone ############################################################################### d-i clock-setup/utc boolean true d-i time/zone string Europe/Amsterdam ############################################################################### # User ############################################################################### d-i passwd/user-fullname string AV Admin d-i passwd/username string av-admin d-i passwd/user-password password @)av-admin@^ d-i passwd/user-password-again password @)av-admin@^ ############################################################################### # Hostname ############################################################################### d-i netcfg/get_hostname string audio-kiosk d-i netcfg/get_domain string ############################################################################### # Partitioning method ############################################################################### d-i partman-auto/method string regular ############################################################################### # Dynamic installation-disk selection # # This runs immediately before partman starts. # # The installer USB media is deliberately excluded. # # We: # # 1. Ask the installer for all disks. # 2. Find USB partitions. # 3. Determine their parent disks using sysfs. # 4. Exclude those disks. # 5. Exclude disks marked removable. # 6. Select the first remaining disk. # # No /dev/sda or /dev/vda is hard-coded. # # If no safe target exists, installation stops. ############################################################################### d-i partman/early_command string \ LOG="/var/log/aamsveen-partition.log"; \ echo "==================================================" > "$LOG"; \ echo "Aamsveen Audio Kiosk - disk detection" >> "$LOG"; \ echo "==================================================" >> "$LOG"; \ echo "" >> "$LOG"; \ echo "Disks reported by list-devices disk:" >> "$LOG"; \ list-devices disk >> "$LOG" 2>&1; \ echo "" >> "$LOG"; \ USB_DISKS=""; \ for USB_PART in $(list-devices usb-partition 2>/dev/null || true); do \ PART_NAME="$(basename "$USB_PART")"; \ PART_SYS="/sys/class/block/$PART_NAME"; \ if [ -e "$PART_SYS" ]; then \ PARENT="$(readlink -f "$PART_SYS" 2>/dev/null || true)"; \ while [ -n "$PARENT" ] && [ "$(basename "$PARENT")" != "block" ]; do \ PARENT_NAME="$(basename "$PARENT")"; \ if [ -r "/sys/class/block/$PARENT_NAME/removable" ]; then \ USB_DISKS="$USB_DISKS /dev/$PARENT_NAME"; \ break; \ fi; \ NEXT="$(dirname "$PARENT")"; \ [ "$NEXT" = "$PARENT" ] && break; \ PARENT="$NEXT"; \ done; \ fi; \ done; \ TARGET_DISK=""; \ for DISK in $(list-devices disk); do \ SKIP=0; \ for USB_DISK in $USB_DISKS; do \ if [ "$DISK" = "$USB_DISK" ]; then \ SKIP=1; \ break; \ fi; \ done; \ [ "$SKIP" -eq 1 ] && continue; \ BASENAME="$(basename "$DISK")"; \ if [ -r "/sys/class/block/$BASENAME/removable" ]; then \ if [ "$(cat "/sys/class/block/$BASENAME/removable")" = "1" ]; then \ continue; \ fi; \ fi; \ TARGET_DISK="$DISK"; \ break; \ done; \ echo "USB disks excluded: $USB_DISKS" >> "$LOG"; \ echo "Selected target disk: $TARGET_DISK" >> "$LOG"; \ echo "" >> "$LOG"; \ if [ -z "$TARGET_DISK" ]; then \ echo "ERROR: No safe internal target disk found." >> "$LOG"; \ exit 1; \ fi; \ debconf-set partman-auto/disk "$TARGET_DISK"; \ debconf-set grub-installer/bootdev "$TARGET_DISK"; \ echo "partman-auto/disk = $TARGET_DISK" >> "$LOG"; \ echo "grub-installer/bootdev = $TARGET_DISK" >> "$LOG" ############################################################################### # GPT partition table ############################################################################### d-i partman-partitioning/default_label string gpt d-i partman-partitioning/choose_label select gpt ############################################################################### # Partition recipe # # BIOS BOOT: # # 1 MiB, no filesystem # # Required when GRUB is installed in legacy BIOS mode on GPT. # # EFI: # # 538 MiB FAT32 EFI System Partition # # ROOT: # # minimum 12 GiB # priority 30 GiB # maximum = remaining disk space # # SWAP: # # 2 GiB # # Example on a 32 GiB disk: # # BIOS Boot 1 MiB # EFI 538 MiB # swap 2 GiB # / ~29 GiB ############################################################################### d-i partman-auto/expert_recipe string \ aamsveen-uefi :: \ 1 1 1 biosgrub \ $iflabel{ gpt } \ $primary{ } \ method{ biosgrub } \ . \ 538 538 538 fat32 \ $iflabel{ gpt } \ $primary{ } \ $bootable{ } \ method{ efi } \ format{ } \ mountpoint{ /boot/efi } \ . \ 12288 30000 -1 ext4 \ $primary{ } \ method{ format } \ format{ } \ use_filesystem{ } \ filesystem{ ext4 } \ mountpoint{ / } \ . \ 2048 2048 2048 linux-swap \ $primary{ } \ method{ swap } \ format{ } \ . ############################################################################### # Select recipe ############################################################################### d-i partman-auto/choose_recipe select aamsveen-uefi ############################################################################### # Remove existing LVM / RAID configuration ############################################################################### d-i partman-lvm/device_remove_lvm boolean true d-i partman-md/device_remove_md boolean true ############################################################################### # Completely replace existing partition table ############################################################################### 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 ############################################################################### # Filesystem mounting ############################################################################### d-i partman/mount_style select uuid ############################################################################### # Bootloader # # The actual target disk is supplied dynamically by partman/early_command. ############################################################################### d-i grub-installer/only_debian boolean true d-i grub-installer/with_other_os boolean false d-i grub-installer/bootdev string default ############################################################################### # Third-party software / codecs ############################################################################### d-i ubiquity/use_nonfree boolean true ############################################################################### # Ubiquity ############################################################################### ubiquity ubiquity/summary note ubiquity ubiquity/confirm-partitioning boolean true ubiquity ubiquity/reboot boolean true ############################################################################### # Installation media ############################################################################### d-i cdrom-detect/eject boolean false ############################################################################### # Finish ############################################################################### d-i finish-install/reboot_in_progress note