Skip to content

Commit

Permalink
feat: Adapt image-info os-release stuff from Bazzite (#237)
Browse files Browse the repository at this point in the history
  • Loading branch information
zelikos authored Aug 2, 2024
1 parent 7058b8b commit ddc1f95
Showing 1 changed file with 22 additions and 5 deletions.
27 changes: 22 additions & 5 deletions files/scripts/image-info.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,21 @@
# builds actually ran successfully without any errors!
set -oue pipefail

IMAGE_PRETTY_NAME="Zeliblue"
HOME_URL="https://github.com/zelikos/zeliblue"
DOCUMENTATION_URL="https://github.com/zelikos/zeliblue/blob/main/README.md"
SUPPORT_URL="https://github.com/zelikos/zeliblue/issues"
BUG_REPORT_URL="https://github.com/zelikos/zeliblue/issues"

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" <<< "${BASE_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/' /usr/lib/os-release
sed -i '/^VERSION/s/Silverblue/Zeliblue/' /usr/lib/os-release
IMAGE_FLAVOR="silverblue"
fi

Expand All @@ -31,4 +33,19 @@ cat > $IMAGE_INFO <<EOF
"base-image-name": "$BASE_IMAGE",
"fedora-version": "$OS_VERSION"
}
EOF
EOF

# OS Release File
sed -i "s/^VARIANT_ID=.*/VARIANT_ID=$IMAGE_NAME/" /usr/lib/os-release
sed -i "s/^PRETTY_NAME=.*/PRETTY_NAME=\"Zeliblue (FROM Fedora ${IMAGE_FLAVOR^} $OS_VERSION)\"/" /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_REPORT_URL\"|" /usr/lib/os-release
sed -i "s|^CPE_NAME=\"cpe:/o:fedoraproject:fedora|CPE_NAME=\"cpe:/o:zelikos:${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=\"rhel centos fedora\"/" /usr/lib/os-release
# sed -i "s/^LOGO=.*/LOGO=$LOGO_ICON/" /usr/lib/os-release
# sed -i "s/^ANSI_COLOR=.*/ANSI_COLOR=\"$LOGO_COLOR\"/" /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

0 comments on commit ddc1f95

Please sign in to comment.