Init (#2)
* added grub2 theme, removed docker and code * removed grub stuff * removed docker and code, added flatpaks
This commit is contained in:
parent
f832d683ed
commit
a16562e24d
9 changed files with 145 additions and 33 deletions
|
|
@ -4,7 +4,3 @@
|
||||||
# You should have this in every custom script, to ensure that your completed
|
# You should have this in every custom script, to ensure that your completed
|
||||||
# builds actually ran successfully without any errors!
|
# builds actually ran successfully without any errors!
|
||||||
set -oue pipefail
|
set -oue pipefail
|
||||||
|
|
||||||
# Your code goes here.
|
|
||||||
echo 'This is an example shell script'
|
|
||||||
echo 'Scripts here will run during build if specified in recipe.yml'
|
|
||||||
|
|
|
||||||
14
files/system/etc/systemd/system/bluefin-icons-ensure.service
Normal file
14
files/system/etc/systemd/system/bluefin-icons-ensure.service
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
[Unit]
|
||||||
|
Description=Ensure Bluefin GRUB icon is installed when a GRUB theme exists
|
||||||
|
ConditionPathExists=/boot/grub2/user.cfg
|
||||||
|
After=local-fs.target
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
ExecStart=/usr/share/bluefin-icons/install.sh
|
||||||
|
SuccessExitStatus=0 3
|
||||||
|
StandardOutput=journal
|
||||||
|
StandardError=journal
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
../bluefin-icons-ensure.service
|
||||||
|
|
@ -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
|
||||||
30
files/system/usr/share/bluefin-icons/bls-add-bluefin.sh
Executable file
30
files/system/usr/share/bluefin-icons/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
files/system/usr/share/bluefin-icons/bluefin-icons.conf
Normal file
6
files/system/usr/share/bluefin-icons/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
files/system/usr/share/bluefin-icons/bluefin.png
Normal file
BIN
files/system/usr/share/bluefin-icons/bluefin.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.2 KiB |
46
files/system/usr/share/bluefin-icons/install.sh
Executable file
46
files/system/usr/share/bluefin-icons/install.sh
Executable file
|
|
@ -0,0 +1,46 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# Ensure we have root privileges before touching system paths.
|
||||||
|
if [[ "${EUID:-$(id -u)}" -ne 0 ]]; then
|
||||||
|
exec sudo -E "$0" "$@"
|
||||||
|
fi
|
||||||
|
|
||||||
|
script_dir="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd -P)"
|
||||||
|
|
||||||
|
# Resolve the active GRUB theme's icons directory from user.cfg.
|
||||||
|
find_icons_dir() {
|
||||||
|
local theme_line theme_dir
|
||||||
|
theme_line="$(awk -F= '/set[[:space:]]+theme=/ {print $2; exit}' /boot/grub2/user.cfg 2>/dev/null | tr -d '"' || true)"
|
||||||
|
[[ -n "$theme_line" ]] || return 1
|
||||||
|
theme_dir="${theme_line%/*}"
|
||||||
|
echo "${theme_dir}/icons"
|
||||||
|
}
|
||||||
|
|
||||||
|
icons_dir="$(find_icons_dir || true)"
|
||||||
|
|
||||||
|
# Abort (soft) if we cannot locate the theme icons directory.
|
||||||
|
if [[ -z "$icons_dir" || ! -d "$icons_dir" ]]; then
|
||||||
|
echo "Could not find GRUB theme icons directory. Ensure /boot/grub2/user.cfg contains a theme= entry. Skipping." >&2
|
||||||
|
exit 3
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Drop the Bluefin icon into the active theme.
|
||||||
|
echo "Copying Bluefin icon to ${icons_dir}"
|
||||||
|
install -m 644 -D "${script_dir}/bluefin.png" "${icons_dir}/bluefin.png"
|
||||||
|
|
||||||
|
# Install the helper that ensures grub_class bluefin exists.
|
||||||
|
echo "Installing helper script to /usr/local/sbin"
|
||||||
|
install -m 755 "${script_dir}/bls-add-bluefin.sh" /usr/local/sbin/bls-add-bluefin.sh
|
||||||
|
|
||||||
|
# Add the rpm-ostree hook and reload systemd.
|
||||||
|
echo "Installing systemd drop-in for rpm-ostree hook"
|
||||||
|
install -m 644 -D "${script_dir}/bluefin-icons.conf" /etc/systemd/system/ostree-finalize-staged.service.d/bluefin-icons.conf
|
||||||
|
systemctl daemon-reload
|
||||||
|
|
||||||
|
# Immediately apply the Bluefin class to existing BLS entries.
|
||||||
|
echo "Applying grub_class bluefin to existing BLS entries"
|
||||||
|
/usr/local/sbin/bls-add-bluefin.sh
|
||||||
|
|
||||||
|
# Report completion.
|
||||||
|
echo "Done. New deployments will keep the Bluefin GRUB icon."
|
||||||
|
|
@ -11,35 +11,48 @@ image-version: latest # latest is also supported if you want new updates ASAP
|
||||||
|
|
||||||
# module configuration, executed in order
|
# module configuration, executed in order
|
||||||
# you can include multiple instances of the same module
|
# you can include multiple instances of the same module
|
||||||
# modules:
|
modules:
|
||||||
# - type: files
|
- type: files
|
||||||
# files:
|
files:
|
||||||
# - source: system
|
- source: system
|
||||||
# destination: / # copies files/system/* (* means everything inside it) into your image's root folder /
|
destination: / # copies files/system/* (* means everything inside it) into your image's root folder /
|
||||||
|
|
||||||
# - type: dnf
|
- type: dnf
|
||||||
# repos:
|
install:
|
||||||
# copr:
|
packages:
|
||||||
# - atim/starship
|
- syncthing
|
||||||
# install:
|
- waydroid
|
||||||
# packages:
|
remove:
|
||||||
# - micro
|
packages:
|
||||||
# - starship
|
- android-tools
|
||||||
# remove:
|
- cockpit-bridge
|
||||||
# packages:
|
- cockpit-machines
|
||||||
# # example: removing firefox (in favor of the flatpak)
|
- cockpit-networkmanager
|
||||||
# # "firefox" is the main package, "firefox-langpacks" is a dependency
|
- cockpit-ostree
|
||||||
# - firefox
|
- cockpit-podman
|
||||||
# - firefox-langpacks # also remove firefox dependency (not required for all packages, this is a special case)
|
- cockpit-selinux
|
||||||
|
- cockpit-storaged
|
||||||
|
- cockpit-system
|
||||||
|
- code
|
||||||
|
- docker-ce
|
||||||
|
- docker-ce-cli
|
||||||
|
- docker-ce-rootless-extras
|
||||||
|
- docker-compose-plugin
|
||||||
|
- docker-model-plugin
|
||||||
|
- containerd
|
||||||
|
- moby-engine
|
||||||
|
|
||||||
# - type: default-flatpaks
|
- type: default-flatpaks
|
||||||
# configurations:
|
configurations:
|
||||||
# - notify: true # Send notification after install/uninstall is finished (true/false)
|
- notify: true # Send notification after install/uninstall is finished (true/false)
|
||||||
# scope: system
|
scope: system
|
||||||
# # If no repo information is specified, Flathub will be used by default
|
# If no repo information is specified, Flathub will be used by default
|
||||||
# install: # system flatpaks we want all users to have and not remove
|
install: # system flatpaks we want all users to have and not remove
|
||||||
# - org.mozilla.firefox
|
- net.waterfox.waterfox
|
||||||
# - org.gnome.Loupe
|
- com.vscodium.codium
|
||||||
# - scope: user # Also add Flathub user repo, but no user packages
|
- org.telegram.desktop
|
||||||
|
remove: # replace default Firefox with Waterfox
|
||||||
|
- org.mozilla.firefox
|
||||||
|
- scope: user # Also add Flathub user repo, but no user packages
|
||||||
|
|
||||||
- type: signing # this sets up the proper policy & signing files for signed images to work fully
|
- type: signing # this sets up the proper policy & signing files for signed images to work fully
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue