limine-snapper.sh: skip harvest dance when /etc/default/limine is pre-populated

The ISO orchestrator now writes /etc/default/limine directly from the
install config (with the real cmdline already substituted) before the
chroot phase runs. The previous unconditional find+harvest+copy+sed
sequence would (a) find our orchestrator-staged /boot/limine.conf which
has no `cmdline:` line and (b) exit 1 on "failed to extract kernel
cmdline".

Skip the harvest entirely when /etc/default/limine already exists
without the @@CMDLINE@@ placeholder. Parse CMDLINE from the existing
file so the downstream cryptdevice= validation still has it to compare.

The harvest path remains as a fallback for online reinstalls and any
flow where /etc/default/limine wasn't pre-populated by the orchestrator.
This commit is contained in:
Ryan Hughes
2026-06-04 18:34:35 -04:00
parent 9800b5b73b
commit e9aa8835ee
+11 -1
View File
@@ -9,7 +9,16 @@ EOF
# Detect boot mode # Detect boot mode
[[ -d /sys/firmware/efi ]] && EFI=true [[ -d /sys/firmware/efi ]] && EFI=true
# Find config location # If /etc/default/limine is already populated with a real cmdline (the ISO
# orchestrator pre-writes it from the live install config), skip the
# find+harvest+template-copy dance — we already have what we need. The
# harvest path stays as a fallback for online reinstalls and any flow where
# /etc/default/limine wasn't pre-populated.
if [[ -f /etc/default/limine ]] && ! grep -q "@@CMDLINE@@" /etc/default/limine; then
CMDLINE=$(grep '^KERNEL_CMDLINE\[default\]+=' /etc/default/limine | head -1 |
sed 's|^KERNEL_CMDLINE\[default\]+="||; s|"$||')
else
# Find config location written by archinstall (legacy harvest path)
if [[ -f /boot/EFI/arch-limine/limine.conf ]]; then if [[ -f /boot/EFI/arch-limine/limine.conf ]]; then
limine_config="/boot/EFI/arch-limine/limine.conf" limine_config="/boot/EFI/arch-limine/limine.conf"
elif [[ -f /boot/EFI/BOOT/limine.conf ]]; then elif [[ -f /boot/EFI/BOOT/limine.conf ]]; then
@@ -38,6 +47,7 @@ EOF
sudo cp $OMARCHY_PATH/default/limine/default.conf /etc/default/limine sudo cp $OMARCHY_PATH/default/limine/default.conf /etc/default/limine
sudo sed -i "s|@@CMDLINE@@|$CMDLINE|g" /etc/default/limine sudo sed -i "s|@@CMDLINE@@|$CMDLINE|g" /etc/default/limine
fi
# Append any drop-in kernel cmdline configs (from hardware fix scripts, etc.) # Append any drop-in kernel cmdline configs (from hardware fix scripts, etc.)
for dropin in /etc/limine-entry-tool.d/*.conf; do for dropin in /etc/limine-entry-tool.d/*.conf; do