geerlingguy / packer-boxes

Jeff Geerling's Packer build configurations for Vagrant boxes.

Home Page:https://app.vagrantup.com/geerlingguy

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Missing value for auto in boot_commands.

BlessJah opened this issue · comments

Replacing auto with auto=true in following places would allow for much shorter boot_command. Parameters related to locale, network and keyboard could be specified in preseed. Short boot_command is IMO desirable.

https://github.com/geerlingguy/packer-ubuntu-1604/blob/0685b365403ce9001855c3b962745aa0dae27b13/ubuntu1604.json#L33

https://github.com/geerlingguy/packer-ubuntu-1604/blob/0685b365403ce9001855c3b962745aa0dae27b13/ubuntu1604.json#L95

Furthermore mode in which boot_command is entered have kernel already specified, thus /install/vmlinuz typed is completely ignored. Prefixing arguments with kernel would be correct for boot:-style prompt (entered with <esc><esc><enter>), however this prompt doesn't seem to work on ubuntu installer iso.

The Ubuntu documentation in that matter is quite confusing (https://help.ubuntu.com/lts/installation-guide/armhf/apbs02.html):

B.2.3. Auto mode
This is enabled by using the Automated install boot choice, also called auto for some architectures or boot methods. In this section, auto is thus not a parameter, it means selecting that boot choice, and appending the following boot parameters on the boot prompt.

B.2.4. Aliases useful with preseeding
The following aliases can be useful when using (auto mode) preseeding. Note that these are simply short aliases for question names, and you always need to specify a value as well: for example, auto=true or interface=eth0.
...
auto auto-install/enable

Here, minimal config that pulls preseed without any manual interaction.

"boot_command": [
  "<esc><f6><wait><esc>",
  "<bs><bs><bs><bs><bs><bs><bs><bs><bs><bs>",
  [repeated 7 times]
  "<bs><bs><bs>",
  " preseed/url=http://{{ .HTTPIP }}:{{ .HTTPPort }}/preseed.cfg",
  " initrd=/install/initrd.gz",
  " auto-install/enable=true",
  " debconf/priority=critical",
  "<enter>"
]

I don't think it will get any smaller. Required changes are auto=true to postpone keyboard/locale until after preseed and prioriy=critical to supress geth_ostname or `get_domain if they were not provided by dhcp.

I originally based the build here off what Chef's bento (https://github.com/chef/bento) project uses... what are some of the downsides to using auto instead of specifying things individually? I agree that Ubuntu's docs are fairly obtuse.

And I'm all for making for a faster/more compact boot command, as long as it builds a working box!

I am not aware of any downsides of auto=true priority=critical. There is only minor inconvenience making it bit harder to write/verify preseed, since questions are not asked during installation process.

Here you can test changes yourself (you'll need to hit enter once boot_command is typed): master...BlessJah:shorten-boot-command

Example of what I've referred by boot:-style prompt:
https://github.com/chef/bento/blob/master/debian/debian-9.3-amd64.json#L6

Closing all older issues as I've consolidated all my Packer boxes into this project, and renamed the project. See #45