Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add os-release changes from Bazzite #1708

Merged
merged 2 commits into from
Sep 28, 2024
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
5 changes: 5 additions & 0 deletions .github/workflows/reusable-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,10 @@ jobs:
io.artifacthub.package.readme-url=https://raw.githubusercontent.com/ublue-os/bluefin/bluefin/README.md
io.artifacthub.package.logo-url=https://avatars.githubusercontent.com/u/120078124?s=200&v=4

- name: Define env.SHA_HEAD_SHORT
run: |
echo "SHA_HEAD_SHORT=${GITHUB_SHA::7}" >> $GITHUB_ENV

- name: Pull images
if: github.event_name == 'pull_request' && ( matrix.image_flavor == 'main' || matrix.image_flavor == 'nvidia' ) || github.event_name != 'pull_request'
uses: Wandalen/wretry.action@6feedb7dedadeb826de0f45ff482b53b379a7844 # v3.5.0
Expand Down Expand Up @@ -342,6 +346,7 @@ jobs:
BUILD_ARGS+=("--build-arg" "NVIDIA_TYPE=${{ env.nvidia_type }}")
BUILD_ARGS+=("--build-arg" "KERNEL=${{ env.kernel_release }}")
BUILD_ARGS+=("--build-arg" "UBLUE_IMAGE_TAG=${{ matrix.fedora_version }}")
BUILD_ARGS+=("--build-arg" "SHA_HEAD_SHORT=${{ env.SHA_HEAD_SHORT }}")

TAG_ARGS=()
IFS=' ' read -r -a tags_array <<< "${{ steps.generate-tags.outputs.alias_tags }}"
Expand Down
4 changes: 3 additions & 1 deletion Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ ARG TARGET_BASE="${TARGET_BASE:-bluefin}"
ARG NVIDIA_TYPE="${NVIDIA_TYPE:-}"
ARG KERNEL="${KERNEL:-6.9.7-200.fc40.x86_64}"
ARG UBLUE_IMAGE_TAG="${UBLUE_IMAGE_TAG:-latest}"
ARG SHA_HEAD_SHORT="${SHA_HEAD_SHORT}"

# FROM's for Mounting
ARG KMOD_SOURCE_COMMON="ghcr.io/ublue-os/akmods:${AKMODS_FLAVOR}-${FEDORA_MAJOR_VERSION}"
Expand All @@ -34,7 +35,7 @@ ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION}"
ARG NVIDIA_TYPE="${NVIDIA_TYPE:-}"
ARG KERNEL="${KERNEL:-6.9.7-200.fc40.x86_64}"
ARG UBLUE_IMAGE_TAG="${UBLUE_IMAGE_TAG:-latest}"

ARG SHA_HEAD_SHORT="${SHA_HEAD_SHORT}"

# Build, cleanup, commit.
RUN --mount=type=cache,dst=/var/cache/rpm-ostree \
Expand Down Expand Up @@ -65,6 +66,7 @@ ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION}"
ARG NVIDIA_TYPE="${NVIDIA_TYPE:-}"
ARG KERNEL="${KERNEL:-6.9.7-200.fc40.x86_64}"
ARG UBLUE_IMAGE_TAG="${UBLUE_IMAGE_TAG:-latest}"
ARG SHA_HEAD_SHORT="${SHA_HEAD_SHORT}"

