Skip to content

Force install efi variables #35005

@KyleSebion

Description

@KyleSebion

Component

bootctl, systemd-boot, systemd-nspawn

Is your feature request related to a problem? Please describe

Installing systemd-boot inside systemd-nspawn doesn't add an efi boot entry. I may be using systemd-nspawn in a way that isn't intended though.

Describe the solution you'd like

It'd be great if there was an option to force the install of the efi boot entry when installing systemd-boot inside systemd-nspawn.

Describe alternatives you've considered

I determined a workaround that causes bootctl install to install the efi boot entry:

systemd-nspawn --bind /dev/vda --bind /dev/vda1 --bind /sys/firmware/efi -PD /mnt /bin/bash -x << 'CEOF'
d="$(mktemp -d)"
b=(/run/host /proc/1 /sys/fs/cgroup)
for m in "${b[@]}"; do mount -B "$d" "$m"; done
bootctl install
for m in "${b[@]}"; do umount "$m"; done
rmdir "$d"
CEOF

I think this allows bootctl to get past if (detect_container() > 0) in is_efi_boot() in install_variables.

The systemd version you checked that didn't have the feature you are asking for

No response

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