From 64e66af0ebad24a873486d4ceaae56f76ae30467 Mon Sep 17 00:00:00 2001 From: randogoth Date: Mon, 13 Oct 2025 16:40:30 +0300 Subject: [PATCH] init --- bls-add-bluefin.sh | 30 +++++++++++++++++++++ bluefin-icons.conf | 6 +++++ bluefin.png | Bin 0 -> 1231 bytes readme.md | 64 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 100 insertions(+) create mode 100755 bls-add-bluefin.sh create mode 100644 bluefin-icons.conf create mode 100644 bluefin.png create mode 100644 readme.md diff --git a/bls-add-bluefin.sh b/bls-add-bluefin.sh new file mode 100755 index 0000000..aae1797 --- /dev/null +++ b/bls-add-bluefin.sh @@ -0,0 +1,30 @@ +#!/usr/bin/env bash +set -euo pipefail +shopt -s nullglob + +entries_dir="/boot/loader/entries" + +for f in "$entries_dir"/ostree-*.conf "$entries_dir"/*-ostree-*.conf; do + [ -f "$f" ] || continue + + # Already correct? skip + if grep -qxE 'grub_class[[:space:]]+bluefin' "$f"; then + continue + fi + + tmp="$(mktemp)" + if grep -qE '^grub_class[[:space:]]+' "$f"; then + sed -E 's/^grub_class[[:space:]].*/grub_class bluefin/' "$f" >"$tmp" + else + awk '1; /^title[[:space:]]/{print "grub_class bluefin";}' "$f" >"$tmp" + fi + + if ! cmp -s "$f" "$tmp"; then + chmod --reference="$f" "$tmp" + chown --reference="$f" "$tmp" + command -v chcon >/dev/null 2>&1 && chcon --reference="$f" "$tmp" 2>/dev/null || true + mv -f "$tmp" "$f" + else + rm -f "$tmp" + fi +done diff --git a/bluefin-icons.conf b/bluefin-icons.conf new file mode 100644 index 0000000..c21ab4c --- /dev/null +++ b/bluefin-icons.conf @@ -0,0 +1,6 @@ +[Service] +ExecStartPost= +ExecStopPost=/usr/bin/bash --noprofile --norc -lc '/usr/local/sbin/bls-add-bluefin.sh' +StandardOutput=journal +StandardError=journal +Environment=STARSHIP_LOG=off diff --git a/bluefin.png b/bluefin.png new file mode 100644 index 0000000000000000000000000000000000000000..3cd982be2573e8092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C;gP1)c5b>uQk82H!eIUlg8{lnWy~_Ts*?ewuti7e`{S8{&739_2EAlpU|{fc^>bP0l+XkKu + +# Auto GRUB Class Setup for Bluefin + +## Introduction + +GRUB themes display icons according to each entry's class. On some rpm-ostree systems, including Bluefin, new boot entries are created without a class, which means no icon is shown in the menu. + +This setup fixes that by adding a dedicated Bluefin icon to your active GRUB theme and installing a helper script that ensures every BootLoaderSpec (BLS) entry includes `grub_class bluefin`. With this in place, GRUB automatically picks up the correct icon and your Bluefin deployments appear with their own distinctive symbol in the boot menu. + +(Developed and tested on `bluefin-dx:latest-42.20251012.1`) + +## Acknowledgements + +This setup borrows the icon for the Bluefin GRUB [theme created by Raindrac](https://github.com/Raindrac/Banner/) and is inspired by and meant as a replacement for a previous [solution by Tomasz Drozdz](https://codeberg.org/TomaszDrozdz/Fedora-Silverblue-rpm-ostree-generate-grub-theme-icon-class). + +## Installation + +If you don't have a GRUB theme installed, [check these out](https://www.gnome-look.org/browse?cat=109&ord=latest). I am currently using [this one](https://www.gnome-look.org/p/2227016). + +### 1. Find the icons folder of your currently used GRUB theme + +```bash +sudo awk -F= '/set theme=/ {f=$2; sub(/\/[^/]*$/, "", f); print f "/icons"}' /boot/grub2/user.cfg +``` + +should print something like `"/boot/grub2/themes//icons` + +### 2. Copy bluefin icon to that folder + +```bash +sudo cp bluefin.png /boot/grub2/themes//icons/ +``` + +### 3. Install helper script + +```bash +sudo cp bls-add-bluefin.sh /usr/local/sbin/ +sudo chmod 755 /usr/local/sbin/bls-add-bluefin.sh +``` + +### 4. Install rpm-ostree hook + +```bash +sudo mkdir -p /etc/systemd/system/ostree-finalize-staged.service.d +sudo cp bluefin-icons.conf /etc/systemd/system/ostree-finalize-staged.service.d/ +``` + +### 5. (Optional) Test helper script + +```bash +sudo /usr/local/sbin/bls-add-bluefin.sh +grep -n '^grub_class' /boot/loader/entries/ostree*.conf + +# Expected Result + +/boot/loader/entries/ostree-1.conf + 2: grub_class bluefin + +/boot/loader/entries/ostree-2.conf + 2: grub_class bluefin + +``` +