Working in bootmenu
This commit is contained in:
1 parent
ec38927eff
commit
27fbde2a76
3 files changed
+2726
-43
No files matched your search
+126
-43
@@ -6,20 +6,35 @@
|
||||
# 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
|
||||
###############################################################################
|
||||
@@ -29,12 +44,14 @@ 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
|
||||
###############################################################################
|
||||
@@ -42,6 +59,7 @@ d-i netcfg/choose_interface select auto
|
||||
d-i clock-setup/utc boolean true
|
||||
d-i time/zone string Europe/Amsterdam
|
||||
|
||||
|
||||
###############################################################################
|
||||
# User
|
||||
###############################################################################
|
||||
@@ -51,6 +69,7 @@ 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
|
||||
###############################################################################
|
||||
@@ -58,33 +77,60 @@ d-i passwd/user-password-again password @)av-admin@^
|
||||
d-i netcfg/get_hostname string audio-kiosk
|
||||
d-i netcfg/get_domain string
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Partitioning
|
||||
# Partitioning method
|
||||
###############################################################################
|
||||
|
||||
d-i partman-auto/method string regular
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Dynamically determine the installation disk.
|
||||
# Dynamic installation-disk selection
|
||||
#
|
||||
# list-devices usb-partition identifies partitions belonging to USB devices.
|
||||
# Their parent disks are excluded.
|
||||
# This runs immediately before partman starts.
|
||||
#
|
||||
# We then select the first non-removable disk.
|
||||
# The installer USB media is deliberately excluded.
|
||||
#
|
||||
# IMPORTANT:
|
||||
# We:
|
||||
#
|
||||
# There is deliberately NO hard-coded /dev/sda fallback.
|
||||
# If no safe target can be identified, installation stops instead of
|
||||
# accidentally overwriting the USB installer.
|
||||
# 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 \
|
||||
USB_PARENT="$(lsblk -ndo PKNAME "$USB_PART" 2>/dev/null || true)"; \
|
||||
if [ -n "$USB_PARENT" ]; then \
|
||||
USB_DISKS="$USB_DISKS /dev/$USB_PARENT"; \
|
||||
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=""; \
|
||||
@@ -106,48 +152,74 @@ d-i partman/early_command string \
|
||||
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 "Aamsveen installer ERROR: no safe internal target disk found" \
|
||||
> /var/log/aamsveen-partition.log; \
|
||||
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 "Aamsveen installer: USB disks = $USB_DISKS" \
|
||||
> /var/log/aamsveen-partition.log; \
|
||||
echo "Aamsveen installer: TARGET disk = $TARGET_DISK" \
|
||||
>> /var/log/aamsveen-partition.log; \
|
||||
lsblk -e7 -o NAME,PATH,TYPE,SIZE,RM,RO,TRAN,FSTYPE,MOUNTPOINTS \
|
||||
>> /var/log/aamsveen-partition.log 2>&1
|
||||
echo "partman-auto/disk = $TARGET_DISK" >> "$LOG"; \
|
||||
echo "grub-installer/bootdev = $TARGET_DISK" >> "$LOG"
|
||||
|
||||
|
||||
###############################################################################
|
||||
# GPT
|
||||
# GPT partition table
|
||||
###############################################################################
|
||||
|
||||
d-i partman-partitioning/default_label string gpt
|
||||
d-i partman-partitioning/choose_label select gpt
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Explicit UEFI partition recipe
|
||||
# Partition recipe
|
||||
#
|
||||
# 512 MiB EFI System Partition
|
||||
# remainder root filesystem
|
||||
# 2 GiB swap
|
||||
# BIOS BOOT:
|
||||
#
|
||||
# No separate /boot partition is created.
|
||||
# This deliberately keeps the partition layout simple.
|
||||
# 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{ } \
|
||||
$reusemethod{ } \
|
||||
$bootable{ } \
|
||||
method{ efi } \
|
||||
format{ } \
|
||||
mountpoint{ /boot/efi } \
|
||||
. \
|
||||
8192 8192 -1 ext4 \
|
||||
12288 30000 -1 ext4 \
|
||||
$primary{ } \
|
||||
method{ format } \
|
||||
format{ } \
|
||||
@@ -157,22 +229,28 @@ d-i partman-auto/expert_recipe string \
|
||||
. \
|
||||
2048 2048 2048 linux-swap \
|
||||
$primary{ } \
|
||||
$reusemethod{ } \
|
||||
method{ swap } \
|
||||
format{ } \
|
||||
.
|
||||
|
||||
d-i partman-auto/choose_recipe select aamsveen-uefi
|
||||
|
||||
###############################################################################
|
||||
# Remove existing storage configuration
|
||||
# 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
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Do not preserve old partitions
|
||||
# Completely replace existing partition table
|
||||
###############################################################################
|
||||
|
||||
d-i partman-partitioning/confirm_write_new_label boolean true
|
||||
@@ -180,42 +258,47 @@ d-i partman/choose_partition select finish
|
||||
d-i partman/confirm boolean true
|
||||
d-i partman/confirm_nooverwrite boolean true
|
||||
|
||||
###############################################################################
|
||||
# UEFI
|
||||
###############################################################################
|
||||
|
||||
d-i partman-efi/non_efi_system boolean true
|
||||
|
||||
###############################################################################
|
||||
# Filesystem
|
||||
# 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
|
||||
|
||||
# The exact disk is supplied dynamically by partman/early_command.
|
||||
d-i grub-installer/bootdev string default
|
||||
|
||||
###############################################################################
|
||||
# Third-party software / codecs
|
||||
###############################################################################
|
||||
|
||||
d-i ubiquity/use_nonfree boolean true
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Ubiquity
|
||||
###############################################################################
|
||||
|
||||
ubiquity ubiquity/summary string
|
||||
ubiquity ubiquity/summary note
|
||||
ubiquity ubiquity/confirm-partitioning boolean true
|
||||
ubiquity ubiquity/reboot boolean true
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Installation behaviour
|
||||
# Installation media
|
||||
###############################################################################
|
||||
|
||||
d-i cdrom-detect/eject boolean false
|
||||
|
||||
|
||||
###############################################################################
|
||||
# Finish
|
||||
###############################################################################
|
||||
|
||||
Reference in new issue
Block a user