Skip to content
This repository was archived by the owner on Mar 19, 2026. It is now read-only.

Commit 1868e26

Browse files
committed
fix: bootloader entries not showing up + dracut not detecting kernels
Signed-off-by: Tulip Blossom <tulilirockz@posteo.com>
1 parent 1bc4db3 commit 1868e26

File tree

2 files changed

+21
-28
lines changed

2 files changed

+21
-28
lines changed

Containerfile

Lines changed: 20 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
FROM docker.io/archlinux/archlinux:latest AS builder
22

3-
ENV BOOTC_ROOTFS_MOUNTPOINT=/mnt
3+
ENV DEV_DEPS="base-devel git rust whois"
44

5-
RUN mkdir -p "${BOOTC_ROOTFS_MOUNTPOINT}/var/lib/pacman" && \
6-
pacman -r "${BOOTC_ROOTFS_MOUNTPOINT}" --cachedir=/var/cache/pacman/pkg -Syyuu --noconfirm \
5+
ENV DRACUT_NO_XATTR=1
6+
RUN pacman -Syyuu --noconfirm \
77
base \
88
dracut \
99
linux \
@@ -18,14 +18,9 @@ RUN mkdir -p "${BOOTC_ROOTFS_MOUNTPOINT}/var/lib/pacman" && \
1818
dbus \
1919
dbus-glib \
2020
glib2 \
21-
pacman \
22-
shadow && \
23-
cp /etc/pacman.conf "${BOOTC_ROOTFS_MOUNTPOINT}/etc/pacman.conf" && \
24-
cp -r /etc/pacman.d "${BOOTC_ROOTFS_MOUNTPOINT}/etc/" && \
25-
pacman -S --clean && \
26-
rm -rf /var/cache/pacman/pkg/*
27-
28-
RUN pacman -Syu --noconfirm base-devel git rust ostree dracut whois && \
21+
ostree \
22+
shadow \
23+
${DEV_DEPS} && \
2924
pacman -S --clean && \
3025
rm -rf /var/cache/pacman/pkg/*
3126

@@ -40,31 +35,29 @@ RUN --mount=type=tmpfs,dst=/tmp --mount=type=tmpfs,dst=/root \
4035
cargo build --release --bins --features systemd-boot && \
4136
make install
4237

38+
# Setup a temporary root passwd (changeme) for dev purposes
39+
# TODO: Replace this for a more robust option when in prod
40+
RUN usermod -p "$(echo "changeme" | mkpasswd -s)" root
41+
42+
RUN pacman -Rns --noconfirm ${DEV_DEPS}
43+
4344
RUN sh -c 'export KERNEL_VERSION="$(basename "$(find /usr/lib/modules -maxdepth 1 -type d | grep -v -E "*.img" | tail -n 1)")" && \
4445
dracut --force --no-hostonly --reproducible --zstd --verbose --kver "$KERNEL_VERSION" "/usr/lib/modules/$KERNEL_VERSION/initramfs.img"'
4546

46-
RUN cd "${BOOTC_ROOTFS_MOUNTPOINT}" && \
47-
mkdir -p boot sysroot var/home && \
48-
rm -rf var/log home root usr/local srv && \
49-
ln -s /var/home home && \
50-
ln -s /var/roothome root && \
51-
ln -s /var/usrlocal usr/local && \
52-
ln -s /var/srv srv
47+
RUN rm -rf /var /boot /home /root /usr/local /srv && \
48+
mkdir -p /var /boot && \
49+
ln -s /var/home /home && \
50+
ln -s /var/roothome /root && \
51+
ln -s /var/srv /srv && \
52+
ln -s sysroot/ostree ostree && \
53+
ln -s /var/usrlocal /usr/local
5354

5455
# Update useradd default to /var/home instead of /home for User Creation
55-
RUN sed -i 's|^HOME=.*|HOME=/var/home|' "${BOOTC_ROOTFS_MOUNTPOINT}/etc/default/useradd"
56-
57-
# Setup a temporary root passwd (changeme) for dev purposes
58-
# TODO: Replace this for a more robust option when in prod
59-
RUN usermod --root "${BOOTC_ROOTFS_MOUNTPOINT}" -p "$(echo "changeme" | mkpasswd -s)" root
56+
RUN sed -i 's|^HOME=.*|HOME=/var/home|' "/etc/default/useradd"
6057

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

66-
FROM scratch AS runtime
67-
68-
COPY --from=builder /mnt /
69-
7063
RUN bootc container lint

Justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@ generate-bootable-image $base_dir=base_dir $filesystem=filesystem:
2323
if [ ! -e "${base_dir}/bootable.img" ] ; then
2424
fallocate -l 20G "${base_dir}/bootable.img"
2525
fi
26-
just bootc install to-disk --composefs-native --via-loopback /data/bootable.img --filesystem "${filesystem}" --wipe
26+
just bootc install to-disk --composefs-native --via-loopback /data/bootable.img --filesystem "${filesystem}" --wipe --bootloader systemd

0 commit comments

Comments
 (0)