Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: reorganize repo for Aurora builds #1091

Merged
merged 12 commits into from
Apr 6, 2024
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
162 changes: 19 additions & 143 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,114 +15,27 @@ ARG IMAGE_FLAVOR="${IMAGE_FLAVOR}"
ARG AKMODS_FLAVOR="${AKMODS_FLAVOR}"
ARG BASE_IMAGE_NAME="${BASE_IMAGE_NAME}"
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION}"
ARG PACKAGE_LIST="bluefin"


# Add Staging repo
RUN wget https://copr.fedorainfracloud.org/coprs/ublue-os/staging/repo/fedora-"${FEDORA_MAJOR_VERSION}"/ublue-os-staging-fedora-"${FEDORA_MAJOR_VERSION}".repo -O /etc/yum.repos.d/ublue-os-staging-fedora-"${FEDORA_MAJOR_VERSION}".repo && \
# 39 gets VRR and Ptyxis
if [ ${FEDORA_MAJOR_VERSION} -eq "39" ]; then \
wget https://copr.fedorainfracloud.org/coprs/kylegospo/gnome-vrr/repo/fedora-"${FEDORA_MAJOR_VERSION}"/kylegospo-gnome-vrr-fedora-"${FEDORA_MAJOR_VERSION}".repo -O /etc/yum.repos.d/_copr_kylegospo-gnome-vrr.repo && \
rpm-ostree override replace --experimental --from repo=copr:copr.fedorainfracloud.org:kylegospo:gnome-vrr mutter mutter-common gnome-control-center gnome-control-center-filesystem && \
rm -f /etc/yum.repos.d/_copr_kylegospo-gnome-vrr.repo && \
rpm-ostree override replace \
--experimental \
--from repo=copr:copr.fedorainfracloud.org:ublue-os:staging \
gtk4 \
vte291 \
vte-profile \
libadwaita && \
rpm-ostree install \
ptyxis \
; fi && \
# 40 gets only Ptyxis
if [ ${FEDORA_MAJOR_VERSION} -eq "40" ]; then \
rpm-ostree override replace \
--experimental \
--from repo=copr:copr.fedorainfracloud.org:ublue-os:staging \
vte291 \
vte-profile && \
rpm-ostree install \
ptyxis \
; fi

# Install Explicit Sync Patches on Nvidia builds
RUN if [[ "${IMAGE_FLAVOR}" =~ "nvidia" && "${IMAGE_FLAVOR}" =~ "39" ]]; then \
wget https://copr.fedorainfracloud.org/coprs/gloriouseggroll/nvidia-explicit-sync/repo/fedora-$(rpm -E %fedora)/gloriouseggroll-nvidia-explicit-sync-fedora-$(rpm -E %fedora).repo?arch=x86_64 -O /etc/yum.repos.d/_copr_gloriouseggroll-nvidia-explicit-sync.repo && \
rpm-ostree override replace \
--experimental \
--from repo=copr:copr.fedorainfracloud.org:gloriouseggroll:nvidia-explicit-sync \
xorg-x11-server-Xwayland && \
rpm-ostree override replace \
--experimental \
--from repo=copr:copr.fedorainfracloud.org:gloriouseggroll:nvidia-explicit-sync \
egl-wayland \
|| true && \
rm /etc/yum.repos.d/_copr_gloriouseggroll-nvidia-explicit-sync.repo \
; fi

COPY usr /usr
# COPY Build Files
COPY build_files/base build_files/shared /tmp/build/
COPY system_files/shared system_files/${BASE_IMAGE_NAME} /
COPY just /tmp/just
COPY etc/yum.repos.d/ /etc/yum.repos.d/
COPY packages.json /tmp/packages.json
COPY build.sh /tmp/build.sh
COPY image-info.sh /tmp/image-info.sh
COPY install-akmods.sh /tmp/install-akmods.sh
COPY fetch-quadlets.sh /tmp/fetch-quadlets.sh
# Copy ublue-update.toml to tmp first, to avoid being overwritten.
COPY usr/etc/ublue-update/ublue-update.toml /tmp/ublue-update.toml

