Skip to content

Commit

Permalink
Merge branch 'main' into castrojo-patch-4
Browse files Browse the repository at this point in the history
  • Loading branch information
m2Giles authored Jul 17, 2024
2 parents 26315d4 + 58074fa commit c5cb000
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 23 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/reusable-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ concurrency:
jobs:
build_container:
name: image
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
continue-on-error: false
outputs:
image_full: ${{ steps.generate-outputs.outputs.image }}
Expand Down Expand Up @@ -163,6 +163,11 @@ jobs:
with:
containers: akmods-nvidia:${{ env.AKMODS_FLAVOR}}-${{ env.fedora_version }}

- name: Verify ZFS
uses: EyeCantCU/cosign-action/verify@58722a084c82190b57863002d494c91eabbe9e79 # v0.3.0
with:
containers: akmods-zfs:coreos-stable-${{ env.fedora_version }}

- name: Verify Kernel Cache
uses: EyeCantCU/cosign-action/verify@58722a084c82190b57863002d494c91eabbe9e79 # v0.3.0
with:
Expand Down Expand Up @@ -311,6 +316,7 @@ jobs:
podman pull ${{ env.IMAGE_REGISTRY }}/${{ env.BASE_IMAGE_NAME }}-${{ env.image_flavor }}:${{ env.fedora_version }}
podman pull ${{ env.IMAGE_REGISTRY }}/akmods:${{ env.AKMODS_FLAVOR }}-${{ env.fedora_version }}
podman pull ${{ env.IMAGE_REGISTRY }}/akmods-nvidia:${{ env.AKMODS_FLAVOR }}-${{ env.fedora_version }}
podman pull ${{ env.IMAGE_REGISTRY }}/akmods-zfs:coreos-stable-${{ env.fedora_version }}
podman pull ${{ env.IMAGE_REGISTRY }}/${{ env.AKMODS_FLAVOR }}-kernel:${{ env.kernel_release }}
# Build image using Buildah action
Expand Down
25 changes: 17 additions & 8 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ ARG UBLUE_IMAGE_TAG="${UBLUE_IMAGE_TAG:-latest}"

# FROM's for copying
ARG KMOD_SOURCE_COMMON="ghcr.io/ublue-os/akmods:${AKMODS_FLAVOR}-${FEDORA_MAJOR_VERSION}"
ARG ZFS_CACHE="ghcr.io/ublue-os/akmods-zfs:coreos-stable-${FEDORA_MAJOR_VERSION}"
ARG NVIDIA_CACHE="ghcr.io/ublue-os/akmods-nvidia:${AKMODS_FLAVOR}-${FEDORA_MAJOR_VERSION}"
ARG KERNEL_CACHE="ghcr.io/ublue-os/${AKMODS_FLAVOR}-kernel:${KERNEL}"
FROM ${KMOD_SOURCE_COMMON} AS akmods
FROM ${ZFS_CACHE} AS zfs_cache
FROM ${NVIDIA_CACHE} AS nvidia_cache
FROM ${KERNEL_CACHE} AS kernel_cache

Expand All @@ -39,16 +41,21 @@ COPY packages.json /tmp/packages.json
# Copy ublue-update.toml to tmp first, to avoid being overwritten.
COPY /system_files/shared/usr/etc/ublue-update/ublue-update.toml /tmp/ublue-update.toml
# COPY ublue kmods, add needed negativo17 repo and then immediately disable due to incompatibility with RPMFusion
COPY --from=akmods /rpms /tmp/akmods-rpms
COPY --from=nvidia_cache /rpms /tmp/akmods-rpms
COPY --from=kernel_cache /tmp/rpms /tmp/kernel-rpms
# COPY --from=akmods /rpms /tmp/akmods-rpms
# COPY --from=nvidia_cache /rpms /tmp/akmods-rpms
# COPY --from=kernel_cache /tmp/rpms /tmp/kernel-rpms

