How to preseed installing grub to a device during installation without prompt?

I am trying to do a fully automated ubuntu preseed installation. I am stuck because I cannot preseed the answer to installing grub on a device other than /dev/sda without having to manually hit "enter" to continue the installation.

It says:

[!] Install Grub boot loader on a hard disk

And correctly selects the device I am attempting to install the boot loader onto, but it still requires me to manually hit enter.

You can see an image of it here:

http://i.imgur.com/lWvAHWV.png

I've tried various combinations of the following values in my preseed, all of them have the same end result:

# Option 1 (works when installing to /dev/sda. Prompts with sdm)
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true

# Option 2
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true
d-i grub-installer/bootdev  string /dev/sdm

# Option 3
d-i grub-installer/only_debian boolean false
d-i grub-installer/with_other_os boolean false
d-i grub-installer/bootdev  string /dev/sdm

# Option 2
d-i grub-installer/only_debian boolean true
d-i grub-installer/with_other_os boolean true
d-i grub-installer/bootdev  string /dev/sdm

I've also tried adding the following:
d-i grub-pc/install_devices multiselect /dev/sdm

Regardless of these settings I get the prompt.

I turned on the logs to verbose during installation. The logs show this when I am stopped with the prompt:

Dec  9 07:30:35 debconf: --> SET grub-installer/bootdev /dev/sdm
Dec  9 07:30:35 debconf: <-- 0 value set
Dec  9 07:30:35 debconf: --> PROGRESS STEP 1
Dec  9 07:30:35 debconf: <-- 0 OK
Dec  9 07:30:35 debconf: --> PROGRESS INFO grub-installer/progress/step_bootdev
Dec  9 07:30:35 debconf: <-- 0 OK
Dec  9 07:30:35 debconf: --> INPUT critical grub-installer/bootdev
Dec  9 07:30:35 debconf: <-- 0 question will be asked
Dec  9 07:30:35 debconf: --> GO

If I hit enter and the installations continues, it goes on to this:

Dec  9 07:30:35 debconf: --> SET grub-installer/bootdev /dev/sdm
Dec  9 07:30:35 debconf: <-- 0 value set
Dec  9 07:30:35 debconf: --> PROGRESS STEP 1
Dec  9 07:30:35 debconf: <-- 0 OK
Dec  9 07:30:35 debconf: --> PROGRESS INFO grub-installer/progress/step_bootdev
Dec  9 07:30:35 debconf: <-- 0 OK
Dec  9 07:30:35 debconf: --> INPUT critical grub-installer/bootdev
Dec  9 07:30:35 debconf: <-- 0 question will be asked
Dec  9 07:30:35 debconf: --> GO
Dec  9 07:37:20 debconf: <-- 0 ok
Dec  9 07:37:20 debconf: --> GET grub-installer/bootdev
Dec  9 07:37:20 debconf: <-- 0 /dev/sdm
Dec  9 07:37:20 debconf: --> PROGRESS STEP 1
Dec  9 07:37:20 debconf: <-- 0 OK
Dec  9 07:37:20 debconf: --> SUBST grub-installer/progress/step_install_loader BOOTDEV /dev/sdm
Dec  9 07:37:20 debconf: Adding [BOOTDEV] -> [/dev/sdm]
Dec  9 07:37:20 debconf: <-- 0
Dec  9 07:37:20 debconf: --> PROGRESS INFO grub-installer/progress/step_install_loader
Dec  9 07:37:20 debconf: <-- 0 OK
Dec  9 07:37:20 grub-installer: info: Installing grub on '/dev/sdm'
Dec  9 07:37:20 grub-installer: info: grub-install supports --no-floppy
Dec  9 07:37:20 grub-installer: info: Running chroot /target grub-install  --no-floppy --force "/dev/sdm"
Dec  9 07:37:22 grub-installer: Installation finished. No error reported.
Dec  9 07:37:22 grub-installer: info: grub-install ran successfully
...

It's not clear to me exactly what the prompt is. Is it this?

Dec  9 07:37:20 debconf: <-- 0 ok

If that's the case, how do I input an "ok"?

Any help is greatly appreciated.


Solution 1:

Higher up in your preseed file, this line should appear:

d-i debconf/priority string critical

This should ensure that only 'critical' questions are asked

This line alone seems sufficient to provide enough info for the bootloader to be put on /dev/sda;

alter to suit your needs

d-i grub-installer/bootdev string /dev/sda

As for your other question, the line <-- 0 ok is merely a return value (success); you can ignore it.

Hope this helps.