Compare commits

..

No commits in common. "jamesp-fork" and "v2024.0" have entirely different histories.

26 changed files with 114 additions and 156 deletions

View File

@ -20,14 +20,12 @@
# #
# # Why does this build process require additional privileges? # # Why does this build process require additional privileges?
# #
# Because it's generating a base image and uses containerization features itself. # Because it's generating a base image and uses containerbuildcontextization features itself.
# In the future some of this can be lifted. # In the future some of this can be lifted.
FROM quay.io/fedora/fedora:41 as repos FROM quay.io/fedora/fedora:rawhide as repos
# BOOTSTRAPPING: This can be any image that has rpm-ostree and selinux-policy-targeted. FROM quay.io/centos-bootc/bootc-image-builder:latest as builder
FROM quay.io/fedora/fedora:41 as builder
RUN dnf -y install rpm-ostree selinux-policy-targeted
ARG MANIFEST=fedora-bootc.yaml ARG MANIFEST=fedora-bootc.yaml
COPY --from=repos /etc/dnf/vars /etc/dnf/vars COPY --from=repos /etc/dnf/vars /etc/dnf/vars
COPY --from=repos /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-* /etc/pki/rpm-gpg COPY --from=repos /etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-* /etc/pki/rpm-gpg
@ -39,16 +37,10 @@ COPY . /src
WORKDIR /src WORKDIR /src
RUN rm -vf /src/*.repo RUN rm -vf /src/*.repo
COPY --from=repos /etc/yum.repos.d/*.repo /src COPY --from=repos /etc/yum.repos.d/*.repo /src
RUN --mount=type=cache,target=/workdir \ RUN --mount=type=cache,target=/workdir --mount=type=bind,rw=true,src=.,dst=/buildcontext,bind-propagation=shared rpm-ostree compose image \
--mount=type=bind,rw=true,src=.,dst=/buildcontext,bind-propagation=shared \ --image-config fedora-bootc-config.json --cachedir=/workdir --format=ociarchive --initialize ${MANIFEST} /buildcontext/out.ociarchive
--mount=type=bind,from=repos,src=/,dst=/repos \
rpm-ostree compose image --image-config fedora-bootc-config.json \
--cachedir=/workdir --format=ociarchive --initialize ${MANIFEST} \
--source-root=/repos /buildcontext/out.ociarchive
FROM oci-archive:./out.ociarchive FROM oci-archive:./out.ociarchive
# Need to reference builder here to force ordering. But since we have to run # Need to reference builder here to force ordering. But since we have to run
# something anyway, we might as well cleanup after ourselves. # something anyway, we might as well cleanup after ourselves.
RUN --mount=type=bind,from=builder,src=.,target=/var/tmp \ RUN --mount=type=bind,from=builder,src=.,target=/var/tmp --mount=type=bind,rw=true,src=.,dst=/buildcontext,bind-propagation=shared rm /buildcontext/out.ociarchive
--mount=type=bind,rw=true,src=.,dst=/buildcontext,bind-propagation=shared \
rm /buildcontext/out.ociarchive

View File

@ -32,16 +32,6 @@ podman build --security-opt=label=disable --cap-add=all \
See the `Containerfile` for more details. This builds the default `tier-1` image. See the `Containerfile` for more details. This builds the default `tier-1` image.
## Fedora versions
By default, the base images are built for Fedora rawhide. To build against a
different Fedora version, you can override the `FROM` image used to obtain the
Fedora repos and dnf variables. E.g.:
```
podman build --from quay.io/fedora/fedora:41 ...
```
### Deriving ### Deriving
You are of course also free to fork, customize, and build base images yourself. You are of course also free to fork, customize, and build base images yourself.
@ -49,23 +39,15 @@ See this page[6] of the documentation for more information.
## Tiers ## Tiers
At the current time, there is just one reference base image published There are currently 3 tiers:
to the registry. Internally the content set is split up somewhat
into "tiers", but this is an internal implementation detail and may change
at any time.
It is planned to rework and improve this in the future, especially
to support smaller custom images. For more on this, see
[this tracker issue](https://gitlab.com/fedora/bootc/tracker/-/issues/32).
- **tier-1**: This image is the default, what is published as - **tier-1**: This image is the default, what is published as
https://quay.io/repository/fedora/fedora-bootc https://quay.io/repository/fedora/fedora-bootc
- **tier-0**: This content set is more of a convenient centralization point for CI - **tier-0**: This image is more of a convenient centralization point for CI
and curation around a package set that we can all agree is the rough minimum and curation around a package set that we can all agree is the rough minimum
necessary for a usable system. It's not meant to be used as is, but layered necessary for a usable system. It's not meant to be used as is, but layered
upon. upon.
- **tier-x**: This content set is the shared base used by all image-based - **tier-x**: This image is not intended for end-users. It's the shared base
Fedora variants (IoT, Atomic Desktops, and CoreOS). used by all image-based Fedora variants (IoT, Atomic Desktops, and CoreOS).
Changes to this tier may be done without accounting for external users. Changes to this tier may be done without accounting for external users.
To build this, pass `--build-arg=MANIFEST=fedora-tier-x.yaml` to the build To build this, pass `--build-arg=MANIFEST=fedora-tier-x.yaml` to the build
command above. command above.

View File

@ -1,5 +0,0 @@
podman build \
--security-opt=label=disable \
--cap-add=all \
--device /dev/fuse \
-t localhost/fedora-bootc .

View File

@ -1,7 +0,0 @@
# NB: This treefile is used by the legacy pungi path only to build tier-1. It
# will be removed in the future.
releasever: 40
repos:
- fedora
- fedora-updates
include: fedora-bootc.yaml

View File

@ -1,7 +0,0 @@
# NB: This treefile is used by the legacy pungi path only to build tier-1. It
# will be removed in the future.
releasever: 41
repos:
- fedora
- fedora-updates
include: fedora-bootc.yaml

View File

@ -1,6 +0,0 @@
# NB: This treefile is used by the legacy pungi path only to build tier-1. It
# will be removed in the future.
releasever: 42
repos:
- fedora-devel
include: fedora-bootc.yaml

View File

@ -1,3 +1,7 @@
releasever: rawhide
repos:
- rawhide
metadata: metadata:
name: fedora-boot-tier1 name: fedora-boot-tier1
summary: Fedora Bootable Tier 1 summary: Fedora Bootable Tier 1

View File

@ -5,5 +5,3 @@ variables:
packages: packages:
# https://gitlab.com/fedora/bootc/base-images/-/issues/12 # https://gitlab.com/fedora/bootc/base-images/-/issues/12
- fedora-repos-archive - fedora-repos-archive
# Not in RHEL10
- systemd-resolved

View File

@ -1,6 +0,0 @@
# NB: This treefile is used by the legacy pungi path only to build tier-1. It
# will be removed in the future.
releasever: rawhide
repos:
- fedora-rawhide
include: fedora-bootc.yaml

View File

@ -1,3 +1,7 @@
releasever: rawhide
repos:
- rawhide
metadata: metadata:
name: fedora-boot-tier0 name: fedora-boot-tier0
summary: Fedora Bootable Tier 0 summary: Fedora Bootable Tier 0

View File

@ -1,3 +1,7 @@
releasever: rawhide
repos:
- rawhide
metadata: metadata:
name: fedora-boot-tier-x name: fedora-boot-tier-x
summary: Fedora Bootable Tier X summary: Fedora Bootable Tier X

0
tier-0/bootc-config.yaml Normal file
View File

View File

@ -6,9 +6,8 @@ packages:
# `iptables`. Currently that pulls in iptables-legacy. Let's explicitly name # `iptables`. Currently that pulls in iptables-legacy. Let's explicitly name
# iptables-nft instead to satisfy it. # iptables-nft instead to satisfy it.
- iptables-nft - iptables-nft
# Required by bootc install, sgdisk has been replaced by Rust crate # Required by bootc install today, though we'll likely switch bootc to use a Rust crate instead of sgdisk
# in bootc https://github.com/containers/bootc/pull/775 - gdisk xfsprogs e2fsprogs dosfstools
- xfsprogs e2fsprogs dosfstools
exclude-packages: exclude-packages:
# Exclude kernel-debug-core to make sure that it doesn't somehow get # Exclude kernel-debug-core to make sure that it doesn't somehow get

View File

@ -9,8 +9,9 @@ packages-aarch64:
packages-ppc64le: packages-ppc64le:
- grub2 ostree-grub2 - grub2 ostree-grub2
packages-s390x: packages-s390x:
# For zipl # On Fedora, this is provided by s390utils-core. on RHEL, this is for now
- s390utils-core # provided by s390utils-base, but soon will be -core too.
- /usr/sbin/zipl
packages-x86_64: packages-x86_64:
- grub2 grub2-efi-x64 efibootmgr shim - grub2 grub2-efi-x64 efibootmgr shim
- microcode_ctl - microcode_ctl
@ -26,8 +27,3 @@ postprocess:
set -xeuo pipefail set -xeuo pipefail
# Transforms /usr/lib/ostree-boot into a bootupd-compatible update payload # Transforms /usr/lib/ostree-boot into a bootupd-compatible update payload
/usr/bin/bootupctl backend generate-update-metadata /usr/bin/bootupctl backend generate-update-metadata
- |
#!/bin/bash
# Workaround for https://issues.redhat.com/browse/RHEL-78104
set -xeuo pipefail
rm -vrf /usr/lib/ostree-boot/loader

View File

@ -1,6 +0,0 @@
#!/bin/bash
# https://gitlab.com/fedora/bootc/base-images/-/issues/28
set -xeuo pipefail
ln -s ../run var/run
# https://gitlab.com/fedora/bootc/tracker/-/issues/58
mkdir -p var/lib/rpm-state

View File

@ -1,21 +0,0 @@
# Configuration to enable kernel-install integration
postprocess:
- |
#!/usr/bin/env bash
set -xeuo pipefail
source /usr/lib/os-release
echo -e "# kernel-install will not try to run dracut and allow rpm-ostree to\n\
# take over. Rpm-ostree will use this to know that it is responsible\n\
# to run dracut and ensure that there is only one kernel in the image\n\
layout=ostree" | tee /usr/lib/kernel/install.conf > /dev/null
# By default dnf keeps multiple versions of the kernel, with this
# configuration we tell dnf to treat the kernel as everything else.
# https://dnf.readthedocs.io/en/latest/conf_ref.html#main-options
# Let's add the config to a distribution configuration file if dnf5
# is used, we append to /etc/dnf/dnf.conf if not.
if [ -d "/usr/share/dnf5/libdnf.conf.d/" ]; then
echo -e "[main]\ninstallonlypkgs=''" >> /usr/share/dnf5/libdnf.conf.d/20-ostree-installonlypkgs.conf
else
echo "installonlypkgs=''" >> /etc/dnf/dnf.conf
fi

10
tier-0/kernel-rt.yaml Normal file
View File

@ -0,0 +1,10 @@
repos:
- rt
- nfv
# Enable the "realtime" AKA soft-realtime AKA latency-optimized kernel.
packages:
- kernel-rt-core kernel-rt-modules kernel-rt-modules-extra kernel-rt-kvm
exclude-packages:
- kernel-rt-debug-core

View File

@ -1,12 +1,43 @@
edition: "2024"
# Modern defaults we want
boot-location: modules
tmp-is-dir: true
# https://github.com/CentOS/centos-bootc/issues/167
machineid-compat: true
# Be minimal # Be minimal
recommends: false recommends: false
ignore-removed-users:
- root
ignore-removed-groups:
- root
etc-group-members:
- wheel
- sudo
- systemd-journal
- adm
# Default to `bash` in our container, the same as other containers we ship. # Default to `bash` in our container, the same as other containers we ship.
container-cmd: container-cmd:
- /sbin/init - /sbin/init
# Note that the default for c9s+ is sqlite; we can't rely on rpm being
# in the target (it isn't in tier-0!) so turn this to host here. This
# does break the "hermetic build" aspect a bit. Maybe eventually
# what we should do is special case this and actually install RPM temporarily
# and then remove it...
rpmdb: host
check-passwd:
type: "file"
filename: "passwd"
check-groups:
type: "file"
filename: "group"
automatic-version-prefix: "${releasever}.<date:%Y%m%d>"
mutate-os-release: "${releasever}"
remove-from-packages: remove-from-packages:
# Generally we expect other tools to do this (e.g. Ignition or cloud-init) # Generally we expect other tools to do this (e.g. Ignition or cloud-init)
- [systemd, /usr/lib/systemd/system/sysinit.target.wants/systemd-firstboot.service] - [systemd, /usr/lib/systemd/system/sysinit.target.wants/systemd-firstboot.service]
@ -15,21 +46,17 @@ remove-from-packages:
- [systemd-udev, /usr/lib/systemd/system-generators/systemd-gpt-auto-generator] - [systemd-udev, /usr/lib/systemd/system-generators/systemd-gpt-auto-generator]
include: include:
- postprocess-conf.yaml
- bootc.yaml - bootc.yaml
- bootupd.yaml - bootupd.yaml
- ostree.yaml - ostree.yaml
- initramfs.yaml - initramfs.yaml
- basic-fixes.yaml - basic-fixes.yaml
- kernel-install.yaml
packages: packages:
# this is implied by dependencies but let's make it explicit # this is implied by dependencies but let's make it explicit
- coreutils - coreutils
# We need dnf for building derived container images. In Fedora, this pulls # needed for building derived container images
# in dnf5. In CentOS/RHEL, this pulls in dnf(4). We can simplify this back to - dnf5
# just `dnf` once the `dnf` package is retired from Fedora.
- /usr/bin/dnf
# Even in tier-0, we have this. If you don't want SELinux today, you'll need # Even in tier-0, we have this. If you don't want SELinux today, you'll need
# to build a custom image. # to build a custom image.
- selinux-policy-targeted - selinux-policy-targeted

View File

@ -1,6 +1,9 @@
packages: packages:
- ostree nss-altfiles - ostree nss-altfiles
# We want content lifecycled with the image
opt-usrlocal: "root"
postprocess: postprocess:
# Set up default root config # Set up default root config
- | - |

View File

@ -23,7 +23,7 @@ rpc:x:32:32:Rpcbind Daemon:/var/lib/rpcbind:/usr/sbin/nologin
rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/usr/sbin/nologin rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/usr/sbin/nologin
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/usr/sbin/nologin sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/usr/sbin/nologin
sssd:x:995:993:User for sssd:/run/sssd:/usr/sbin/nologin sssd:x:995:993:User for sssd:/:/usr/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync sync:x:5:0:sync:/sbin:/bin/sync
systemd-bus-proxy:x:989:988:systemd Bus Proxy:/:/usr/sbin/nologin systemd-bus-proxy:x:989:988:systemd Bus Proxy:/:/usr/sbin/nologin
systemd-network:x:991:990:systemd Network Management:/:/usr/sbin/nologin systemd-network:x:991:990:systemd Network Management:/:/usr/sbin/nologin

View File

@ -1,34 +0,0 @@
# This file configures things relevant to `rpm-ostree compose postprocess`.
# We want content lifecycled with the image
opt-usrlocal: "root"
# https://github.com/CentOS/centos-bootc/issues/167
machineid-compat: true
# Note that the default for c9s+ is sqlite; we can't rely on rpm being
# in the target (it isn't in tier-0!) so turn this to host here. This
# does break the "hermetic build" aspect a bit. Maybe eventually
# what we should do is special case this and actually install RPM temporarily
# and then remove it...
rpmdb: host
ignore-removed-users:
- root
ignore-removed-groups:
- root
etc-group-members:
- wheel
- sudo
- systemd-journal
- adm
check-passwd:
type: "file"
filename: "passwd"
check-groups:
type: "file"
filename: "group"
automatic-version-prefix: "${releasever}.<date:%Y%m%d>"
mutate-os-release: "${releasever}"

View File

@ -6,8 +6,6 @@ Documentation=https://gitlab.com/fedora/bootc/docs
ConditionVirtualization=vm ConditionVirtualization=vm
# This helps verify that we're running in a bootc/ostree based target. # This helps verify that we're running in a bootc/ostree based target.
ConditionPathIsMountPoint=/sysroot ConditionPathIsMountPoint=/sysroot
# For someone making a smaller image, assume they have this handled.
ConditionPathExists=/usr/bin/growpart
# We want to run before any e.g. large container images might be pulled. # We want to run before any e.g. large container images might be pulled.
DefaultDependencies=no DefaultDependencies=no
Requires=sysinit.target Requires=sysinit.target

View File

@ -3,8 +3,15 @@
packages: packages:
# Additional file compression/decompression # Additional file compression/decompression
- bzip2 zstd - bzip2 zstd
# Improved MOTD experience
- console-login-helper-messages-issuegen
- console-login-helper-messages-profile
# kdump support # kdump support
# https://github.com/coreos/fedora-coreos-tracker/issues/622 # https://github.com/coreos/fedora-coreos-tracker/issues/622
- kexec-tools - kexec-tools
# Container tooling
- toolbox
# nvme-cli for managing nvme disks # nvme-cli for managing nvme disks
- nvme-cli - nvme-cli
# Used by admins interactively
- lsof

View File

@ -3,18 +3,28 @@ recommends: true
include: include:
- ../tier-x/manifest.yaml - ../tier-x/manifest.yaml
- autoupdates.yaml
- networking-tools.yaml - networking-tools.yaml
- system-configuration.yaml - system-configuration.yaml
- coreos-user-experience.yaml - coreos-user-experience.yaml
- persistent-journal.yaml - persistent-journal.yaml
- initramfs-full.yaml - initramfs-full.yaml
- generic-growfs.yaml
packages: packages:
# Include and set the default editor
- nano
- nfs-utils - nfs-utils
# Additional firewall support; we aren't including these in RHCOS or they # Additional firewall support; we aren't including these in RHCOS or they
# don't exist in RHEL # don't exist in RHEL
- iptables-services - iptables-services
- WALinuxAgent-udev - WALinuxAgent-udev
# Allow communication between sudo and SSSD
# for caching sudo rules by SSSD.
# https://github.com/coreos/fedora-coreos-tracker/issues/445
- libsss_sudo
# SSSD; we only ship a subset of the backends
- sssd-client sssd-ad sssd-ipa sssd-krb5 sssd-ldap
# Used by admins interactively # Used by admins interactively
- openssl - openssl
# Provides terminal tools like clear, reset, tput, and tset # Provides terminal tools like clear, reset, tput, and tset
@ -24,10 +34,19 @@ packages:
# zram-generator (but not zram-generator-defaults) for F33 change # zram-generator (but not zram-generator-defaults) for F33 change
# https://github.com/coreos/fedora-coreos-tracker/issues/509 # https://github.com/coreos/fedora-coreos-tracker/issues/509
- zram-generator - zram-generator
# This one is in Python so isn't in FCOS, but we can safely add it here.
- sos
# These are random architecture-specific packages # These are random architecture-specific packages
packages-x86_64: [] packages-x86_64:
packages-aarch64: [] - irqbalance
packages-ppc64le:
- irqbalance
- librtas
- powerpc-utils-core
- ppc64-diag-rtas
packages-aarch64:
- irqbalance
postprocess: postprocess:
# Undo RPM scripts enabling units; we want the presets to be canonical # Undo RPM scripts enabling units; we want the presets to be canonical

View File

@ -3,6 +3,9 @@
packages: packages:
# Explicit dep for RHEL >= 10 # Explicit dep for RHEL >= 10
- crypto-policies-scripts - crypto-policies-scripts
# Configuring SSH keys, cloud provider check-in, etc
# TODO: needs Ignition kargs
# - afterburn afterburn-dracut
# NTP support # NTP support
- chrony - chrony
# Storage configuration/management # Storage configuration/management
@ -21,4 +24,7 @@ packages:
# Anything package layered will also tend to expect files dropped in # Anything package layered will also tend to expect files dropped in
# /etc/logrotate.d to work. Really, this is a legacy thing, but if we don't # /etc/logrotate.d to work. Really, this is a legacy thing, but if we don't
# have it then people's disks will slowly fill up with logs. # have it then people's disks will slowly fill up with logs.
- logrotate - logrotate
# Boost starving threads
# https://github.com/coreos/fedora-coreos-tracker/issues/753
- stalld

View File

@ -10,12 +10,12 @@ packages:
- jq - jq
- less - less
- vim-minimal - vim-minimal
# crun recommends but doesn't require criu and criu-libs. We want them for
# checkpoint/restore. https://github.com/coreos/fedora-coreos-tracker/issues/1370
- criu criu-libs
# deps of bootc, but let's be explicit. e.g. even if bootc drops the skopeo # deps of bootc, but let's be explicit. e.g. even if bootc drops the skopeo
# dep, we still want it # dep, we still want it
- podman skopeo - podman skopeo
# crun recommends but doesn't require criu and criu-libs. We want them for
# checkpoint/restore. https://github.com/coreos/fedora-coreos-tracker/issues/1370
- crun criu criu-libs
# storage # storage
- cryptsetup - cryptsetup
- lvm2 - lvm2
@ -28,6 +28,7 @@ packages:
- NetworkManager - NetworkManager
- openssh-clients - openssh-clients
- openssh-server - openssh-server
- systemd-resolved
# linux-firmware now a recommends so let's explicitly include it # linux-firmware now a recommends so let's explicitly include it
# https://gitlab.com/cki-project/kernel-ark/-/commit/32271d0cd9bd52d386eb35497c4876a8f041f70b # https://gitlab.com/cki-project/kernel-ark/-/commit/32271d0cd9bd52d386eb35497c4876a8f041f70b
# https://src.fedoraproject.org/rpms/kernel/c/f55c3e9ed8605ff28cb9a922efbab1055947e213?branch=rawhide # https://src.fedoraproject.org/rpms/kernel/c/f55c3e9ed8605ff28cb9a922efbab1055947e213?branch=rawhide