Skip to content
This repository was archived by the owner on Nov 9, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 2 additions & 35 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -1,37 +1,4 @@
# Built from https://gitlab.gnome.org/GNOME/gnome-build-meta/-/tree/alatiera/add-kernel-to-image
FROM ghcr.io/alatiera/gnomeos-custom/gnomeos-core:nightly

# https://github.com/bootc-dev/bootc/blob/main/crates/initramfs/dracut/module-setup.sh
RUN --mount=type=tmpfs,dst=/tmp \
set -x && \
cp /usr/lib/modules/*/initramfs.img /tmp && \
mkdir -p /tmp/initramfs && \
xzcat /tmp/initramfs.img | cpio -idmv -D /tmp/initramfs && \
install -Dpm0755 /usr/lib/bootc/initramfs-setup /tmp/initramfs/usr/lib/bootc/initramfs-setup && \
install -Dpm0755 /usr/lib/systemd/system/bootc-root-setup.service /tmp/initramfs/usr/lib/systemd/system && \
mkdir -p /tmp/initramfs/usr/lib/systemd/system/initrd-root-fs.target.wants && \
ln -sr ../bootc-root-setup.service /tmp/initramfs/usr/lib/systemd/system/initrd-root-fs.target.wants/bootc-root-setup.service && \
cd /tmp/initramfs && \
find . -print0 | sort -z | cpio --reproducible --null -H newc -o --quiet | xz --check=crc32 --lzma2=dict=1MiB > "$(find /usr/lib/modules -maxdepth 1 -type d | tail -n 1)/"initramfs.img

RUN rm -rf /boot/vmlinux /usr/share/doc /usr/libexec/gcc
RUN install -Dpm0755 /boot/* "$(find /usr/lib/modules -maxdepth 1 -type d | tail -n 1)"

RUN systemd-sysusers

RUN rm -rf /boot && \
mkdir -p /boot

RUN rm -rf /usr/include /usr/debug

# Necessary for `bootc install`
RUN mkdir -p /usr/lib/ostree && \
printf "[composefs]\nenabled = yes\n[sysroot]\nreadonly = true\n" | \
tee "/usr/lib/ostree/prepare-root.conf"

RUN sed -i 's|^HOME=.*|HOME=/var/home|' "/etc/default/useradd"

# Also make sure to create a root password by doing `init=/sbin/bash` or setting this on the containerfile when building locally.
# RUN echo 'root:HASH_THAT_YOU_WANT:20311:0:99999:7:::' | tee /etc/shadow
# Built from https://gitlab.gnome.org/GNOME/gnome-build-meta/-/merge_requests/4256
FROM quay.io/gnome_infrastructure/gnome-build-meta:gnomeos-nightly

RUN bootc container lint || true
14 changes: 8 additions & 6 deletions Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@ image_tag := env("BUILD_IMAGE_TAG", "latest")
base_dir := env("BUILD_BASE_DIR", ".")
filesystem := env("BUILD_FILESYSTEM", "btrfs")

build-containerfile $image_name=image_name:
sudo podman build --squash-all -t "${image_name}:latest" .

bootc *ARGS:
sudo podman run \
--rm --privileged --pid=host \
Expand All @@ -14,14 +11,19 @@ bootc *ARGS:
-v /etc/containers:/etc/containers:Z \
-v /var/lib/containers:/var/lib/containers:Z \
-v /dev:/dev \
-e RUST_LOG=debug \
-v "{{base_dir}}:/data" \
--security-opt label=type:unconfined_t \
"{{image_name}}:{{image_tag}}" bootc {{ARGS}}

generate-bootable-image $base_dir=base_dir $filesystem=filesystem:
#!/usr/bin/env bash
if [ ! -e "${base_dir}/bootable.img" ] ; then
fallocate -l 30G "${base_dir}/bootable.img"
fallocate -l 20G "${base_dir}/bootable.img"
fi
just bootc install to-disk --composefs-backend --via-loopback /data/bootable.img --filesystem "${filesystem}" --wipe --bootloader systemd

# --karg systemd.firstboot=no \
just bootc install to-disk --composefs-backend \
--via-loopback /data/bootable.img \
--filesystem "${filesystem}" \
--wipe \
--bootloader systemd
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,22 @@
# GNOME OS Bootc!

## Archived

Due to the amazing efforts by the GNOME OS team, this repository is no longer needed now that the upstream GNOME OS OCI
images are bootc compatible.

This image should be what you want to use instead now, make sure to read the GNOME OS documentation for better pointers: `quay.io/gnome_infrastructure/gnome-build-meta:gnomeos-nightly`

See this [Merge Request](https://gitlab.gnome.org/GNOME/gnome-build-meta/-/merge_requests/4256) for the initial bootc support

Special thanks to:
- https://github.com/valentindavid
- https://github.com/alatiera

You two are amazing, thank you so much for working on this.

## Old README

[GNOME's operating system](https://os.gnome.org/) redistributed via bootc!

<img width="2138" height="1332" alt="image" src="https://github.com/user-attachments/assets/51e52947-3819-431d-b24a-4c0691811549" />
Expand Down
Loading