Score:0

Ubuntu 20.04.3 Server autoinstall user-data does bootorder efibootmgr not change

in flag

Actually I have an issue by running Ubuntu 20.04 Server, if we customize the user-data file, I'm getting only the prompt by installation Ubuntu 20.04.

Case:

We would like to build an Ubuntu 20.04 image with Packer for qemu vm. The std. configuration work fine, but if we changing something in the user-data file and restart the build again, we getting the installation prompt, which we must select user language etc.

Solution:

We would like to change the efibootmgr order, because our Installation running in looping, after successfully installation of ubuntu, booting the machine from iso and not from Disk. The Installation running again with errors. I´m Testing to edit the command by late_command or user-data -> runcmd section, but if i add the line, the ubuntu installer not found the user-data file and starting the installation with prompt.

My user-data File:

#cloud-config
autoinstall:
  version: 1
  early-commands:
    - systemctl stop ssh
  locale: en_US
  apt:
    geoip: true
  keyboard:
    layout: en
    variant: us
  network:
    network:
      version: 2
      ethernets:
        ens33:
          dhcp4: true
  storage:
    layout:
      name: lvm
  identity:
    hostname: ubuntu
    username: ubuntu
    # pass is ubuntu
    password: #########
  ssh:
    install-server: yes
    allow-pw: true
  packages:
    - vim
    - tmux
    - curl
  user-data:
    disable_root: false
  late-commands:
    - 'sed -i "s/dhcp4: true/&\n      dhcp-identifier: mac/" /target/etc/netplan/00-installer-config.yaml'
    - echo 'ubuntu ALL=(ALL) NOPASSWD:ALL' > /target/etc/sudoers.d/ubuntu
    - echo 'test123' > /target/root/test.txt

If I add - curtin in-target --target=/target -- efibootmgr -o 0007 by late-commands the user data not be found by installer

If I add under user-data section the runcmd [efibootmgr -o 0007] not be found by installer

Have you some ideas? If you need any more information, please ask me.

Score:0
jp flag

By default, curtin "Reorders the UEFI BootOrder to place BootCurrent first". This is why the ISO is booting and you get stuck in a loop. This is also an issue with PXE installs.

A configuration option reorder_uefi was added to curtin that can disable this. You can add it to the autoinstall file and it will be passed to curtin. However, you can not use the layout option under storage if you want to use the reorder_uefi setting. When the layout option is used the other storage configuration is ignored.

I have used an autoinstall file like the following.

#cloud-config
autoinstall:
...
  storage:
    grub:
      reorder_uefi: False
    config:
    - {ptable: gpt, path: /dev/sda, preserve: false, name: '', grub_device: false, type: disk, id: disk-sda}
...

See Also

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.