Handle UEFI runtime service SetVariable() not available decently

Bug #1965288 reported by Heinrich Schuchardt
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

On system conforming to the Embedded Base Boot Requirements (EBBR) specification it is allowable that the UEFI runtime service SetVariable() is not available. This means that the BOOTXXXX variable for invoking GRUB cannot be set automatically. Instead this has to be left to the user.

        Traceback (most recent call last):
          File "/snap/subiquity/x1/lib/python3.8/site-packages/curtin/commands/main.py", line 202, in main
            ret = args.func(args)
          File "/snap/subiquity/x1/lib/python3.8/site-packages/curtin/commands/curthooks.py", line 1886, in curthooks
            builtin_curthooks(cfg, target, state)
          File "/snap/subiquity/x1/lib/python3.8/site-packages/curtin/commands/curthooks.py", line 1851, in builtin_curthooks
            setup_grub(cfg, target, osfamily=osfamily,
          File "/snap/subiquity/x1/lib/python3.8/site-packages/curtin/commands/curthooks.py", line 804, in setup_grub
            install_grub(instdevs, target, uefi=uefi_bootable, grubcfg=grubcfg)
          File "/snap/subiquity/x1/lib/python3.8/site-packages/curtin/commands/install_grub.py", line 401, in install_grub
            in_chroot.subp(cmd, env=env, capture=True)
          File "/snap/subiquity/x1/lib/python3.8/site-packages/curtin/util.py", line 780, in subp
            return subp(*args, **kwargs)
          File "/snap/subiquity/x1/lib/python3.8/site-packages/curtin/util.py", line 275, in subp
            return _subp(*args, **kwargs)
          File "/snap/subiquity/x1/lib/python3.8/site-packages/curtin/util.py", line 139, in _subp
            raise ProcessExecutionError(stdout=out, stderr=err,
        curtin.util.ProcessExecutionError: Unexpected error while running command.
        Command: ['unshare', '--fork', '--pid', '--', 'chroot', '/target', '/usr/lib/grub/grub-multi-install']
        Exit code: 1
        Reason: -
        Stdout: ''
        Stderr: Installing grub to /boot/efi.
                Installing for riscv64-efi platform.
                grub-install: warning: Cannot set EFI variable Boot0000.
                grub-install: warning: efivarfs_set_variable: failed to create /sys/firmware/efi/efivars/Boot0000-8be4df61-93ca-11d2-aa0d-00e098032b8c for writing: Read-only file system.
                grub-install: warning: _efi_set_variable_mode: ops->set_variable() failed: Read-only file system.
                grub-install: error: failed to register the EFI boot entry: Read-only file system.

        Unexpected error while running command.
        Command: ['unshare', '--fork', '--pid', '--', 'chroot', '/target', '/usr/lib/grub/grub-multi-install']
        Exit code: 1
        Reason: -
        Stdout: ''
        Stderr: Installing grub to /boot/efi.
                Installing for riscv64-efi platform.
                grub-install: warning: Cannot set EFI variable Boot0000.
                grub-install: warning: efivarfs_set_variable: failed to create /sys/firmware/efi/efivars/Boot0000-8be4df61-93ca-11d2-aa0d-00e098032b8c for writing: Read-only file system.
                grub-install: warning: _efi_set_variable_mode: ops->set_variable() failed: Read-only file system.
                grub-install: error: failed to register the EFI boot entry: Read-only file system.

Related branches

Revision history for this message
Heinrich Schuchardt (xypron) wrote :
description: updated
tags: added: riscv64
tags: added: fr-2123
Changed in grub2 (Ubuntu):
status: New → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package grub2 - 2.06-2ubuntu6

---------------
grub2 (2.06-2ubuntu6) jammy; urgency=medium

  [ Heinrich Schuchardt ]
  * efivar: check that efivarfs is writeable (LP: #1965288)

  [ Dimitri John Ledkov ]
  * Do not validate kernels twice. (LP: #1964943)

  [ Heinrich Schuchardt ]
  * efi: EFI Device Tree Fixup Protocol (LP: #1965796)
  * fdt: add debug output to devicetree command

 -- Julian Andres Klode <email address hidden> Fri, 25 Mar 2022 16:03:11 +0100

Changed in grub2 (Ubuntu):
status: Fix Committed → Fix Released
Changed in curtin:
status: New → Fix Released
no longer affects: curtin
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.