Skip to content

bootctl install rc=1 without any error  #23485

Closed

Description

@nafets227

systemd version the issue has been seen with

251-1

Used distribution

Arch Linux

Linux kernel version used (uname -a)

Linux vWinSrv 5.17.9-arch1-1 #1 SMP PREEMPT Wed, 18 May 2022 17:30:11 +0000 x86_64 GNU/Linux

CPU architecture issue was seen on

x86-64

Expected behaviour you didn't see

rc=0

Unexpected behaviour you saw

rc=1

Steps to reproduce the problem

setup a new VM with empty /efi dir
call bootctl install --no-variables inside a chroot

Additional program output to the terminal or log subsystem illustrating the issue

The first call ends with a bad return code, while the second once succeeds with rc=0

++ arch-chroot /tmp/inst-arch.Xd0IooHqeE bootctl install --no-variables
Created "/efi/EFI".
Created "/efi/EFI/systemd".
Created "/efi/EFI/BOOT".
Created "/efi/loader".
Created "/efi/loader/entries".
Created "/efi/EFI/Linux".
Copied "/usr/lib/systemd/boot/efi/systemd-bootx64.efi" to "/efi/EFI/systemd/systemd-bootx64.efi".
Copied "/usr/lib/systemd/boot/efi/systemd-bootx64.efi" to "/efi/EFI/BOOT/BOOTX64.EFI".
Random seed file /efi/loader/random-seed successfully written (512 bytes).
++ arch-chroot /tmp/inst-arch.Xd0IooHqeE bootctl install --no-variables
Copied "/usr/lib/systemd/boot/efi/systemd-bootx64.efi" to "/efi/EFI/systemd/systemd-bootx64.efi".
Copied "/usr/lib/systemd/boot/efi/systemd-bootx64.efi" to "/efi/EFI/BOOT/BOOTX64.EFI".
Random seed file /efi/loader/random-seed successfully written (512 bytes).

Activity

  1. bluca commented on May 23, 2022

    @bluca
    Member

    We are seeing this in the mkosi CI job - it was working fine till two days ago, and then it suddenly errors out. It doesn't look like anything that was merged here triggered it.

  2. nafets227 commented on May 23, 2022

    @nafets227
    ContributorAuthor

    I'll try to verify against downgraded systems and let you know.

  3. AdrianVovk commented on May 24, 2022

    @AdrianVovk
    Contributor

    I've experienced this also in carbonOS with v251, so it's not just an arch issue.

    I've looked at the code and I think I might have a theory what's going on with the v251 branch:

    • install_loader_specification returns 1 on success
    • this means that r=1 in verb_install
    • arg_touch_variables is false, so install_variables never executes and so still r=1
    • verb_install returns r, so it returns 1
    • I assume dispatch_verb will pass the return value all the way up through main
    • bootctl exits with 1, indicating failure

    Can't say anything about the main branch... looks like the issue was fixed there already with 6e91653

  4. behrmann commented on May 24, 2022

    @behrmann
    Member

    from systemd/mkosi#988: Running this with SYSTEMD_LOG_LEVEL=debug gives

    Found container virtualization systemd-nspawn.
    Using EFI System Partition at /efi.
    Directory "/boot" is not the root of the file system.
    Didn't find an XBOOTLDR partition, using the ESP as $BOOT.
    Loaded machine ID <machine id> from /etc/machine-id.
    Using entry token: <machine id>
    Copied "/usr/lib/systemd/boot/efi/systemd-bootx64.efi" to "/efi/EFI/systemd/systemd-bootx64.efi".
    Copied "/usr/lib/systemd/boot/efi/systemd-bootx64.efi" to "/efi/EFI/BOOT/BOOTX64.EFI".
    Failed to use O_TMPFILE for /efi/loader/loader.conf: Operation not supported
    Random seed file /efi/loader/random-seed successfully written (512 bytes).
    Failed to use O_TMPFILE for /efi/loader/entries.srel: Operation not supported
    

    In the end the line comes from open_tmpfile_linkable (via fopen_tmpfile_linkable), called in install_loader_config and install_loader_specification. The open_tmpfile_linkable code is unchanged since 2018, but the latter two functions were last touched in March.

  5. daandemeyer commented on May 24, 2022

    @daandemeyer
    Collaborator

    Bug in the new release, fix is already in systemd-stable. Should get released soonish

  6. bluca commented on May 24, 2022

    @bluca
    Member

    v251.1 was released with a fix for this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions