init
This commit is contained in:
commit
64e66af0eb
4 changed files with 100 additions and 0 deletions
30
bls-add-bluefin.sh
Executable file
30
bls-add-bluefin.sh
Executable file
|
|
@ -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
|
||||
6
bluefin-icons.conf
Normal file
6
bluefin-icons.conf
Normal file
|
|
@ -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
|
||||
BIN
bluefin.png
Normal file
BIN
bluefin.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
64
readme.md
Normal file
64
readme.md
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
<img src="bluefin.png" width="48" height="48">
|
||||
|
||||
# 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/<theme>/icons`
|
||||
|
||||
### 2. Copy bluefin icon to that folder
|
||||
|
||||
```bash
|
||||
sudo cp bluefin.png /boot/grub2/themes/<theme>/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
|
||||
|
||||
```
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue