generated from blue-build/template
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates to fix issues with 3.7.0 bluefin release
- Loading branch information
Showing
5 changed files
with
118 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
cosign.key | ||
cosign.private | ||
/Containerfile | ||
/Containerfile.* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
#!/usr/bin/bash | ||
|
||
set -ouex pipefail | ||
|
||
BLUEFIN_IMAGE_NAME=$([ "$BASE_IMAGE_NAME" == "bazzite-gnome" ] && echo "silverblue" || echo "kinoite") | ||
|
||
# build list of all packages requested for inclusion | ||
INCLUDED_PACKAGES=($(jq -r "[(.all.include | (select(.all != null).all)[]), \ | ||
(.all.include | (select(.\"$BASE_IMAGE_NAME\" != null).\"$BASE_IMAGE_NAME\")[]), \ | ||
(.all.include | (select(.dx != null).dx)[]), \ | ||
(select(.\"$FEDORA_MAJOR_VERSION\" != null).\"$FEDORA_MAJOR_VERSION\".include | (select(.all != null).all)[]), \ | ||
(select(.\"$FEDORA_MAJOR_VERSION\" != null).\"$FEDORA_MAJOR_VERSION\".include | (select(.\"$BASE_IMAGE_NAME\" != null).\"$BASE_IMAGE_NAME\")[]), | ||
(select(.\"$FEDORA_MAJOR_VERSION\" != null).\"$FEDORA_MAJOR_VERSION\".include | (select(.dx != null).dx)[])] \ | ||
| sort | unique[]" ../bluefin/packages.json)) | ||
|
||
# build list of all packages requested for exclusion | ||
EXCLUDED_PACKAGES=($(jq -r "[(.all.exclude | (select(.all != null).all)[]), \ | ||
(.all.exclude | (select(.\"$BASE_IMAGE_NAME\" != null).\"$BASE_IMAGE_NAME\")[]), \ | ||
(.all.exclude | (select(.dx != null).dx)[]), \ | ||
(select(.\"$FEDORA_MAJOR_VERSION\" != null).\"$FEDORA_MAJOR_VERSION\".exclude | (select(.all != null).all)[]), \ | ||
(select(.\"$FEDORA_MAJOR_VERSION\" != null).\"$FEDORA_MAJOR_VERSION\".exclude | (select(.\"$BASE_IMAGE_NAME\" != null).\"$BASE_IMAGE_NAME\")[]), | ||
(select(.\"$FEDORA_MAJOR_VERSION\" != null).\"$FEDORA_MAJOR_VERSION\".exclude | (select(.dx != null).dx)[])] \ | ||
| sort | unique[]" ../bluefin/packages.json)) | ||
|
||
# store a list of RPMs installed on the image | ||
INSTALLED_EXCLUDED_PACKAGES=() | ||
|
||
# ensure exclusion list only contains packages already present on image | ||
if [[ "${#EXCLUDED_PACKAGES[@]}" -gt 0 ]]; then | ||
INSTALLED_EXCLUDED_PACKAGES=($(rpm -qa --queryformat='%{NAME} ' ${EXCLUDED_PACKAGES[@]})) | ||
fi | ||
|
||
# simple case to install where no packages need excluding | ||
if [[ "${#INCLUDED_PACKAGES[@]}" -gt 0 && "${#INSTALLED_EXCLUDED_PACKAGES[@]}" -eq 0 ]]; then | ||
rpm-ostree install \ | ||
${INCLUDED_PACKAGES[@]} | ||
|
||
# install/excluded packages both at same time | ||
elif [[ "${#INCLUDED_PACKAGES[@]}" -gt 0 && "${#INSTALLED_EXCLUDED_PACKAGES[@]}" -gt 0 ]]; then | ||
rpm-ostree override remove \ | ||
${INSTALLED_EXCLUDED_PACKAGES[@]} \ | ||
$(printf -- "--install=%s " ${INCLUDED_PACKAGES[@]}) | ||
else | ||
echo "No packages to install." | ||
fi | ||
|
||
# check if any excluded packages are still present | ||
# (this can happen if an included package pulls in a dependency) | ||
if [[ "${#EXCLUDED_PACKAGES[@]}" -gt 0 ]]; then | ||
INSTALLED_EXCLUDED_PACKAGES=($(rpm -qa --queryformat='%{NAME} ' ${EXCLUDED_PACKAGES[@]})) | ||
fi | ||
|
||
# remove any excluded packages which are still present on image | ||
if [[ "${#INSTALLED_EXCLUDED_PACKAGES[@]}" -gt 0 ]]; then | ||
rpm-ostree override remove \ | ||
${INSTALLED_EXCLUDED_PACKAGES[@]} | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters