GRUB_CMDLINE_LINUX_DEFAULT keeps boot parameters from installer

Bug #1956452 reported by Francois Lafont
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
subiquity
New
Undecided
Unassigned

Bug Description

Hi,

I use ubuntu-20.04.3-live-server-amd64.iso from https://releases.ubuntu.com/20.04/ (sha256sum=8e3086f3cea0fb3fefb29937ab5ed9d19e767079633960ccb50e76153effc98) to make an automatic install of Ubuntu 20.04. Here is my user-data file:

```yaml
#cloud-config
autoinstall:
  version: 1
  locale: en_US.UTF-8
  keyboard:
    layout: fr
    variant: ""
  apt:
    preserve_sources_list: false
    primary:
      - arches: [amd64]
        uri: "http://archive.ubuntu.com/ubuntu"
    disable_suites: [backports]
    # Unfortunately, disable_components option is too recent to be supported
    # on Ubuntu 20.04.
    #
    # See: https://github.com/canonical/curtin/commit/02037187c142b41f9e993eefde615794827fd271
    #
    disable_components: [multiverse]
    geoip: false
  update: no # better to update during postinstall stage.
  packages: []
  network:
    network:
      version: 2
      ethernets:
        nics:
          match:
            name: 'ens*'
          dhcp4: true
  storage:
    swap:
      size: 0 # No swap, will created (or not) by cloud-init.
    config:
      - id: disk-root
        type: disk
        ptable: gpt
        path: /dev/sda
        wipe: superblock
        preserve: false
        grub_device: true
        name: disk-root
      - id: part-grub
        type: partition
        number: 1
        device: disk-root
        size: 1MB
        wipe: superblock
        preserve: false
        flag: bios_grub
        name: part-grub
      - id: part-root
        type: partition
        number: 2
        device: disk-root
        size: -1 # The remaining space.
        wipe: superblock
        preserve: false
        name: part-root
      - id: fs-root
        type: format
        fstype: ext4
        preserve: false
        extra_options: ["-E", "lazy_itable_init=0"]
        volume: part-root
        label: fs-root
      - id: mount-root
        type: mount
        spec: "LABEL=fs-root"
        path: /
        device: fs-root
        options: "noatime,errors=remount-ro"
    # Without this setting, the default value is true according to my research
    # and the option GRUB_CMDLINE_LINUX_DEFAULT in the config file /etc/default/grub
    # is set to the same boot options as the installer, ie something like
    # "autoinstall ds=nocloud-net;seedfrom=http://..." in my case.
    #grub:
    # replace_linux_default: false
  ssh:
    install-server: yes
  identity:
    username: ubuntu
    password: $6$b3fc746099763fbf$ooDi.9kU5tJbcHQCX.d2xuxWumgWzPZb9y7WMMmP6bLPPl3mosDlRXs5zpNtACCCx4gfoSzHL.eEACeS7U/M31
    hostname: template-ubuntu-20-04-all-in-one
  user-data:
    timezone: "Europe/Paris"
    hostname: template-ubuntu-20-04-all-in-one
```

After the installation, the machine has this line in the file /etc/default/grub:

```
GRUB_CMDLINE_LINUX_DEFAULT="autoinstall ds=nocloud-net;seedfrom=http://192.168.221.149:8449/"
```

This is exactly the boot parameters I use during the installation (via packer). To avoid this and keep the default value of GRUB_CMDLINE_LINUX_DEFAULT in /etc/default/grub (ie ="quiet splash"), I have to uncomment these lines in my user-data:

```
    grub:
      replace_linux_default: false
```

In this case, I have `GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"` after the installation, the default value, and the expected value to me.

Is it normal?
Regards.

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Curtin copies kernel command line arguments after --- to the installed system. So if you put the "autoinstall ds=nocloud-net;seedfrom=http://192.168.221.149:8449/" content before the --- then it should not be configured for the installed system. What is the complete command line you are passing to packer?

Revision history for this message
Michael Hudson-Doyle (mwhudson) wrote :

Oh looking at the source a bit, I think maybe the entire command line gets copied over if there is no --- present. So maybe just add " ---" to the end of the command line you are using?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.