Commit graph

639 commits

Author SHA1 Message Date
jbtrystram
40c1b92fa3 overlay/disk-images: set root partition to 3 GiB
Instead of programatically estimating the size of the root partition
we hard-code the value in the partition table and add a test to
verify that we always have at least 25% free space available.

I tried to replicate COSA logic in [1] to estimate the required root
partition size but since we don't have the ostree commit during
the container build it's still a big guesstimate: we have to
account for the XFS block size and how each metadata file will eat a
full block.
So instead of a half-measure / half guess we use a full hardcoded
approach with an accompagnying test.

[1] https://github.com/coreos/fedora-coreos-config/pull/4259
2026-11-02 12:31:29 +01:00
jbtrystram
ed96fad3e9 overlay: add a switch to ignition-ostree-growfs
This add a kernel-argument switch to make ignition-ostree-growfs.service
a no-op. The main goal of this is to enable a test to control if we are
provisionning enough space on the root partition by default, but is
generally useful.
2026-11-02 12:31:29 +01:00
jbtrystram
c67227ffce Don't grow the root partition to use the whole available space 2026-11-02 12:31:29 +01:00
Renata Ravanelli
985f630fd7 coreos-warn-misplaced-network: Update warn message
- Update warn message for future installs instead

Signed-off-by: Renata Ravanelli <rravanel@redhat.com>
2026-10-30 19:32:09 -04:00
Renata Ravanelli
8c1bdaf369 coreos-rescue-misplaced-network: Add sentinel file for agent installer
- Check for the deliberate sentinel file. When
  present, the /boot placement was intentional
 (e.g.assisted-installer iSCSI flow) and
 we should not flag it as a misplaced config.

- This is a temporary workaround until a final
  solution for image replacement is in place.

See:
https://github.com/openshift/assisted-installer/pull/2501

Signed-off-by: Renata Ravanelli <rravanel@redhat.com>
2026-10-30 19:32:09 -04:00
Renata Ravanelli
8f5ca795b4 Fix OCPBUGS-132171: Race condition with coreos-rescue-misplaced-network
- The coreos-gpt-setup.service triggers sgdisk on firstboot to regenerate
the GPT disk GUID. This causes a transient partition table re-read that
momentarily removes the /dev/disk/by-label/boot symlink.
ignition-ostree-uuid-boot.service (tune2fs) does the same.

 - Because coreos-rescue-misplaced-network.service depends on
ConditionPathExists=/dev/disk/by-label/boot, it can accidentally be
skipped if the condition evaluates exactly while the symlink is missing.

 - Fix this by explicitly ordering the rescue service
Before=coreos-gpt-setup.service, so the condition is evaluated while
the symlink is still stable. Since coreos-gpt-setup already orders
before ignition-ostree-uuid-boot, so it covers both.

 - Also add Before=coreos-boot-edit.service to guarantee the network
config is copied before boot-edit removes /boot/coreos-firstboot-network.

Fixes: OCPBUGS-132171

Signed-off-by: Renata Ravanelli <rravanel@redhat.com>
2026-10-20 10:58:29 +02:00
Angel Cervera Roldan
1590d19721 coreos-issued.conf: create /run/issue.d with tmpfile
Use tmpfile rather than mkdir to create /run/issue.d, this way it will
be created with the correct SELinux labels
2026-10-19 11:40:39 +01:00
Angel Cervera Roldan
c979618431 coreos-enable-network: update paths
dracut 110 changed the hook directory structure[1,2], moving hooks from
/lib/dracut/hooks to /var/lib/dracut/hooks and introducing multi-location
discovery.

Update coreos-enable-network.sh to search different supported hook
locations.

See:
https://github.com/coreos/fedora-coreos-config/pull/4431#issuecomment-6042542836

[1] https://github.com/dracut-ng/dracut/pull/1752
[2] https://github.com/dracut-ng/dracut/pull/2187
2026-10-07 17:06:11 -04:00
Renata Ravanelli
7bed92f728 Add 11legacy-copy-network to handle legacy firstboot network config in /boot
- coreos-installer now embeds network config in the initramfs
   instead of writing to /boot/coreos-firstboot-network. When a
   system is provisioned with an older coreos-installer but boots
   a newer image, the network config is stranded in /boot and
   never applied — breaking network-dependent boot paths like iSCSI.

 - Add a three-layer backward compatibility mechanism:

   1. Initramfs rescue service (coreos-rescue-misplaced-network):
      if no config exists in /etc/coreos-firstboot-network, mount
      /boot and copy any legacy config found there so that the
      existing coreos-copy-firstboot-network.service can apply it.
      This is the active fix — it recovers the stranded config and
      allows boot to succeed.

   2. Dracut emergency hook (coreos-warn-misplaced-network.sh):
      on iSCSI systems, /boot lives on a network device — but the
      network config needed to reach it is stranded inside /boot
      itself, so the rescue service cannot help. When this
      chicken-and-egg problem causes the system to drop to an
      emergency shell, this hook explains the situation and advises
      re-installing with a newer coreos-installer.

   3. Real-root warning service (coreos-warn-misplaced-network):
      runs after boot has already succeeded (thanks to the rescue
      service above). It does not fix anything — it warns
      that legacy config was found in /boot, prompting
      the user to re-install with a newer coreos-installer so
      future boots do not depend on the rescue path. If /boot is
      not mounted at all, it warns that this may itself be a
      symptom of missing network config.

 - We may drop it in the feature, since there is a