# Build, Clean-up, Commit
RUN --mount=type=cache,dst=/var/cache/rpm-ostree \
Expand Down
11 changes: 11 additions & 0 deletions build_files/copr-repos.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,17 @@ if [[ "${BASE_IMAGE_NAME}" = "silverblue" && "${FEDORA_MAJOR_VERSION}" -gt "39"
mutter-common
fi

# Fix for ID in fwupd
if [[ "${FEDORA_MAJOR_VERSION}" -gt "39" ]]; then
rpm-ostree override replace \
--experimental \
--from repo=copr:copr.fedorainfracloud.org:ublue-os:staging \
fwupd \
fwupd-plugin-flashrom \
fwupd-plugin-modem-manager \
fwupd-plugin-uefi-capsule-data
fi

# Switcheroo patch
rpm-ostree override replace \
--experimental \
Expand Down
35 changes: 34 additions & 1 deletion build_files/image-info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,26 @@

set -ouex pipefail

IMAGE_PRETTY_NAME="Bluefin"
IMAGE_LIKE="fedora"
HOME_URL="https://projectbluefin.io"
DOCUMENTATION_URL="https://docs.projectbluefin.io"
SUPPORT_URL="https://github.com/ublue-os/bluefin/issues/"
BUG_SUPPORT_URL="https://github.com/ublue-os/bluefin/issues/"
CODE_NAME="Archaeopteryx"

IMAGE_INFO="/usr/share/ublue-os/image-info.json"
IMAGE_REF="ostree-image-signed:docker://ghcr.io/$IMAGE_VENDOR/$IMAGE_NAME"

#shellcheck disable=SC2153
image_flavor="${IMAGE_FLAVOR}"

# Aurora
if [[ "${BASE_IMAGE_NAME}" == "kinoite" ]]; then
IMAGE_PRETTY_NAME="Aurora"
HOME_URL="https://getaurora.dev/"
fi

if [[ "${NVIDIA_TYPE}" == "nvidia" ]]; then
image_flavor="nvidia"
fi
Expand All @@ -24,4 +38,23 @@ cat > $IMAGE_INFO <<EOF
}
EOF

sed -i "s/VARIANT_ID.*/VARIANT_ID=$IMAGE_NAME/" /etc/os-release
# OS Release File
sed -i "s/^VARIANT_ID=.*/VARIANT_ID=$IMAGE_NAME/" /usr/lib/os-release
sed -i "s/^PRETTY_NAME=.*/PRETTY_NAME=\"Bluefin $FEDORA_MAJOR_VERSION (FROM Fedora ${BASE_IMAGE_NAME^})\"/" /usr/lib/os-release
sed -i "s/^NAME=.*/NAME=\"$IMAGE_PRETTY_NAME\"/" /usr/lib/os-release
sed -i "s|^HOME_URL=.*|HOME_URL=\"$HOME_URL\"|" /usr/lib/os-release
sed -i "s|^DOCUMENTATION_URL=.*|DOCUMENTATION_URL=\"$DOCUMENTATION_URL\"|" /usr/lib/os-release
sed -i "s|^SUPPORT_URL=.*|SUPPORT_URL=\"$SUPPORT_URL\"|" /usr/lib/os-release
sed -i "s|^BUG_REPORT_URL=.*|BUG_REPORT_URL=\"$BUG_SUPPORT_URL\"|" /usr/lib/os-release
sed -i "s|^CPE_NAME=\"cpe:/o:fedoraproject:fedora|CPE_NAME=\"cpe:/o:universal-blue:${IMAGE_PRETTY_NAME,}|" /usr/lib/os-release
sed -i "s/^DEFAULT_HOSTNAME=.*/DEFAULT_HOSTNAME=\"${IMAGE_PRETTY_NAME,}\"/" /usr/lib/os-release
sed -i "s/^ID=fedora/ID=${IMAGE_PRETTY_NAME,}\nID_LIKE=\"${IMAGE_LIKE}\"/" /usr/lib/os-release
sed -i "/^REDHAT_BUGZILLA_PRODUCT=/d; /^REDHAT_BUGZILLA_PRODUCT_VERSION=/d; /^REDHAT_SUPPORT_PRODUCT=/d; /^REDHAT_SUPPORT_PRODUCT_VERSION=/d" /usr/lib/os-release
sed -i "s|^VERSION_CODENAME=.*|VERSION_CODENAME=\"$CODE_NAME\"|" /usr/lib/os-release

if [[ -n "${SHA_HEAD_SHORT:-}" ]]; then
echo "BUILD_ID=\"$SHA_HEAD_SHORT\"" >> /usr/lib/os-release
fi

# Fix issues caused by ID no longer being fedora
sed -i "s/^EFIDIR=.*/EFIDIR=\"fedora\"/" /usr/sbin/grub2-switch-to-blscfg
Loading