# Add ublue kmods, add needed negativo17 repo and then immediately disable due to incompatibility with RPMFusion
COPY --from=ghcr.io/ublue-os/akmods:${AKMODS_FLAVOR}-${FEDORA_MAJOR_VERSION} /rpms /tmp/akmods-rpms
RUN /tmp/install-akmods.sh && \
wget https://copr.fedorainfracloud.org/coprs/che/nerd-fonts/repo/fedora-"${FEDORA_MAJOR_VERSION}"/che-nerd-fonts-fedora-"${FEDORA_MAJOR_VERSION}".repo -O /etc/yum.repos.d/_copr_che-nerd-fonts-"${FEDORA_MAJOR_VERSION}".repo

# Starship Shell Prompt
RUN curl -Lo /tmp/starship.tar.gz "https://github.com/starship/starship/releases/latest/download/starship-x86_64-unknown-linux-gnu.tar.gz" && \
tar -xzf /tmp/starship.tar.gz -C /tmp && \
install -c -m 0755 /tmp/starship /usr/bin && \
echo 'eval "$(starship init bash)"' >> /etc/bashrc

# Copy ublue-update.toml to tmp first, to avoid being overwritten.
COPY /system_files/shared/usr/etc/ublue-update/ublue-update.toml /tmp/ublue-update.toml
# Copy Bluefin CLI packages
COPY --from=ghcr.io/ublue-os/bluefin-cli /usr/bin/atuin /usr/bin/atuin
COPY --from=ghcr.io/ublue-os/bluefin-cli /usr/share/bash-prexec /usr/share/bash-prexec
# COPY ublue kmods, add needed negativo17 repo and then immediately disable due to incompatibility with RPMFusion
COPY --from=ghcr.io/ublue-os/akmods:${AKMODS_FLAVOR}-${FEDORA_MAJOR_VERSION} /rpms /tmp/akmods-rpms
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of scope for this PR, but a thought - would it be good to move this to scripts too, and use skopeo or similar to extract these files?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That would be nicer. We could remove a few of these COPY layers with that.


