Add Fedora 44 (GNOME) image support

New fedora distro: distrobuilder fedora-http recipe with full GNOME
desktop (GDM autologin), the PS5 IW620 internal WiFi modules built from
nxp-imx/mwifiex + ps5-linux-mwifiex, and an RPM packaging path for the
shared PS5 kernel (docker/kernel-builder-rpm).

Notable PS5-specific fix: the kernel patches write into the
request_firmware() buffer to skip the firmware signature header
(gfx_v10_0_early_init, amdgpu_sdma_init_microcode). Fedora ships
firmware xz-compressed, and the kernel maps xz-decompressed firmware
read-only (fw_decompress_xz_pages -> fw_map_paged_buf -> vmap
PAGE_KERNEL_RO), so the write oopses amdgpu before /dev/dri exists and
the display never comes up. Distros with zstd or uncompressed firmware
decompress into writable buffers, which is why only Fedora was
affected. The recipe therefore ships the cyan_skillfish GPU firmware
uncompressed, materializing linux-firmware's dedup symlinks first
(unxz refuses symlinks).

Also installs umoci/skopeo in the image builder (Fedora 41+ bases ship
as OCI archives) and wires fedora into build_image.sh (FORMAT=rpm) and
the image-builder entrypoint.

Tested on PS5 hardware: GNOME displays over HDMI, internal WiFi scans
and connects.

[skip ci]

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Bug Bounty Zip
2026-06-13 07:00:06 +08:00
parent 50d8ec0b03
commit ed54e99482
12 changed files with 484 additions and 7 deletions

View File

@@ -26,6 +26,12 @@ RUN mkdir -p /root/go/src/github.com/lxc/ && \
cp /root/go/bin/distrobuilder /usr/local/bin/ && \
rm -rf /root/go/src /root/go/pkg
# Fedora 41+ base images ship as OCI archives; distrobuilder's fedora-http
# downloader unpacks them with umoci/skopeo.
RUN apt-get update && apt-get install -y --no-install-recommends \
umoci skopeo \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /build
COPY docker/image-builder/entrypoint.sh /entrypoint.sh

View File

