Skip to content

Commit

Permalink
chore: Prefer bootc over rpm-ostree for update & rebase/switch co…
Browse files Browse the repository at this point in the history
…mmand
  • Loading branch information
fiftydinar authored Dec 21, 2024
1 parent d5c0cdd commit 71f0554
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
22 changes: 22 additions & 0 deletions files/scripts/prefer-bootc-over-rpm-ostree.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/usr/bin/env bash

set -euo pipefail

cat << EOF > /etc/profile.d/prefer-bootc-over-rpm-ostree.sh
# Prefer 'bootc update/upgrade' & 'bootc switch' over rpm-ostree's equivalent functionality
rpm-ostree() {
if [[ ${#} -eq 0 ]]; then
/usr/bin/rpm-ostree
elif [[ -n "$(awk '/(^|\s)('update'|'upgrade')($|\s)/' <<< "${@}")" ]]; then
echo "ERROR: Don't use 'rpm-ostree update/upgrade', use 'sudo bootc update/upgrade' instead."
echo " Some functionality like kargs.d is only available when using bootc, hence why Gidro-OS slowly deprecates using rpm-ostree."
elif [[ -n "$(awk '/(^|\s)('rebase')($|\s)/' <<< "${@}")" ]]; then
echo "ERROR: Don't use 'rpm-ostree rebase', use 'sudo bootc switch' instead."
echo " Some functionality like kargs.d is only available when using bootc, hence why Gidro-OS slowly deprecates using rpm-ostree."
else
/usr/bin/rpm-ostree "${@}"
fi
}
export -f rpm-ostree
EOF
1 change: 1 addition & 0 deletions recipes/module-recipes/scripts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ scripts:
- morewaita.sh
- sleep-through-notifications.sh
- disable-layering.sh
- prefer-bootc-over-rpm-ostree.sh
- hardened-chromium-disable-network-sandbox.sh

snippets:
Expand Down

0 comments on commit 71f0554

Please sign in to comment.