RUN wget https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh -O /usr/libexec/brew-install && \
chmod +x /usr/libexec/brew-install && \
/tmp/build.sh && \
/tmp/image-info.sh && \
/tmp/fetch-quadlets.sh && \
pip install --prefix=/usr topgrade && \
rpm-ostree install ublue-update && \
mkdir -p /usr/etc/flatpak/remotes.d && \
wget -q https://dl.flathub.org/repo/flathub.flatpakrepo -P /usr/etc/flatpak/remotes.d && \
cp /tmp/ublue-update.toml /usr/etc/ublue-update/ublue-update.toml && \
if [[ "${FEDORA_MAJOR_VERSION}" -ge "39" ]]; then \
systemctl enable tuned.service \
; fi && \
systemctl enable rpm-ostree-countme.service && \
systemctl enable tailscaled.service && \
systemctl enable dconf-update.service && \
systemctl --global enable ublue-flatpak-manager.service && \
systemctl enable ublue-update.timer && \
systemctl enable ublue-system-setup.service && \
systemctl --global enable ublue-user-setup.service && \
fc-cache -f /usr/share/fonts/ubuntu && \
fc-cache -f /usr/share/fonts/inter && \
find /tmp/just -iname '*.just' -exec printf "\n\n" \; -exec cat {} \; >> /usr/share/ublue-os/just/60-custom.just && \
rm -f /etc/yum.repos.d/tailscale.repo && \
rm -f /etc/yum.repos.d/charm.repo && \
rm -f /etc/yum.repos.d/ublue-os-staging-fedora-"${FEDORA_MAJOR_VERSION}".repo && \
echo "Hidden=true" >> /usr/share/applications/fish.desktop && \
echo "Hidden=true" >> /usr/share/applications/htop.desktop && \
echo "Hidden=true" >> /usr/share/applications/nvtop.desktop && \
echo "Hidden=true" >> /usr/share/applications/gnome-system-monitor.desktop && \
rm -f /etc/yum.repos.d/_copr_che-nerd-fonts-"${FEDORA_MAJOR_VERSION}".repo && \
sed -i '/^PRETTY_NAME/s/Silverblue/Bluefin/' /usr/lib/os-release && \
# Build, cleanup, commit.
RUN bash -c ". /tmp/build/build.sh" && \
m2Giles marked this conversation as resolved.
Show resolved Hide resolved
rm -rf /tmp/* /var/* && \
ostree container commit && \
mkdir -p /var/tmp && \
chmod -R 1777 /var/tmp
chmod -R 1777 /var/tmp && \
ostree container commit

## bluefin-dx developer edition image section
FROM bluefin AS bluefin-dx
Expand All @@ -132,53 +45,16 @@ ARG IMAGE_VENDOR="${IMAGE_VENDOR}"
ARG BASE_IMAGE_NAME="${BASE_IMAGE_NAME}"
ARG IMAGE_FLAVOR="${IMAGE_FLAVOR}"
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION}"
ARG PACKAGE_LIST="bluefin-dx"

# dx specific files come from the dx directory in this repo
COPY dx/usr /usr
COPY dx/etc/yum.repos.d/ /etc/yum.repos.d/
COPY workarounds.sh \
packages.json \
build.sh \
image-info.sh \
/tmp

# Apply IP Forwarding before installing Docker to prevent messing with LXC networking
RUN sysctl -p

RUN wget https://copr.fedorainfracloud.org/coprs/ganto/lxc4/repo/fedora-"${FEDORA_MAJOR_VERSION}"/ganto-lxc4-fedora-"${FEDORA_MAJOR_VERSION}".repo -O /etc/yum.repos.d/ganto-lxc4-fedora-"${FEDORA_MAJOR_VERSION}".repo && \
wget https://copr.fedorainfracloud.org/coprs/ublue-os/staging/repo/fedora-"${FEDORA_MAJOR_VERSION}"/ublue-os-staging-fedora-"${FEDORA_MAJOR_VERSION}".repo -O /etc/yum.repos.d/ublue-os-staging-fedora-"${FEDORA_MAJOR_VERSION}".repo && \
wget https://copr.fedorainfracloud.org/coprs/karmab/kcli/repo/fedora-"${FEDORA_MAJOR_VERSION}"/karmab-kcli-fedora-"${FEDORA_MAJOR_VERSION}".repo -O /etc/yum.repos.d/karmab-kcli-fedora-"${FEDORA_MAJOR_VERSION}".repo && \
wget https://copr.fedorainfracloud.org/coprs/atim/ubuntu-fonts/repo/fedora-"${FEDORA_MAJOR_VERSION}"/atim-ubuntu-fonts-fedora-"${FEDORA_MAJOR_VERSION}".repo -O /etc/yum.repos.d/atim-ubuntu-fonts-fedora-"${FEDORA_MAJOR_VERSION}".repo

# Handle packages via packages.json
RUN /tmp/build.sh && \
/tmp/image-info.sh

RUN curl -Lo ./kind "https://github.com/kubernetes-sigs/kind/releases/latest/download/kind-$(uname)-amd64" && \
chmod +x ./kind && \
mv ./kind /usr/bin/kind

# Set up services
RUN systemctl enable docker.socket && \
systemctl enable podman.socket && \
systemctl enable swtpm-workaround.service && \
systemctl enable bluefin-dx-groups.service && \
systemctl enable --global bluefin-dx-user-vscode.service && \
systemctl disable pmie.service && \
systemctl disable pmlogger.service

RUN /tmp/workarounds.sh
COPY build_files/dx build_files/shared /tmp/build/
COPY system_files/dx /
COPY packages.json /tmp/packages.json

# Clean up repos, everything is on the image so we don't need them
RUN rm -f /etc/yum.repos.d/ublue-os-staging-fedora-"${FEDORA_MAJOR_VERSION}".repo && \
rm -f /etc/yum.repos.d/ganto-lxc4-fedora-"${FEDORA_MAJOR_VERSION}".repo && \
rm -f /etc/yum.repos.d/karmab-kcli-fedora-"${FEDORA_MAJOR_VERSION}".repo && \
rm -f /etc/yum.repos.d/atim-ubuntu-fonts-fedora-"${FEDORA_MAJOR_VERSION}".repo && \
rm -f /etc/yum.repos.d/vscode.repo && \
rm -f /etc/yum.repos.d/docker-ce.repo && \
rm -f /etc/yum.repos.d/_copr:copr.fedorainfracloud.org:phracek:PyCharm.repo && \
rm -f /etc/yum.repos.d/fedora-cisco-openh264.repo && \
# Build, Clean-up, Commit
RUN bash -c ". /tmp/build/build-dx.sh" && \
fc-cache --system-only --really-force --verbose && \
rm -rf /tmp/* /var/* && \
ostree container commit
mkdir -p /var/tmp && \
chmod -R 1777 /var/tmp && \
ostree container commit
9 changes: 9 additions & 0 deletions build_files/base/branding.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/bash

set -oue pipefail

if test "$BASE_IMAGE_NAME" = "silverblue"; then
sed -i '/^PRETTY_NAME/s/Silverblue/Bluefin/' /usr/lib/os-release
elif test "$BASE_IMAGE_NAME" = "kinoite"; then
sed -i '/^PRETTY_NAME/s/Kinoite/Aurora/' /usr/lib/os-release
fi
17 changes: 17 additions & 0 deletions build_files/base/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/bash

set -oue pipefail

. /tmp/build/copr-repos.sh
Copy link
Member

@p5 p5 Apr 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be good to just run this in a for loop over all .sh files in the directory?
We can prefix the names with numbers to control the execution order

If you prefer it as-is, I'm okay with that too

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That could also work. With this method, we can inline things like that singular rpm-ostree install. But I like the loop method to make us more purposeful with changes. I personally like this source method to not worry about the +x bit.

. /tmp/build/nvidia-explicit-sync.sh
. /tmp/build/install-akmods.sh
. /tmp/build/packages.sh
. /tmp/build/fetch-install.sh
rpm-ostree install ublue-update
. /tmp/build/image-info.sh
. /tmp/build/fetch-quadlets.sh
. /tmp/build/font-install.sh
. /tmp/build/install-tmp.sh
. /tmp/build/systemd.sh
. /tmp/build/branding.sh
. /tmp/build/cleanup.sh
14 changes: 14 additions & 0 deletions build_files/base/cleanup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/bash

set -ouex pipefail

rm -f /etc/yum.repos.d/tailscale.repo
rm -f /etc/yum.repos.d/charm.repo
rm -f /etc/yum.repos.d/ublue-os-staging-fedora-"${FEDORA_MAJOR_VERSION}".repo
echo "Hidden=true" >> /usr/share/applications/fish.desktop
echo "Hidden=true" >> /usr/share/applications/htop.desktop
echo "Hidden=true" >> /usr/share/applications/nvtop.desktop
if [ "$BASE_IMAGE_NAME" = "silverblue" ]; then
echo "Hidden=true" >> /usr/share/applications/gnome-system-monitor.desktop
fi
rm -f /etc/yum.repos.d/_copr_che-nerd-fonts-"${FEDORA_MAJOR_VERSION}".repo
33 changes: 33 additions & 0 deletions build_files/base/copr-repos.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#!/usr/bin/bash

set -oue pipefail

# Add Staging repo
wget https://copr.fedorainfracloud.org/coprs/ublue-os/staging/repo/fedora-"${FEDORA_MAJOR_VERSION}"/ublue-os-staging-fedora-"${FEDORA_MAJOR_VERSION}".repo -O /etc/yum.repos.d/ublue-os-staging-fedora-"${FEDORA_MAJOR_VERSION}".repo && \
# 39 gets VRR and Ptyxis
if [ ${FEDORA_MAJOR_VERSION} -eq "39" ]; then \
m2Giles marked this conversation as resolved.
Show resolved Hide resolved
wget https://copr.fedorainfracloud.org/coprs/kylegospo/gnome-vrr/repo/fedora-"${FEDORA_MAJOR_VERSION}"/kylegospo-gnome-vrr-fedora-"${FEDORA_MAJOR_VERSION}".repo -O /etc/yum.repos.d/_copr_kylegospo-gnome-vrr.repo && \
rpm-ostree override replace --experimental --from repo=copr:copr.fedorainfracloud.org:kylegospo:gnome-vrr mutter mutter-common gnome-control-center gnome-control-center-filesystem && \
rm -f /etc/yum.repos.d/_copr_kylegospo-gnome-vrr.repo && \
rpm-ostree override replace \
--experimental \
--from repo=copr:copr.fedorainfracloud.org:ublue-os:staging \
gtk4 \
vte291 \
vte-profile \
libadwaita && \
rpm-ostree install \
ptyxis \
; fi && \
# 40 gets only Ptyxis
if [ ${FEDORA_MAJOR_VERSION} -eq "40" ]; then \
rpm-ostree override replace \
--experimental \
--from repo=copr:copr.fedorainfracloud.org:ublue-os:staging \
vte291 \
vte-profile && \
rpm-ostree install \
ptyxis \
; fi && \
# Add Nerd Fonts
wget https://copr.fedorainfracloud.org/coprs/che/nerd-fonts/repo/fedora-"${FEDORA_MAJOR_VERSION}"/che-nerd-fonts-fedora-"${FEDORA_MAJOR_VERSION}".repo -O /etc/yum.repos.d/_copr_che-nerd-fonts-"${FEDORA_MAJOR_VERSION}".repo
20 changes: 20 additions & 0 deletions build_files/base/fetch-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/bash

set -oue pipefail

# Starship Shell Prompt
curl -Lo /tmp/starship.tar.gz "https://github.com/starship/starship/releases/latest/download/starship-x86_64-unknown-linux-gnu.tar.gz" && \
tar -xzf /tmp/starship.tar.gz -C /tmp && \
install -c -m 0755 /tmp/starship /usr/bin && \
echo 'eval "$(starship init bash)"' >> /etc/bashrc

# Brew Install Script
wget https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh -O /usr/libexec/brew-install && \
chmod +x /usr/libexec/brew-install

# Flatpak Remotes
mkdir -p /usr/etc/flatpak/remotes.d && \
wget -q https://dl.flathub.org/repo/flathub.flatpakrepo -P /usr/etc/flatpak/remotes.d

# Topgrade Install
pip install --prefix=/usr topgrade
File renamed without changes.
5 changes: 5 additions & 0 deletions build_files/base/font-install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/usr/bin/bash

set -ouex pipefail
fc-cache -f /usr/share/fonts/ubuntu
fc-cache -f /usr/share/fonts/inter
2 changes: 2 additions & 0 deletions install-akmods.sh → build_files/base/install-akmods.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#!/bin/bash

set -oue pipefail

sed -i 's@enabled=0@enabled=1@g' /etc/yum.repos.d/_copr_ublue-os-akmods.repo
wget https://negativo17.org/repos/fedora-multimedia.repo -O /etc/yum.repos.d/negativo17-fedora-multimedia.repo
if [[ "${FEDORA_MAJOR_VERSION}" -ge "39" ]]; then
Expand Down
7 changes: 7 additions & 0 deletions build_files/base/install-tmp.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/bash

set -ouex pipefail

find /tmp/just -iname '*.just' -exec printf "\n\n" \; -exec cat {} \; >> /usr/share/ublue-os/just/60-custom.just

cp /tmp/ublue-update.toml /usr/etc/ublue-update/ublue-update.toml
16 changes: 16 additions & 0 deletions build_files/base/nvidia-explicit-sync.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/bash

# Install Explicit Sync Patches on Nvidia builds
if [[ "${IMAGE_FLAVOR}" =~ "nvidia" && "${IMAGE_FLAVOR}" =~ "39" ]]; then \
wget https://copr.fedorainfracloud.org/coprs/gloriouseggroll/nvidia-explicit-sync/repo/fedora-$(rpm -E %fedora)/gloriouseggroll-nvidia-explicit-sync-fedora-$(rpm -E %fedora).repo?arch=x86_64 -O /etc/yum.repos.d/_copr_gloriouseggroll-nvidia-explicit-sync.repo && \
rpm-ostree override replace \
--experimental \
--from repo=copr:copr.fedorainfracloud.org:gloriouseggroll:nvidia-explicit-sync \
xorg-x11-server-Xwayland && \
rpm-ostree override replace \
--experimental \
--from repo=copr:copr.fedorainfracloud.org:gloriouseggroll:nvidia-explicit-sync \
egl-wayland \
|| true && \
rm /etc/yum.repos.d/_copr_gloriouseggroll-nvidia-explicit-sync.repo \
; fi
27 changes: 11 additions & 16 deletions build.sh → build_files/base/packages.sh
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
#!/bin/sh
#!/usr/bin/bash

set -ouex pipefail

RELEASE="$(rpm -E %fedora)"

# build list of all packages requested for inclusion
INCLUDED_PACKAGES=($(jq -r "[(.all.include | (select(.\"$PACKAGE_LIST\" != null).\"$PACKAGE_LIST\")[]), \
(select(.\"$FEDORA_MAJOR_VERSION\" != null).\"$FEDORA_MAJOR_VERSION\".include | (select(.\"$PACKAGE_LIST\" != null).\"$PACKAGE_LIST\")[])] \
| sort | unique[]" /tmp/packages.json))
INCLUDED_PACKAGES=($(jq -r "[(.all.include | (select(.all != null).all)[]), \
(.all.include | (select(.\"$BASE_IMAGE_NAME\" != null).\"$BASE_IMAGE_NAME\")[]), \
(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\")[])] \
| sort | unique[]" /tmp/packages.json))

# build list of all packages requested for exclusion
EXCLUDED_PACKAGES=($(jq -r "[(.all.exclude | (select(.\"$PACKAGE_LIST\" != null).\"$PACKAGE_LIST\")[]), \
(select(.\"$FEDORA_MAJOR_VERSION\" != null).\"$FEDORA_MAJOR_VERSION\".exclude | (select(.\"$PACKAGE_LIST\" != null).\"$PACKAGE_LIST\")[])] \
| sort | unique[]" /tmp/packages.json))

EXCLUDED_PACKAGES=($(jq -r "[(.all.exclude | (select(.all != null).all)[]), \
(.all.exclude | (select(.\"$BASE_IMAGE_NAME\" != null).\"$BASE_IMAGE_NAME\")[]), \
(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\")[])] \
| sort | unique[]" /tmp/packages.json))

# ensure exclusion list only contains packages already present on image
if [[ "${#EXCLUDED_PACKAGES[@]}" -gt 0 ]]; then
Expand All @@ -30,18 +31,12 @@ elif [[ "${#INCLUDED_PACKAGES[@]}" -gt 0 && "${#EXCLUDED_PACKAGES[@]}" -gt 0 ]];
rpm-ostree override remove \
${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)
EXCLUDED_PACKAGES=($(jq -r "[(.all.exclude | (select(.\"$PACKAGE_LIST\" != null).\"$PACKAGE_LIST\")[]), \
(select(.\"$FEDORA_MAJOR_VERSION\" != null).\"$FEDORA_MAJOR_VERSION\".exclude | (select(.\"$PACKAGE_LIST\" != null).\"$PACKAGE_LIST\")[])] \
| sort | unique[]" /tmp/packages.json))

if [[ "${#EXCLUDED_PACKAGES[@]}" -gt 0 ]]; then
EXCLUDED_PACKAGES=($(rpm -qa --queryformat='%{NAME} ' ${EXCLUDED_PACKAGES[@]}))
fi
Expand Down
13 changes: 13 additions & 0 deletions build_files/base/systemd.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/bash


if [[ "${FEDORA_MAJOR_VERSION}" -ge "39" ]]; then \
systemctl enable tuned.service \
; fi
systemctl enable rpm-ostree-countme.service
systemctl enable tailscaled.service
systemctl enable dconf-update.service
systemctl --global enable ublue-flatpak-manager.service
systemctl enable ublue-update.timer
systemctl enable ublue-system-setup.service
systemctl --global enable ublue-user-setup.service
Loading
Loading