diff --git a/autoinstall/build-iso.sh b/autoinstall/build-iso.sh index 68feab7..7ab0531 100644 --- a/autoinstall/build-iso.sh +++ b/autoinstall/build-iso.sh @@ -64,9 +64,11 @@ cp "$GRUB_CFG" "$GRUB_CFG.orig" sed -i "s/set timeout=.*/set timeout=5/" "$GRUB_CFG" sed -i "s/set timeout_style=.*/set timeout_style=countdown/" "$GRUB_CFG" -# Add autoinstall params to the first linux kernel line -# Note: semicolon must be backslash-escaped in GRUB or it's treated as command separator -sed -i "/^\s*linux.*vmlinuz/s/$/ autoinstall ds=nocloud\\;s=\/cdrom\/nocloud\//" "$GRUB_CFG" +# Add autoinstall params BEFORE the '---' separator on the kernel line. +# Anything after '---' in a GRUB linux line goes to init, not the kernel. +# So 'autoinstall' and 'ds=' must be inserted BEFORE '---'. +# Semicolon is backslash-escaped so GRUB doesn't treat it as a command separator. +sed -i "/^\s*linux.*vmlinuz/s/---/autoinstall ds=nocloud\\;s=\/cdrom\/nocloud\/ ---/" "$GRUB_CFG" echo "✓ GRUB patched" # ── Extract MBR and EFI partition from original ISO ────