Skip to content

Commit

Permalink
feat: Add image-info.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
zelikos committed Jun 15, 2024
1 parent 5f2afcd commit b0ad191
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,13 @@ FROM ghcr.io/ublue-os/${SOURCE_IMAGE}${SOURCE_SUFFIX}:${SOURCE_TAG}
## the following RUN directive does all the things required to run "build.sh" as recommended.

COPY packages.sh /tmp/packages.sh
COPY image-info.sh /tmp/image-info.sh

COPY system_files/shared /

RUN mkdir -p /var/lib/alternatives && \
/tmp/packages.sh && \
/tmp/image-info.sh && \
ostree container commit

# GNOME modifications
Expand Down
34 changes: 34 additions & 0 deletions image-info.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#!/usr/bin/env bash

# Tell this script to exit if there are any errors.
# You should have this in every custom script, to ensure that your completed
# builds actually ran successfully without any errors!
set -oue pipefail

IMAGE_INFO="/usr/share/zeliblue/image-info.json"
IMAGE_VENDOR="zelikos"
IMAGE_REF="ostree-image-signed:docker://ghcr.io/$IMAGE_VENDOR/$IMAGE_NAME"
IMAGE_FLAVOR=""
IMAGE_TAG="latest"

if grep -q "kinoite" <<< "${SOURCE_IMAGE}"; then
sed -i '/^PRETTY_NAME/s/Kinoite/Zeliblue Plasma/' /usr/lib/os-release
sed -i '/^VERSION/s/Kinoite/Zeliblue Plasma/' /usr/lib/os-release
IMAGE_FLAVOR="kinoite"
else
sed -i '/^PRETTY_NAME/s/Silverblue/Zeliblue GNOME/' /usr/lib/os-release
sed -i '/^VERSION/s/Silverblue/Zeliblue GNOME/' /usr/lib/os-release
IMAGE_FLAVOR="silverblue"
fi

cat > $IMAGE_INFO <<EOF
{
"image-name": "$IMAGE_NAME",
"image-flavor": "$IMAGE_FLAVOR",
"image-vendor": "$IMAGE_VENDOR",
"image-ref": "$IMAGE_REF",
"image-tag":"$IMAGE_TAG",
"base-image-name": "$BASE_IMAGE",
"fedora-version": "$OS_VERSION"
}
EOF

0 comments on commit b0ad191

Please sign in to comment.