2023-04-02 11:48:14 +02:00
|
|
|
#!/bin/bash
|
2023-04-24 20:40:51 +02:00
|
|
|
# run scripts
|
|
|
|
echo "-- Running scripts defined in recipe.yml --"
|
2023-04-26 18:19:31 +02:00
|
|
|
buildscripts=$(yq '.scripts[]' < /usr/etc/ublue-recipe.yml)
|
2023-04-24 20:40:51 +02:00
|
|
|
for script in $(echo -e "$buildscripts"); do \
|
|
|
|
echo "Running: ${script}" && \
|
|
|
|
/tmp/scripts/$script; \
|
|
|
|
done
|
|
|
|
echo "---"
|
|
|
|
|
2023-04-02 10:44:44 +02:00
|
|
|
# remove the default firefox (from fedora) in favor of the flatpak
|
|
|
|
rpm-ostree override remove firefox firefox-langpacks
|
|
|
|
|
2023-04-28 15:55:37 +02:00
|
|
|
repos=$(yq '.extrarepos[]' < /usr/etc/ublue-recipe.yml)
|
|
|
|
if [[ -n "$repos" ]]; then
|
|
|
|
echo "-- Adding repos defined in recipe.yml --"
|
|
|
|
for repo in $(echo -e "$repos"); do \
|
|
|
|
wget $repo -P /etc/yum.repos.d/; \
|
|
|
|
done
|
|
|
|
echo "---"
|
|
|
|
fi
|
|
|
|
|
2023-04-02 10:44:44 +02:00
|
|
|
echo "-- Installing RPMs defined in recipe.yml --"
|
2023-04-26 18:19:31 +02:00
|
|
|
rpm_packages=$(yq '.rpms[]' < /usr/etc/ublue-recipe.yml)
|
2023-04-02 14:31:01 +02:00
|
|
|
for pkg in $(echo -e "$rpm_packages"); do \
|
2023-04-02 10:44:44 +02:00
|
|
|
echo "Installing: ${pkg}" && \
|
|
|
|
rpm-ostree install $pkg; \
|
|
|
|
done
|
2023-04-02 11:00:58 +02:00
|
|
|
echo "---"
|
|
|
|
|
|
|
|
# install yafti to install flatpaks on first boot, https://github.com/ublue-os/yafti
|
2023-04-02 11:24:32 +02:00
|
|
|
pip install --prefix=/usr yafti
|
|
|
|
|
|
|
|
# add a package group for yafti using the packages defined in recipe.yml
|
2023-04-26 18:49:26 +02:00
|
|
|
flatpaks=$(yq '.flatpaks[]' < /tmp/ublue-recipe.yml)
|
|
|
|
# only try to create package group if some flatpaks are defined
|
|
|
|
if [[ -n "$flatpaks" ]]; then
|
|
|
|
yq -i '.screens.applications.values.groups.Custom.description = "Flatpaks defined by the image maintainer"' /usr/etc/yafti.yml
|
|
|
|
yq -i '.screens.applications.values.groups.Custom.default = true' /usr/etc/yafti.yml
|
|
|
|
for pkg in $(echo -e "$flatpaks"); do \
|
|
|
|
yq -i ".screens.applications.values.groups.Custom.packages += [{\"$pkg\": \"$pkg\"}]" /usr/etc/yafti.yml
|
|
|
|
done
|
|
|
|
fi
|