# Build, cleanup, commit.
RUN rpm-ostree cliwrap install-to-root / && \
RUN --mount=type=bind,from=akmods,source=/rpms,target=/tmp/akmods \
--mount=type=bind,from=nvidia_cache,source=/rpms,target=/tmp/akmods-rpms \
--mount=type=bind,from=kernel_cache,source=/tmp/rpms,target=/tmp/kernel-rpms \
--mount=type=bind,from=zfs_cache,source=/rpms,target=/tmp/akmods-zfs \
rpm-ostree cliwrap install-to-root / && \
mkdir -p /var/lib/alternatives && \
bash -c ". /tmp/build/build-base.sh" && \
mv /var/lib/alternatives /staged-alternatives && \
rm -rf /tmp/* /var/* && \
rm -rf /tmp/* || true && \
rm -rf /var/* || true && \
ostree container commit && \
mkdir -p /var/lib && mv /staged-alternatives /var/lib/alternatives && \
mkdir -p /var/tmp && \
Expand All @@ -73,14 +80,16 @@ COPY system_files/dx /
COPY packages.json /tmp/packages.json

# Copy akmods from ublue
COPY --from=akmods /rpms /tmp/akmods-rpms
# COPY --from=akmods /rpms /tmp/akmods-rpms

# Build, Clean-up, Commit
RUN mkdir -p /var/lib/alternatives && \
RUN --mount=type=bind,from=akmods,source=/rpms,target=/tmp/akmods \
mkdir -p /var/lib/alternatives && \
bash -c ". /tmp/build/build-dx.sh" && \
fc-cache --system-only --really-force --verbose && \
mv /var/lib/alternatives /staged-alternatives && \
rm -rf /tmp/* /var/* && \
rm -rf /tmp/* || true && \
rm -rf /var/* || true && \
ostree container commit && \
mkdir -p /var/lib && mv /staged-alternatives /var/lib/alternatives && \
mkdir -p /var/tmp && \
Expand Down
15 changes: 7 additions & 8 deletions build_files/base/install-akmods.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,25 +20,24 @@ sed -i 's@enabled=0@enabled=1@g' /etc/yum.repos.d/_copr_ublue-os-akmods.repo

# Everyone
rpm-ostree install \
/tmp/akmods-rpms/kmods/*xpadneo*.rpm \
/tmp/akmods-rpms/kmods/*xone*.rpm \
/tmp/akmods-rpms/kmods/*openrazer*.rpm \
/tmp/akmods-rpms/kmods/*wl*.rpm \
/tmp/akmods-rpms/kmods/*v4l2loopback*.rpm
/tmp/akmods/kmods/*xpadneo*.rpm \
/tmp/akmods/kmods/*xone*.rpm \
/tmp/akmods/kmods/*openrazer*.rpm \
/tmp/akmods/kmods/*wl*.rpm \
/tmp/akmods/kmods/*v4l2loopback*.rpm
# /tmp/akmods-rpms/kmods/*framework-laptop*.rpm

# All but Asus
if grep -qv "asus" <<< "${AKMODS_FLAVOR}"; then
rpm-ostree install \
/tmp/akmods-rpms/kmods/*evdi*.rpm
/tmp/akmods/kmods/*evdi*.rpm
fi

sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/negativo17-fedora-multimedia.repo

# ZFS for gts/stable
if [[ ${AKMODS_FLAVOR} =~ "coreos" ]]; then
rpm-ostree install /tmp/akmods-rpms/kmods/zfs/*.rpm \
pv
rpm-ostree install pv /tmp/akmods-zfs/kmods/zfs/*.rpm
depmod -a -v "${KERNEL}"
echo "zfs" > /usr/lib/modules-load.d/zfs.conf
fi
2 changes: 1 addition & 1 deletion build_files/dx/install-akmods-dx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@ set -ouex pipefail
sed -i 's@enabled=0@enabled=1@g' /etc/yum.repos.d/_copr_ublue-os-akmods.repo
if [[ "${FEDORA_MAJOR_VERSION}" -ge "39" ]]; then
rpm-ostree install \
/tmp/akmods-rpms/kmods/*kvmfr*.rpm
/tmp/akmods/kmods/*kvmfr*.rpm
fi
10 changes: 5 additions & 5 deletions scripts/build-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ version=$3

# Get Fedora Version and Kernel Info
if [[ "${version}" == "stable" ]]; then
KERNEL_RELEASE=$(skopeo inspect docker://quay.io/fedora/fedora-coreos:stable | jq -r '.Labels["ostree.linux"] | split(".x86_64")[0]')
KERNEL_RELEASE=$(skopeo inspect docker://quay.io/fedora/fedora-coreos:stable | jq -r '.Labels["ostree.linux"]')
fedora_version=$(echo "$KERNEL_RELEASE" | grep -oP 'fc\K[0-9]+')
elif [[ ${version} == "gts" ]]; then
coreos_kernel_release=$(skopeo inspect docker://quay.io/fedora/fedora-coreos:stable | jq -r '.Labels["ostree.linux"] | split(".x86_64")[0]')
coreos_kernel_release=$(skopeo inspect docker://quay.io/fedora/fedora-coreos:stable | jq -r '.Labels["ostree.linux"]')
major_minor_patch=$(echo "$coreos_kernel_release" | cut -d '-' -f 1)
coreos_fedora_version=$(echo "$coreos_kernel_release" | grep -oP 'fc\K[0-9]+')
KERNEL_RELEASE="${major_minor_patch}-200.fc$(("$coreos_fedora_version" - 1))"
KERNEL_RELEASE="${major_minor_patch}-200.fc$(("$coreos_fedora_version" - 1)).$(uname -m)"
else
KERNEL_RELEASE=$(skopeo inspect docker://ghcr.io/ublue-os/silverblue-main:"${version}" | jq -r '.Labels["ostree.linux"] | split(".x86_64")[0]')
KERNEL_RELEASE=$(skopeo inspect docker://ghcr.io/ublue-os/silverblue-main:"${version}" | jq -r '.Labels["ostree.linux"]')
fi

fedora_version=$(echo "$KERNEL_RELEASE" | grep -oP 'fc\K[0-9]+')
Expand All @@ -40,7 +40,7 @@ akmods_flavor=main
if [[ "${version}" == "gts" || \
"${version}" == "stable" ]]; then
nvidia_type="main"
akmods_flavor=coreos
akmods_flavor=coreos-stable
fi


Expand Down

0 comments on commit c5cb000

Please sign in to comment.