-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbranding.sh
More file actions
executable file
·57 lines (50 loc) · 1.71 KB
/
branding.sh
File metadata and controls
executable file
·57 lines (50 loc) · 1.71 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/usr/bin/bash
set ${SET_X:+-x} -eou pipefail
if [[ "${IMAGE}" =~ ucore ]]; then
tee /usr/share/ublue-os/image-info.json <<'EOF'
{
"image-name": "",
"image-flavor": "",
"image-vendor": "bsherman",
"image-ref": "ostree-image-signed:docker://ghcr.io/bsherman/bos",
"image-tag": "",
"base-image-name": "",
"fedora-version": ""
}
EOF
fi
case "${IMAGE}" in
"bazzite"* | "bluefin"*)
base_image="silverblue"
;;
"aurora"*)
base_image="kinoite"
;;
"ucore"*)
# shellcheck disable=SC2153
base_image="${BASE_IMAGE}"
;;
esac
image_flavor="main"
if [[ "$IMAGE" =~ nvidia ]]; then
image_flavor="nvidia"
fi
# Branding
cat <<<"$(jq ".\"image-name\" |= \"bos\" |
.\"image-flavor\" |= \"${image_flavor}\" |
.\"image-vendor\" |= \"bsherman\" |
.\"image-ref\" |= \"ostree-image-signed:docker://ghcr.io/bsherman/bos\" |
.\"image-tag\" |= \"${IMAGE}${BETA:-}\" |
.\"base-image-name\" |= \"${base_image}\" |
.\"fedora-version\" |= \"$(rpm -E %fedora)\"" \
</usr/share/ublue-os/image-info.json)" \
>/tmp/image-info.json
cp /tmp/image-info.json /usr/share/ublue-os/image-info.json
if [[ "$IMAGE" =~ bazzite ]]; then
sed -i 's/image-branch/image-tag/' /usr/libexec/bazzite-fetch-image
fi
sed -i "s|^PRETTY_NAME=.*|PRETTY_NAME=\"$(echo "${IMAGE^}" | cut -d - -f1) (Version: ${VERSION} / FROM ${BASE_IMAGE^} $(rpm -E %fedora))\"|" /usr/lib/os-release
sed -i "s|^VERSION=.*|VERSION=\"${VERSION} (${base_image^})\"|" /usr/lib/os-release
sed -i "s|^OSTREE_VERSION=.*|OSTREE_VERSION=\'${VERSION}\'|" /usr/lib/os-release
echo "IMAGE_ID=\"${IMAGE}\"" >>/usr/lib/os-release
echo "IMAGE_VERSION=\"${VERSION}\"" >>/usr/lib/os-release