@@ -44,6 +44,12 @@ EOF
cp /repo/distros/${DISTRO}/kali-archive-keyring.asc "$STAGING/"
cp /kernel-debs/*.deb "$STAGING/debs/"
;;
fedora)
cp /repo/distros/${DISTRO}/grow-rootfs "$STAGING/"
cp /repo/distros/${DISTRO}/grow-rootfs.service "$STAGING/"
mkdir -p "$STAGING/rpms"
cp /kernel-debs/*.rpm "$STAGING/rpms/"
;;
arch)
cp /repo/distros/${DISTRO}/grow-rootfs "$STAGING/"
cp /repo/distros/arch/grow-rootfs.service "$STAGING/"
@@ -71,6 +77,7 @@ EOF
find "$STAGING" -type f \
! -path "$STAGING/debs/*" \
! -path "$STAGING/pkgs/*" \
! -path "$STAGING/rpms/*" \
-exec sed -i 's/\r$//' {} +
# --- Build rootfs ---

View File

@@ -0,0 +1,15 @@
FROM --platform=linux/amd64 fedora:44
# Only packaging tools needed — kernel is already compiled
RUN dnf install -y rpm-build kmod && dnf clean all
WORKDIR /out/staging
# Pre-built artifacts are bind-mounted at /out/staging
# Output packages go to /out
COPY docker/kernel-builder-rpm/build.sh /build.sh
COPY docker/kernel-builder-rpm/linux-ps5.spec /linux-ps5.spec
RUN chmod +x /build.sh
CMD ["/build.sh"]

View File

@@ -0,0 +1,49 @@
#!/bin/bash
# Packages pre-built kernel artifacts as an rpm.
# Runs inside Docker as root.
# Expects build artifacts staged in /out/staging by the kernel build step.
set -e
if [ ! -f /out/staging/boot/bzImage ]; then
echo "Error: no staged artifacts in /out/staging — run the kernel build step first"
exit 1
fi
# Determine version from staged modules directory
KVER=$(ls /out/staging/lib/modules/)
PKGNAME="linux-ps5"
VERSION=${KVER%%-*}
echo "==> Packaging kernel $KVER as rpm"
RPMROOT=$(mktemp -d)
STAGE="$RPMROOT/stage"
# Copy staged boot artifacts
mkdir -p "$STAGE/boot"
cp /out/staging/boot/bzImage "$STAGE/boot/vmlinuz-$KVER"
cp /out/staging/System.map "$STAGE/boot/System.map-$KVER"
cp /out/staging/.config "$STAGE/boot/config-$KVER"
# Copy pre-installed modules (Fedora uses /usr/lib/modules)
mkdir -p "$STAGE/usr/lib/modules"
cp -a "/out/staging/lib/modules/$KVER" "$STAGE/usr/lib/modules/"
# Build headers for out-of-tree module builds. UAPI headers (/usr/include)
# are intentionally excluded — they would conflict with Fedora's
# kernel-headers package.
if [ -d "/out/staging/headers/lib/modules/$KVER/build" ]; then
cp -a "/out/staging/headers/lib/modules/$KVER/build" \
"$STAGE/usr/lib/modules/$KVER/build"
fi
rpmbuild -bb \
--define "_topdir $RPMROOT/rpmbuild" \
--define "stagedir $STAGE" \
--define "kver $KVER" \
--define "ver $VERSION" \
/linux-ps5.spec
cp "$RPMROOT/rpmbuild/RPMS/x86_64/${PKGNAME}-${VERSION}-1.x86_64.rpm" /out/
echo "==> Done: /out/${PKGNAME}-${VERSION}-1.x86_64.rpm"

View File

@@ -0,0 +1,54 @@
# Binary repackaging of pre-built kernel artifacts — no compilation here.
# Invoked by build.sh with: stagedir, kver, ver defined.
%global debug_package %{nil}
%global _build_id_links none
%global __os_install_post %{nil}
%global __strip /bin/true
Name: linux-ps5
Version: %{ver}
Release: 1
Summary: PS5 Linux kernel %{kver} (image + modules + headers)
License: GPL-2.0-only
URL: https://kernel.org
ExclusiveArch: x86_64
AutoReqProv: no
Provides: kernel = %{ver}
Provides: kernel-core = %{ver}
Provides: kernel-modules = %{ver}
Provides: kernel-devel = %{ver}
%description
Linux kernel %{kver} with PlayStation 5 support patches
(https://github.com/ps5-linux/ps5-linux-patches).
%install
cp -a %{stagedir}/. %{buildroot}/
%files
/boot/vmlinuz-%{kver}
/boot/System.map-%{kver}
/boot/config-%{kver}
/usr/lib/modules/%{kver}
%post
echo ">> linux-ps5 post-install: kernel %{kver}"
depmod -a %{kver} || true
# Rebuild initramfs (hardware-independent — the build host is not the PS5)
if command -v dracut >/dev/null 2>&1; then
echo ">> Rebuilding initramfs with dracut for %{kver}"
dracut --force --no-hostonly "/boot/initrd.img-%{kver}" %{kver}
fi
# Copy kernel + initrd to EFI partition
if [ -d /boot/efi ]; then
echo ">> Copying /boot/vmlinuz-%{kver} -> /boot/efi/bzImage"
cp "/boot/vmlinuz-%{kver}" /boot/efi/bzImage
echo ">> Copying /boot/initrd.img-%{kver} -> /boot/efi/initrd.img"
cp "/boot/initrd.img-%{kver}" /boot/efi/initrd.img
echo ">> Kernel %{kver} deployed to /boot/efi"
else
echo ">> /boot/efi not found, skipping EFI deploy"
fi