Files
OrionOS/iso/docker/Dockerfile
T
nmemmertandClaude Sonnet 4.6 ebb61beaac Copy archiso initcpio hooks directly into airootfs at build time
The hook package install inside the pacstrap chroot may silently skip
the initcpio install step under QEMU emulation, leaving the archiso hook
absent from the initrd (confirmed: no 'running late hook [archiso]' in
boot output despite UUID match on device).

Explicitly copy /usr/lib/initcpio/hooks/archiso and install/archiso from
the build host into the airootfs before mkarchiso runs mkinitcpio, so
the hook is present regardless of how the chroot package install behaves.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-08-31 10:52:05 -04:00

92 lines
4.0 KiB
Docker

FROM archlinux:latest
# Disable pacman's alpm sandbox (seccomp-incompatible inside Docker/BuildKit)
RUN echo "DisableSandbox" >> /etc/pacman.conf
# Update and install archiso + OrionOS build dependencies
RUN pacman -Syu --noconfirm && \
pacman -S --noconfirm \
archiso \
syslinux \
base-devel \
git \
libx11 \
libxft \
libxfixes \
libxext \
libpng \
imlib2 \
dbus \
pam \
fontconfig \
freetype2 \
xorg-server \
xorg-xinit \
feh \
picom \
alsa-utils \
ttf-dejavu \
noto-fonts \
pkgconf && \
pacman -Scc --noconfirm
WORKDIR /build
# Copy OrionOS source
COPY . /build/orionos
# Bootstrap boot loader configs from the installed archiso releng profile.
# Copy only the .c32 binary modules — our repo provides syslinux.cfg.
# efiboot/ is needed for systemd-boot UEFI; fall back to a minimal loader.conf.
# Copy archiso initcpio hook files directly into airootfs so mkinitcpio
# finds them even if the package-based install path differs at build time.
RUN mkdir -p /build/orionos/iso/profile/airootfs/usr/lib/initcpio/hooks \
/build/orionos/iso/profile/airootfs/usr/lib/initcpio/install && \
cp /usr/lib/initcpio/hooks/archiso \
/build/orionos/iso/profile/airootfs/usr/lib/initcpio/hooks/archiso && \
cp /usr/lib/initcpio/install/archiso \
/build/orionos/iso/profile/airootfs/usr/lib/initcpio/install/archiso
RUN mkdir -p /build/orionos/iso/profile/syslinux && \
cp /usr/share/archiso/configs/releng/syslinux/*.c32 \
/build/orionos/iso/profile/syslinux/ 2>/dev/null || true && \
if [ -d /usr/share/archiso/configs/releng/efiboot ]; then \
cp -r /usr/share/archiso/configs/releng/efiboot \
/build/orionos/iso/profile/; \
else \
mkdir -p /build/orionos/iso/profile/efiboot/loader/entries && \
printf 'timeout 4\ndefault arch-*\n' \
> /build/orionos/iso/profile/efiboot/loader/loader.conf; \
fi
# Build OrionOS components (full output — no tail so errors are visible)
RUN cd /build/orionos && make
# Install binaries into the staging root that archiso will include
RUN cd /build/orionos && \
install -Dm755 wm/orionwm /build/orionos/iso/profile/airootfs/usr/local/bin/orionwm && \
install -Dm755 deskbar/oriondeskbar /build/orionos/iso/profile/airootfs/usr/local/bin/oriondeskbar && \
install -Dm755 launcher/orionlauncher /build/orionos/iso/profile/airootfs/usr/local/bin/orionlauncher && \
install -Dm755 themes/orionwallpaper /build/orionos/iso/profile/airootfs/usr/local/bin/orionwallpaper && \
install -Dm755 orionnotify/orionnotify /build/orionos/iso/profile/airootfs/usr/local/bin/orionnotify && \
install -Dm755 orionlock/orionlock /build/orionos/iso/profile/airootfs/usr/local/bin/orionlock && \
install -Dm755 orionshot/orionshot /build/orionos/iso/profile/airootfs/usr/local/bin/orionshot && \
install -Dm755 orionclip/orionclip /build/orionos/iso/profile/airootfs/usr/local/bin/orionclip && \
install -Dm755 orionpkg/orionpkg /build/orionos/iso/profile/airootfs/usr/local/bin/orionpkg && \
mkdir -p /build/orionos/iso/profile/airootfs/usr/share/themes/ && \
cp -r themes/OrionOS /build/orionos/iso/profile/airootfs/usr/share/themes/ && \
install -Dm644 themes/picom.conf /build/orionos/iso/profile/airootfs/etc/orionos/picom.conf
# Generate default wallpaper
RUN mkdir -p /build/orionos/iso/profile/airootfs/usr/share/orionos/wallpapers && \
bash /build/orionos/themes/wallpapers/generate-default.sh 2>/dev/null && \
cp -f /build/orionos/themes/wallpapers/orionos-default.png \
/build/orionos/iso/profile/airootfs/usr/share/orionos/wallpapers/ 2>/dev/null || true
# Build the ISO at container runtime — mkarchiso needs --privileged (from docker run)
# Output goes to /dist which build-iso.sh mounts from the host.
CMD mkarchiso -v \
-w /tmp/iso-work \
-o /dist \
/build/orionos/iso/profile