From f8ee64c130300543905f7182d8a2ca3cdacd55cc Mon Sep 17 00:00:00 2001 From: Eriq Taing Date: Fri, 13 Jun 2025 23:14:09 -0400 Subject: [PATCH] Added image info --- files/scripts/addimageinfo.sh | 40 ++++++++++++++++++++++++++++++ recipes/components/base-module.yml | 4 +++ 2 files changed, 44 insertions(+) create mode 100644 files/scripts/addimageinfo.sh diff --git a/files/scripts/addimageinfo.sh b/files/scripts/addimageinfo.sh new file mode 100644 index 0000000..de46de4 --- /dev/null +++ b/files/scripts/addimageinfo.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash + +# Tell build process to exit if there are any errors. +set -oue pipefail + +# This file includes code from Universal Blue which is licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" +# BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language +# governing permissions and limitations under the License. + +IMAGE_PRETTY_NAME="hydro-os" +IMAGE_LIKE="fedora" +HOME_URL="https://git.hydrosaber.com/eriq12/hydro-os" +DOCUMENTATION_URL="https://git.hydrosaber.com/eriq12/hydro-os" +SUPPORT_URL="https://git.hydrosaber.com/eriq12/hydro-os/issues" +BUG_SUPPORT_URL="https://git.hydrosaber.com/eriq12/hydro-os/issues" + +if grep -q "VARIANT_ID" /usr/lib/os-release; then + sed -i "s/^VARIANT_ID=.*/VARIANT_ID=$IMAGE_NAME/" /usr/lib/os-release +else + echo "VARIANT_ID=$IMAGE_NAME" >> /usr/lib/os-release +fi +sed -i "s/^PRETTY_NAME=.*/PRETTY_NAME=\"${IMAGE_PRETTY_NAME} (powered by Fedora Atomic)\"/" /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:wayblue:${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_LIKE,}\"\nID_LIKE=\"${IMAGE_PRETTY_NAME,}\"/" /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 + +# Fix issues caused by ID no longer being fedora +sed -i "s/^EFIDIR=.*/EFIDIR=\"fedora\"/" /usr/sbin/grub2-switch-to-blscfg \ No newline at end of file diff --git a/recipes/components/base-module.yml b/recipes/components/base-module.yml index 31da3d6..1570c93 100644 --- a/recipes/components/base-module.yml +++ b/recipes/components/base-module.yml @@ -8,6 +8,10 @@ modules: - ublue-os-udev-rules - ublue-os-signing + - type: script + scripts: + - addimageinfo.sh + - type: systemd system: enabled: