Skip to content

install to-filesystem silently drops --karg on the composefs BLS path #2304

Closed

Description

@andrewdunndev

What I'm seeing

I passed --karg console=ttyS0,115200 to bootc install to-filesystem --composefs-backend --bootloader=systemd. The install completes cleanly, but the written Boot Loader Specification (BLS) entry carries no trace of the karg. There's no warning; the machine just comes up without the argument. The identical flag lands correctly via install to-disk, with and without --composefs-backend. Reproduced 3/3 on bootc 1.16.3 (Fedora 44).

The written entry (loader/entries/bootc_fedora-44-1.conf, which the composefs backend places on the ESP):

title Fedora Linux 44 (Forty Four)
version 44
linux /EFI/Linux/bootc_composefs-4fa664fc.../vmlinuz
initrd /EFI/Linux/bootc_composefs-4fa664fc.../initrd
options root=UUID=5ebfe70b-... rw boot=UUID=25f24bf6-... composefs=4fa664fc... systemd.mount-extra=UUID=25f24bf6-...:/boot:auto:ro
sort-key bootc-fedora-0

No console=ttyS0,115200 anywhere. For kargs like console= or LUKS parameters this is a silent boot-behavior change rather than a visible failure, which is why I'm filing it as a bug rather than a docs gap. The install docs also describe to-disk as effectively invoking to-filesystem --karg=root=UUID=..., and show --karg console=ttyS0,115200 as the serial-console example for Type 1 BLS setups (docs/src/bootc-install.md), so I've been reading --karg on to-filesystem as a supported interface.

Reproduction

truncate -s 20G disk.raw
loop=$(sudo losetup -fP --show disk.raw)
sudo sgdisk -n 1:0:+512M -t 1:ef00 -n 2:0:+512M -t 2:8300 -n 3:0:0 -t 3:8300 $loop
sudo mkfs.vfat ${loop}p1 && sudo mkfs.ext4 ${loop}p2 && sudo mkfs.ext4 -O verity ${loop}p3
sudo mkdir -p /mnt/tgt && sudo mount ${loop}p3 /mnt/tgt
sudo mkdir -p /mnt/tgt/boot && sudo mount ${loop}p2 /mnt/tgt/boot
sudo mkdir -p /mnt/tgt/boot/efi && sudo mount ${loop}p1 /mnt/tgt/boot/efi

sudo podman run --rm --privileged --pid=host \
  -v /var/lib/containers:/var/lib/containers -v /dev:/dev \
  -v /mnt/tgt:/target --security-opt label=type:unconfined_t \
  <image with bootc 1.16.3, systemd-boot-unsigned installed> \
  bootc install to-filesystem --skip-fetch-check --generic-image \
    --composefs-backend --bootloader=systemd \
    --karg console=ttyS0,115200 /target

# then inspect the ESP:
sudo cat /mnt/tgt/boot/efi/loader/entries/bootc_fedora-44-1.conf

Where I think the plumbing diverges (v1.16.3; same on main)

I went looking for where the karg goes missing. What I found:

Between v1.16.3 and current main the only commit touching these files is the linux-kernel-cmdline crate rename, so I believe the shape is unchanged on main.

Possible fix

Two resolutions would both fit patterns already in the codebase, and I'm happy to send a PR for whichever matches your intent:

  1. Thread the kargs: fold state.config_opts.karg into the kargs vector in install_to_filesystem just before the RootSetup construction, mirroring what baseline.rs does for to-disk. That fixes the composefs BLS path and removes the asymmetry without touching setup_composefs_bls_boot or install_container (the ostree path's re-read stays harmless: Cmdline::add skips exact-match duplicates, and to-disk already lives with that same double-read today).
  2. Reject loudly: if kargs on this path are meant to come from kargs.d only, error out the way the UKI path already does (require_no_kargs_for_uki: "Cannot use externally specified kernel arguments with UKI"), so the drop is at least not silent.

Which way matches the intent for the BLS path?

Activity

  1. added a commit that references this issue on Jul 10, 2026
    c60b918
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions