[Bug 2085818] Re: Failure to deploy because of inability to set EFI variable

Rod Smith 2085818 at bugs.launchpad.net
Thu Nov 14 18:32:37 UTC 2024


The machine in question dates from 2022, according to my records. It's a
Gigabyte R242-P30-JG, which is an ARM64 server. As Stamatis relates, the
problem occurs with Ubuntu 24.04, but not with 22.04 or 20.04, so a full
NVRAM seems like an unlikely cause, unless something in 24.04 is causing
it to try to write more data to NVRAM than earlier releases do.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to grub2 in Ubuntu.
https://bugs.launchpad.net/bugs/2085818

Title:
  Failure to deploy because of inability to set EFI variable

Status in curtin:
  Incomplete
Status in MAAS:
  New
Status in grub2 package in Ubuntu:
  New

Bug description:
  $ snap info maas | grep installed
  installed:          3.5.1-16317-g.409891638                  (36889) 197MB held

  MAAS Host: 22.04 LXD VM

  
  Deploying tatanga, an ARM64 system in TOR-3, fails with the following messages in the installation output:

          Running command ['mount', '--make-private', '/tmp/tmp_6qzhgdl/target/sys/firmware/efi/efivars'] with allowed return codes [0] (capture=False)
          Running command ['umount', '/tmp/tmp_6qzhgdl/target/sys/firmware/efi/efivars'] with allowed return codes [0] (capture=False)
          Running command ['mount', '--make-private', '/tmp/tmp_6qzhgdl/target/sys'] with allowed return codes [0] (capture=False)
          Running command ['umount', '/tmp/tmp_6qzhgdl/target/sys'] with allowed return codes [0] (capture=False)
          Running command ['mount', '--make-private', '/tmp/tmp_6qzhgdl/target/run'] with allowed return codes [0] (capture=False)
          Running command ['umount', '/tmp/tmp_6qzhgdl/target/run'] with allowed return codes [0] (capture=False)
          Running command ['mount', '--make-private', '/tmp/tmp_6qzhgdl/target/proc'] with allowed return codes [0] (capture=False)
          Running command ['umount', '/tmp/tmp_6qzhgdl/target/proc'] with allowed return codes [0] (capture=False)
          Running command ['mount', '--make-private', '/tmp/tmp_6qzhgdl/target/dev'] with allowed return codes [0] (capture=False)
          Running command ['umount', '/tmp/tmp_6qzhgdl/target/dev'] with allowed return codes [0] (capture=False)
          finish: cmd-install/stage-curthooks/builtin/cmd-curthooks/install-grub: FAIL: installing grub to target devices
          finish: cmd-install/stage-curthooks/builtin/cmd-curthooks/configuring-bootloader: FAIL: configuring target system bootloader
          finish: cmd-install/stage-curthooks/builtin/cmd-curthooks: FAIL: curtin command curthooks
          Traceback (most recent call last):
            File "/curtin/curtin/commands/main.py", line 202, in main
              ret = args.func(args)
                    ^^^^^^^^^^^^^^^
            File "/curtin/curtin/commands/curthooks.py", line 1918, in curthooks
              builtin_curthooks(cfg, target, state)
            File "/curtin/curtin/commands/curthooks.py", line 1883, in builtin_curthooks
              setup_grub(cfg, target, osfamily=osfamily,
            File "/curtin/curtin/commands/curthooks.py", line 821, in setup_grub
              install_grub(instdevs, target, uefi=uefi_bootable, grubcfg=grubcfg)
            File "/curtin/curtin/commands/install_grub.py", line 444, in install_grub
              in_chroot.subp(cmd, env=env, capture=True)
            File "/curtin/curtin/util.py", line 792, in subp
              return subp(*args, **kwargs)
                     ^^^^^^^^^^^^^^^^^^^^^
            File "/curtin/curtin/util.py", line 280, in subp
              return _subp(*args, **kwargs)
                     ^^^^^^^^^^^^^^^^^^^^^^
            File "/curtin/curtin/util.py", line 144, in _subp
              raise ProcessExecutionError(stdout=out, stderr=err,
          curtin.util.ProcessExecutionError: Unexpected error while running command.
          Command: ['unshare', '--fork', '--pid', '--', 'chroot', '/tmp/tmp_6qzhgdl/target', '/usr/lib/grub/grub-multi-install']
          Exit code: 1
          Reason: -
          Stdout: ''
          Stderr: Installing grub to /boot/efi.
                  Installing for arm64-efi platform.
                  grub-install: warning: Cannot set EFI variable Boot0000.
                  grub-install: warning: efivarfs_set_variable: writing to fd 8 failed: Input/output error.
                  grub-install: warning: _efi_set_variable_mode: ops->set_variable() failed: Input/output error.
                  grub-install: error: failed to register the EFI boot entry: Input/output error.

          Unexpected error while running command.
          Command: ['unshare', '--fork', '--pid', '--', 'chroot', '/tmp/tmp_6qzhgdl/target', '/usr/lib/grub/grub-multi-install']
          Exit code: 1
          Reason: -
          Stdout: ''
          Stderr: Installing grub to /boot/efi.
                  Installing for arm64-efi platform.
                  grub-install: warning: Cannot set EFI variable Boot0000.
                  grub-install: warning: efivarfs_set_variable: writing to fd 8 failed: Input/output error.
                  grub-install: warning: _efi_set_variable_mode: ops->set_variable() failed: Input/output error.
                  grub-install: error: failed to register the EFI boot entry: Input/output error.

  Stderr: ''

  Using rescue mode, I was  able to create an EFI entry for the disk-
  based boot loader without problem:

  ubuntu at tatanga:~$ sudo efibootmgr -c -d /dev/nvme0n1 -p 1 -l \\EFI\\ubuntu\\shimaa64.efi -L "ubuntu"
  efibootmgr: ** Warning ** : Boot0007 has same label ubuntu
  BootCurrent: 0005
  Timeout: 5 seconds
  BootOrder: 0000,0005,0006,0001,0003,0004,0007
  Boot0001* UEFI: Built-in EFI Shell
  Boot0003  UEFI: PXE IPv4 Intel(R) Network 18:C0:4D:82:E0:C8
  Boot0004  UEFI: PXE IPv4 Intel(R) Network 18:C0:4D:82:E0:C9
  Boot0005* UEFI: PXE IPv4 Mellanox Network 0C:42:A1:52:2D:00
  Boot0006* UEFI: PXE IPv4 Mellanox Network 0C:42:A1:52:2D:01
  Boot0007  ubuntu
  Boot0000* ubuntu

  This was my second attempt to deploy the node; the first one failed
  with a message to the effect that it was unable to delete Boot0000
  (which was an "ubuntu" boot-to-disk entry). I used rescue mode to
  delete that entry without problem.

To manage notifications about this bug go to:
https://bugs.launchpad.net/curtin/+bug/2085818/+subscriptions




More information about the foundations-bugs mailing list