Skip to content

Commit

Permalink
fix: use sed -i for overrides on arm and revert build changes (just h…
Browse files Browse the repository at this point in the history
…ave the copy one)
  • Loading branch information
tulilirockz committed Feb 1, 2025
1 parent 13f22a8 commit f540062
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 54 deletions.
29 changes: 13 additions & 16 deletions build_scripts/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,16 @@
# This file needs to exist otherwise running this in a RUN label makes it so bash strict mode doesnt work.
# Thus leading to silent failures

set -euo pipefail
set -xeuo pipefail

# Do not rely on any of these scripts existing in a specific path
# Make the names as descriptive as possible and everything that uses dnf for package installation/removal should have `packages-` as a prefix.

run_buildscripts_for() {
WHAT=$1
shift
find "/var/tmp/build_scripts/overrides/$WHAT" -iname "*-*.sh" | while read -r -d $'\0' script; do
# Complex "find" expression here since there might not be any overrides
find "/var/tmp/build_scripts/overrides/$WHAT" -iname "*-*.sh" -print0 | while IFS= read -r -d $'\0' script; do
printf "::group:: ===$WHAT-%s===\n" "$(basename "$script")"
$script
printf "::endgroup::\n"
Expand All @@ -22,36 +23,32 @@ copy_systemfiles_for() {
WHAT=$1
shift
printf "::group:: ===%s-file-copying===\n" "$WHAT"
cp -a "/var/tmp/system_files_overrides/$WHAT/." /
cp -av "/var/tmp/system_files_overrides/$WHAT/." /
printf "::endgroup::\n"
}

MAJOR_VERSION_NUMBER="$(sh -c '. /usr/lib/os-release ; echo $VERSION_ID')"
export MAJOR_VERSION_NUMBER

# Copy files before running scripts since the scripts often rely on files being present
copy_systemfiles_for "$(arch)"
if [ "$ENABLE_HWE" == "1" ]; then
copy_systemfiles_for hwe
fi
if [ "$ENABLE_DX" == "1" ]; then
copy_systemfiles_for dx
fi

# Specifically the dash here to indicate that we do not want to run this script again
for script in /var/tmp/build_scripts/*-*.sh; do
printf "::group:: ===%s===\n" "$(basename "$script")"
$script
printf "::endgroup::\n"
done

copy_systemfiles_for "$(arch)"
run_buildscripts_for "$(arch)"
if [ "$ENABLE_HWE" == "1" ]; then
run_buildscripts_for hwe
fi

if [ "$ENABLE_DX" == "1" ]; then
copy_systemfiles_for dx
run_buildscripts_for dx
fi

if [ "$ENABLE_HWE" == "1" ]; then
copy_systemfiles_for hwe
run_buildscripts_for hwe
fi


# Ensure these get run at the _end_ of the build no matter what
/var/tmp/build_scripts/cleanup.sh
12 changes: 12 additions & 0 deletions build_scripts/overrides/aarch64/00-flatpaks.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env bash

set -xeuo pipefail

# Bucket list again, this needs to be fixed upstream!

TARGET_FLATPAK_FILE="/etc/ublue-os/system-flatpaks.list"

sed -i "/org\.mozilla.*/d" "$TARGET_FLATPAK_FILE"
echo "org.chromium.Chromium" >> "$TARGET_FLATPAK_FILE"

sed -i "s/org.mozilla.Firefox/org.chromium.Chromium/g" /usr/share/glib-2.0/schemas/zz0-bluefin-modifications.gschema.override
35 changes: 0 additions & 35 deletions system_files_overrides/aarch64/etc/ublue-os/system-flatpaks.list

This file was deleted.

This file was deleted.

0 comments on commit f540062

Please sign in to comment.