cost of keeping checking it

 - See https://github.com/coreos/coreos-installer/issues/1758

Signed-off-by: Renata Ravanelli <rravanel@redhat.com>
2026-09-30 12:04:47 -03:00
Renata Ravanelli
247353aa55 coreos-network: drop obsole dracut-initqueue.service
- Drop the Before=dracut-initqueue.service systemd
unit ordering workaround in coreos-copy-firstboot-network.service.

- This ordering constraint was marked as a
compatibility fallback requiring dracut 054+.
Since both RHCOS (dracut 107) and FCOS (dracut
108) are well past this threshold, the ordering is
no longer necessary.

Signed-off-by: Renata Ravanelli <rravanel@redhat.com>
2026-09-30 12:04:47 -03:00
Renata Ravanelli
2124fbfb03 copy-network: stop reading firstboot network config from
/boot

 - coreos-installer now writes network config files
directly to /etc/coreos-firstboot-network instead of /boot
(see coreos/coreos-installer#1765).

 - Remove the /boot mount and the live-vs-diskful from
coreos-copy-firstboot-network, and drop the boot-device
dependency from the systemd unit.

 - https://github.com/coreos/coreos-installer/issues/1758

Signed-off-by: Renata Ravanelli <rravanel@redhat.com>
2026-09-30 12:04:47 -03:00
Angel Cervera Roldan
90eeb04bfd rpm-ostreed: use env var rather than bind mounting
Rather than using a bind mount so that rpm-ostreed has the correct
containers policy, we can use the CONTAINERS_POLICY_JSON environment
variable.
2026-09-30 09:01:57 -04:00
Dusty Mabe
2893894b31 05core/coreos-liveiso-autologin-generator: support kmscon autologin
This is related to [1]. Needs [2] to land as well to work.

[1] https://github.com/coreos/fedora-coreos-tracker/issues/2086
[2] https://gitlab.com/fedora/bootc/base-images/-/merge_requests/775
2026-09-26 17:09:50 -04:00
jbtrystram
d6f95465e3 overlay: write issues to /run
Since util-linux 2.41[1] agetty will source issues from multiples places
by default (`/etc/`, `/run/` and  `/usr/lib/`).

Systemd also worked around this [2] since v258 which has been in
fedora 43 for a while now, so let's always write our issues to
`/run`.

[1] util-linux/util-linux@508fb0e
[2] systemd/systemd@864a5e9

Ref coreos/fedora-coreos-tracker#2108
See https://github.com/coreos/console-login-helper-messages/pull/130
2026-09-22 15:24:25 +02:00
Dusty Mabe
cff712a2aa Revert "rpm-ostreed: use env var rather than bind mounting"
This reverts commit 7f6256c555.

This broke updating from signed content in a registry on our F44
builds for now. See [1].

[1] https://github.com/coreos/fedora-coreos-tracker/issues/2218
2026-09-10 17:21:45 -04:00
Angel Cervera Roldan
7f6256c555 rpm-ostreed: use env var rather than bind mounting
Rather than using a bind mount so that rpm-ostreed has the correct
containers policy, we can use the CONTAINERS_POLICY_JSON environment
variable.
2026-08-25 14:44:56 +01:00
Dusty Mabe
cc4cb0a777 overlay/container-signing: add F46, drop F43 key
Rawhide is now F46 so we need to add that key to the policy.
We can drop the F43 key since we are no longer building for
F43.
2026-08-24 17:11:29 -04:00
Dusty Mabe
12d97c0400 Switch our gpg key path locations to /usr/
Part of:

- https://github.com/coreos/fedora-coreos-tracker/issues/2172
- https://fedoraproject.org/wiki/Changes/RelocateRpmRepoConfigsToUsr

Because of [1] we now have the gpgkeys also in /usr on F44 so we can
go ahead and start using those paths everywhere.

[1] 107895f6f8
2026-08-24 17:11:29 -04:00
Rolv Apneseth
a2629a4bd4 overlay/16fcos: add a systemd generator to fix socket-activated sshd auth
The upstream sshd@.service overrides AuthorizedKeysFile in the ExecStart
command, which excludes .ssh/authorized_keys.d/* where Ignition and
Afterburn place SSH keys. This breaks SSH logins for systems using
socket-activated sshd.

Add this overlay as a workaround to dynamically override ExecStart while
a better solution is discussed upstream.
2026-07-29 08:57:02 +01:00
jbtrystram
9630c544ec Revert "overlay/bootc: add a root filesystem install config"
This reverts commit fb997446a3.

Image builder learned to source the root filesystem from it's own
partition table definition in https://github.com/osbuild/image-builder/pull/2405

See https://github.com/osbuild/image-builder/issues/2380
2026-07-23 14:23:22 +02:00
Dusty Mabe
e2349ce6a1 overlay.d/05core: skip /run cleanup when using iSCSI
In the case that we don't take down networking we can get into
a weird situation where NetworkManager will detect that the NICs
are already configured and "regnerate" NM connection files in
/run/, but sometimes they miss some information (like DNS) [1].

Let's just skip the cleanup of /run/ files here if we didn't
actually take down networking because of iSCSI.

[1] https://github.com/coreos/fedora-coreos-tracker/issues/2196
2026-07-21 09:37:16 -04:00
Dusty Mabe
00f64c7a6f overlay.d/05core: propagate net before teardown
This should be equivalent to what we were doing before as
the two operations should be independent.

This is prep for the next commit.
2026-07-21 09:37:16 -04:00
jbtrystram
8762be39a6 image-builder/disks.yaml: set XFS agcount
Requires https://github.com/osbuild/image-builder/pull/2496
2026-07-20 14:44:29 +02:00
jbtrystram
bc07a6ca42 overlay/disk-image: add missing partition GPT names
Add the partition names to the `disk.yaml` image-builder configuration
file. The partitions were correctly labelled at the filesystem level but
were missing names from the GPT parition table.
This was causing some issues with reprovisionning. Let's make sure the
resulting partition table is identical to what we have when building
disk-images with COSA.

See how partitions names are set in COSA at the GPT table : a2b4dd6c90/src/osbuild-manifests/coreos.osbuild.x86_64.mpp.yaml (L65)
2026-07-08 17:23:55 +02:00
Dusty Mabe
a40d2b813e add virtiofs systemd credential handling
As part of an effort to test more on non-CoreOS bootable
container images we'd like a cross architecture way to
expose systemd credentials into a VM. This commit adds a
new import-virtiofs-systemd-credentials.service that runs
in the initramfs and will copy credentials exposed via the
io.systemd.credentials virtiofs tag into the /run/credentials/@initrd
directory, which will then get imported by systemd itself.

Related to https://github.com/systemd/systemd/issues/29175 upstream.

Assisted-by: <anthropic/claude-opus-4.6>
2026-07-02 06:56:14 -04:00
Dusty Mabe
4812ad9242 overlay/05core: Drop coreos-liveiso-success.service
Originally added in e8abbe2, it was used to confirm autologin worked
but the heuristc (`loginctl list-sessions --no-legend`) stopped working
correctly [1] so we updated the test in COSA to just inspect the
console.txt instead [2].

We can drop this now.

[1] https://github.com/coreos/coreos-assembler/issues/4581
[2] https://github.com/coreos/coreos-assembler/pull/4582
2026-06-18 09:38:56 -04:00
jbtrystram
af0d6638f0 build-rootfs: inject disk partition layouts for image-builder
bootc-image-builder needs a disk partition table definition at
/usr/lib/image-builder/bootc/disk.yaml to produce disk images. Each
architecture has a different partition layout (e.g. BIOS boot on x86_64,
PReP on ppc64le, no boot partition on s390x), so the correct file must
be selected at build time.

This follows the same injection pattern already used for platforms.json
and image.json: build-rootfs links the correct partitioncorrect partition
table from the disk-image overlay.

Authored-by: Opencode.ai claude-opus-4-6@default
2026-06-04 19:05:25 +02:00
jbtrystram
8fa6ab4fde overlays: rename 10bootc to 10disk-images
Let's it a generic disk-image related overlay and ship image-builder
configuration as well.
2026-06-04 19:05:25 +02:00
jbtrystram
7bff49a45e overlay/bootc: add a root filesystem install config
This is actually overwritten by image-builder's
disk.yaml partition table definition but is still required

This can be dropped when https://github.com/osbuild/images/issues/2380
is fixed.
2026-06-04 14:21:45 +02:00
jbtrystram
c3b0810ecf Postprocess: dynamically inject ostree stateroot name
Instead of hard-coding the ostree stateroot in an overlay we dynamically
create the bootc install config file using the NAME variable sourced
from the Containerfile ARG, now propagated to postprocess scripts via
the previous commit.

Authored-by: Opencode.ai <claude-opus-4-6>
2026-05-27 14:42:22 -04:00
jbtrystram
8d511ab740 overlays/bootc: Add missing bootc install options
There are a few options that we are hard-coding in COSA right now, but
with [1] we can pull them from the OCI container, so let's do that
instead and make the container the canonical source of truth.

Also rework this overlay a bit in two files : the firstboot related
options and the one related to the ostree repository.

[1] 364ccaebeb
2026-05-12 14:10:28 +02:00
Pragyan Poudyal
6d30323ca7 Disable automatic bootloader update for ppc64le, s390x
Disabling this due to grub update issues with raid setups

See: https://github.com/coreos/fedora-coreos-tracker/issues/2134

Signed-off-by: Pragyan Poudyal <pragyanpoudyal41999@gmail.com>
2026-05-07 13:40:26 +05:30
jbtrystram
83780c4698 overlay/bootc: fix incorrect quotes for boolean 2026-05-07 01:07:16 +02:00
Timothée Ravier
6639a253f5 Drop alternatives migration and tests
Drop the migration code and corresponding test that added for [1] & [2]
as we have kept this logic for the entire F43 cycle (and thus at least
one barrier release) so all systems should be migrated now.

[1] https://github.com/coreos/fedora-coreos-tracker/issues/1818
[2] https://github.com/coreos/fedora-coreos-tracker/issues/677
2026-05-04 11:48:23 -04:00
jbtrystram
0e9abe5704 overlay/bootc: add ostree sigpolicy enforce config
Tell bootc to enforce that `/etc/containers/policy.json` includes
a default policy that verify our images signature.
2026-05-04 11:35:39 +02:00
jbtrystram
a61284d480 overlays: create 10bootc
Introduce a new overlay to ship configuration files for bootc and
image-builder. These file are sourced from the container during
`bootc install to-filesystem`.
We can also use this later to ship other bits as we make the container
more and more the source of truth, e.g. the partition table definition.

This is prep work for [1]

[1] https://github.com/coreos/fedora-coreos-tracker/issues/1827

See also https://github.com/coreos/coreos-assembler/pull/4224
2026-05-04 11:35:39 +02:00
Michael Armijo
f27348dbae manifests: Remove and consolidate F43/F44 conditionals
Now that we are tracking Fedora 44, we can remove the F43 conditionals
and integrate the F44 packages/ostree-layers into the manifest.
2026-05-01 19:00:21 -04:00
Rolv Apneseth
2f779f9e32 overlay.d: add aarch64-specific overlay which enables virtio-gpu using dracut 2026-04-28 09:44:50 +02:00
Dusty Mabe
edffc37cca overlay.d/05core: drop systemd-firstboot.service disablement
The systemd-firstboot.service is a static unit (no [Install] section)
which means you can't just enable or disable it as one would typically
do so IIUC the preset disablement does nothing anyway.

The systemd-firstboot.service.d/fcos-disable.conf override also seems to
be unneeded because the only thing trying to pull it in is disabled at
the bootc level anyway [1].

Maybe let's just remove these workarounds because it seems like they
aren't needed.

[1] 9f9824c9a4/minimal/manifest.yaml (L18)
2026-04-21 10:16:33 -04:00
Dusty Mabe
34d14ce20c overlay.d/05core: disable systemd-oomd.socket too
At some point the socket started getting enabled by default [1], which means
systemd-oomd.service was running. Let's disable the socket too.

[1] b056f04a01/f/90-default.preset (_15)
2026-04-21 10:16:33 -04:00
Dusty Mabe
91aa21453f overlay.d/05core: drop systemd-backlight.service override
The linked issue here [1] has long since been fixed.

[1] https://github.com/ostreedev/ostree/issues/2115
2026-04-21 10:16:33 -04:00
Dusty Mabe
f13ccc226c overlay.d/05core: drop systemd-sysext.service disablement
We been progressively exploring sysexts more [1] and the service today
won't actually run uness /etc/extensions, /run/extensions, or /var/lib/extensions
has files.

```
[core@cosa-devsh ~]$ systemctl status systemd-sysext.service
○ systemd-sysext.service - Merge System Extension Images into /usr/ and /opt/
     Loaded: loaded (/usr/lib/systemd/system/systemd-sysext.service; enabled; preset: enabled)
    Drop-In: /usr/lib/systemd/system/service.d
             └─10-timeout-abort.conf
     Active: inactive (dead)
  Condition: start condition unmet at Mon 2026-04-20 19:23:40 UTC; 17s ago
             ├─ ConditionDirectoryNotEmpty=|/etc/extensions was not met
             ├─ ConditionDirectoryNotEmpty=|/run/extensions was not met
             └─ ConditionDirectoryNotEmpty=|/var/lib/extensions was not met
       Docs: man:systemd-sysext.service(8)

```

Let's remove the preset disablement here.

[1] https://fedora-sysexts.github.io/fedora/
2026-04-21 10:16:33 -04:00
Dusty Mabe
de6c188317 overlay.d/05core: drop hostonly=no dracut config
This is defined in the bootc base images [1] so we don't need to
additionally define it here.

[1] 9f9824c9a4/minimal/initramfs.yaml (L9)
2026-04-21 09:01:15 +02:00
Dusty Mabe
8e5b54f27b overlay.d/05core: drop dracut conf disabling strip
Since we don't ship it anyway this will have no effect other than
preventing a harmess warning message:

```
dracut[I]: Could not find 'strip'. Not stripping the initramfs.
```

I think keeping this config and spending cycles in the future to figure
out if it is still useful is more harmful than it's worth.

As a side note the bootc base images don't have this config. If we did
decide it was important enough in the future to re-add this I would argue
the config should get added there, rather than re-added here.
2026-04-21 09:01:15 +02:00
Timothée Ravier
caf160018e overlay.d/05core: Remove obsolete 'bootupd.socket' preset
bootup is now using a transient systemd service and no longer use the
socket unit.

The actual service unit trigerring the updates is enabled in the Fedora
bootc image.

See: https://github.com/coreos/bootupd/issues/551
2026-04-20 11:46:47 -04:00
Dusty Mabe
694c193afd overlay/container-signing: add F42, drop F45 key
Rawhide is now F45 so we need to add that key to the policy.
We can drop the F42 key since we are no longer building for
F42.
2026-02-24 16:35:37 -05:00
Timothée Ravier
dcbb90ca25 manifests: Replace ssh-key-dir by openssh config
We can now use the extended support for globs in `AuthorizedKeysFile` to
tell sshd to look at the files written by Ignition and Afterburn for ssh
key to accept.

See: https://github.com/coreos/ssh-key-dir/issues/188
See: https://man.openbsd.org/sshd_config#AuthorizedKeysFile
2025-12-16 17:46:30 +01:00
Dusty Mabe
02f7e0efb0 overlay.d: drop the 25azure-udev-rules overlay
The azure sriov unmanaged rules were added upstream to azure-vm-utils
[1] and we're shipping that package so we should be good to drop this
overlay now.

I confirmed that the rules are included in the initramfs, so we should
be covered there:

```
[core@cosa-devsh ~]$ rpm -q azure-vm-utils
azure-vm-utils-0.7.0-1.fc43.x86_64
[core@cosa-devsh ~]$ sudo lsinitrd | grep 10-azure-unmanaged-sriov.rules
-rw-r--r--   1 root     root          640 Jan  1  1970 usr/lib/udev/rules.d/10-azure-unmanaged-sriov.rules
```

[1] https://github.com/Azure/azure-vm-utils/pull/41
2025-12-05 11:06:38 -05:00
Huijing Hei
a8b0f2e8a9 35coreos-ignition: find sfdisk path
Thank you Dusty for pointing out the root cause in
https://github.com/coreos/fedora-coreos-config/pull/3862#issuecomment-3467947591

For centos stream and rhcos, the tests that want to use
"/dev/disk/by-id/coreos-boot-disk" failed with
```
ignition[728]: disks: createPartitions: op(1): [failed]   waiting
for devices [/dev/disk/by-id/coreos-boot-disk]: device unit
dev-disk-by\x2did-coreos\x2dboot\x2ddisk.device timeout
```
e.g. `ext.config.shared.ignition.stable-boot`

Detail logs:
`/usr/lib/udev/coreos-disk-contains-partition-name: line 28: sfdisk: command not found`
2025-11-03 21:08:20 +08:00
Colin Walters
e222e13e61 overlay/coreos-boot-mount-generator: Be compatible with bcvk ephemeral
See https://github.com/bootc-dev/bcvk/pull/101

This also is needed to eventually make FCOS work with `bcvk to-disk`.

Signed-off-by: Colin Walters <walters@verbum.org>
2025-10-30 10:51:30 -04:00