Skip to content

Commit

Permalink
Fixed issue with custom rpm-ostree module not being used
Browse files Browse the repository at this point in the history
  • Loading branch information
Sparkrai committed Jan 11, 2025
1 parent 0fe31f9 commit 1b4a7dd
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 8 deletions.
Empty file removed modules/.gitkeep
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,32 @@ fi
# Create symlinks to fix packages that create directories in /opt
get_json_array OPTFIX 'try .["optfix"][]' "$1"
if [[ ${#OPTFIX[@]} -gt 0 ]]; then
LIB_EXEC_DIR="/usr/libexec/bluebuild"
SYSTEMD_DIR="/etc/systemd/system"
MODULE_DIR="/tmp/modules/rpm-ostree"

if ! [ -x "${LIB_EXEC_DIR}/optfix.sh" ]; then
mkdir -p "${LIB_EXEC_DIR}"
cp "${MODULE_DIR}/optfix.sh" "${LIB_EXEC_DIR}/"
chmod +x "${LIB_EXEC_DIR}/optfix.sh"
fi

if ! [ -f "${SYSTEMD_DIR}/bluebuild-optfix.service" ]; then
cp "${MODULE_DIR}/bluebuild-optfix.service" "${SYSTEMD_DIR}/"
systemctl enable bluebuild-optfix.service
fi

echo "Creating symlinks to fix packages that install to /opt"
# Create symlink for /opt to /var/opt since it is not created in the image yet
mkdir -p "/var/opt"
ln -s "/var/opt" "/opt"
ln -fs "/var/opt" "/opt"

# Create symlinks for each directory specified in recipe.yml
for OPTPKG in "${OPTFIX[@]}"; do
OPTPKG="${OPTPKG%\"}"
OPTPKG="${OPTPKG#\"}"
mkdir -p "/usr/lib/opt/${OPTPKG}"
ln -s "../../usr/lib/opt/${OPTPKG}" "/var/opt/${OPTPKG}"
ln -fs "/usr/lib/opt/${OPTPKG}" "/var/opt/${OPTPKG}"
echo "Created symlinks for ${OPTPKG}"
done
fi
Expand All @@ -73,8 +89,9 @@ if [[ ${#INSTALL_PKGS[@]} -gt 0 ]]; then
HTTPS_INSTALL=true
HTTPS_PKGS+=("${INSTALL_PKGS[$i]}")
elif [[ ! "${PKG}" =~ ^https?:\/\/.* ]] && [[ -f "${CONFIG_DIRECTORY}/rpm-ostree/${PKG}" ]]; then
INSTALL_PKGS[$i]="${CONFIG_DIRECTORY}/rpm-ostree/${PKG}"
LOCAL_INSTALL=true
LOCAL_PKGS+=("${CONFIG_DIRECTORY}/rpm-ostree/${PKG}")
LOCAL_PKGS+=("${INSTALL_PKGS[$i]}")
else
CLASSIC_INSTALL=true
CLASSIC_PKGS+=("${PKG}")
Expand Down Expand Up @@ -124,12 +141,21 @@ if [[ ${#INSTALL_PKGS[@]} -gt 0 && ${#INSTALLED_REMOVE_PACKAGES[@]} -gt 0 ]]; th
elif ${CLASSIC_INSTALL} && ${HTTPS_INSTALL} && ! ${LOCAL_INSTALL}; then
rpm-ostree override remove "${INSTALLED_REMOVE_PACKAGES[@]}" $(printf -- "--install=%s " "${CLASSIC_PKGS[@]}")
rpm-ostree install "${HTTPS_PKGS[@]}"
elif ${CLASSIC_INSTALL} && ! ${HTTPS_INSTALL} && ! ${LOCAL_INSTALL}; then
elif ${CLASSIC_INSTALL} && ! ${HTTPS_INSTALL} && ${LOCAL_INSTALL}; then
rpm-ostree override remove "${INSTALLED_REMOVE_PACKAGES[@]}" $(printf -- "--install=%s " "${CLASSIC_PKGS[@]}")
rpm-ostree install "${LOCAL_PKGS[@]}"
elif ${CLASSIC_INSTALL} && ${HTTPS_INSTALL} && ${LOCAL_INSTALL}; then
rpm-ostree override remove "${INSTALLED_REMOVE_PACKAGES[@]}" $(printf -- "--install=%s " "${CLASSIC_PKGS[@]}")
rpm-ostree install "${HTTPS_PKGS[@]}" "${LOCAL_PKGS[@]}"
elif ! ${CLASSIC_INSTALL} && ! ${HTTPS_INSTALL} && ${LOCAL_INSTALL}; then
rpm-ostree override remove "${INSTALLED_REMOVE_PACKAGES[@]}"
rpm-ostree install "${LOCAL_PKGS[@]}"
elif ! ${CLASSIC_INSTALL} && ${HTTPS_INSTALL} && ! ${LOCAL_INSTALL}; then
rpm-ostree override remove "${INSTALLED_REMOVE_PACKAGES[@]}"
rpm-ostree install "${HTTPS_PKGS[@]}"
elif ! ${CLASSIC_INSTALL} && ${HTTPS_INSTALL} && ${LOCAL_INSTALL}; then
rpm-ostree override remove "${INSTALLED_REMOVE_PACKAGES[@]}"
rpm-ostree install "${HTTPS_PKGS[@]}" "${LOCAL_PKGS[@]}"
fi
elif [[ ${#INSTALL_PKGS[@]} -gt 0 ]]; then
echo "Installing RPMs"
Expand Down
3 changes: 2 additions & 1 deletion recipes/bazzite-dx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@ modules:
- from-file: common_recipe.yml

# Install KDE Packages
- type: rpm-ostree
- type: safe-rpm-ostree
source: local
install:
- kde-runtime-docs
- kdenetwork-filesharing
Expand Down
5 changes: 3 additions & 2 deletions recipes/bazzite-gnome-dx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ modules:
- from-file: common_recipe.yml

# Install GNOME packages
- type: rpm-ostree
- type: safe-rpm-ostree
source: local
install:
- cryfs
- gnome-shell-extension-appindicator
Expand All @@ -61,7 +62,7 @@ modules:
- yaru-theme
- zenity
remove:
# - gnome-extensions-app
- gnome-extensions-app
- gnome-software-rpm-ostree
- gnome-tour
- gnome-terminal-nautilus
Expand Down
3 changes: 2 additions & 1 deletion recipes/common_recipe.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ modules:
- copr-repos.sh

# Install packages from Bluefin and Bluefin DX
- type: rpm-ostree
- type: safe-rpm-ostree
source: local
repos:
- https://copr.fedorainfracloud.org/coprs/ublue-os/staging/repo/fedora-%OS_VERSION%/ublue-os-staging-fedora-%OS_VERSION%.repo
- https://copr.fedorainfracloud.org/coprs/che/nerd-fonts/repo/fedora-%OS_VERSION%/che-nerd-fonts-fedora-%OS_VERSION%.repo
Expand Down

0 comments on commit 1b4a7dd

Please sign in to comment.