am I missing something or why can't grub always be installed where it is directed to with manual partitioning + preseed?
I use a preseed file for xubuntu 20.04.2 desktop that is devoid of partitioning directives. when "automatic-ubiquity" is booted, after manually partitioning sda selecting /dev/sda1 is ignored and grub is installed into /dev/sda.
added d-i grub-installer/only_debian boolean false
and/or d-i grub-installer/with_other_os boolean false
to preseed. after manually partitioning sda selecting /dev/sda1 is ignored and grub is installed into /dev/sda.
I hacked a way to dynamically set d-i grub-installer/bootdev string default
but that requires booting into the live environment, partitioning the disk and setting the active partition first, then starting "ubiquity -‑automatic" or rebooting with "automatic-ubiquity".
d-i grub-installer/only_debian boolean false
d-i grub-installer/with_other_os boolean false
d-i grub-installer/bootdev string default
d-i partman/early_command string \
BOOTFLAG=$(lsblk -rpo PARTFLAGS,PKNAME,PATH | grep "0x80" | cut -f 3 -d ' '); \
if [ $BOOTFLAG ]; then debconf-set grub-installer/bootdev $BOOTFLAG; fi;
testing this works with a vm with a single disk, but may not work as desired on hardware with multiple disks or installing from usb.
d-i grub-installer/skip boolean true
seems ignored always. again I hacked a way to make that work, I set d-i grub-installer/bootdev string
leaving it empty. manually installing grub in ubiquity/success_command does not work though. inspecting the first few sectors of /dev/sda1, all are 00. the other command completes sucessfully.
d-i grub-installer/only_debian boolean false
d-i grub-installer/with_other_os boolean false
d-i grub-installer/bootdev string
ubiquity ubiquity/success_command string \
in-target grub-install -‑force /dev/sda1; \
echo "tmpfs /tmp tmpfs nosuid,nodev 0 0" >> /target/etc/fstab;