Skip to content

Commit

Permalink
chore: adds the alternatives workaround
Browse files Browse the repository at this point in the history
This creates /var/lib/alternatives so that any RPM which has a
post-install script referencing 'alternatives' will not fail due to its
absense.

In addition, this goes the extra mile by copying the contents of
/var/lib/alternatives into the resulting image, which preserves the
altenratives database for any installed packages.

This second part could be controversial as there is an expectation that
there's minimal (or no) contents left in /var after running
'ostree container commit', but it does work and is useful.
  • Loading branch information
bsherman committed Mar 26, 2024
1 parent bf533db commit 4f8da2b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,15 @@ COPY --from=ghcr.io/ublue-os/config:latest /rpms /tmp/rpms
COPY --from=ghcr.io/ublue-os/akmods:main-${FEDORA_MAJOR_VERSION} /rpms/ublue-os /tmp/rpms
COPY sys_files/usr /usr

RUN /tmp/install.sh && \
RUN mkdir -p /var/lib/alternatives && \
/tmp/install.sh && \
/tmp/post-install.sh && \
mv /var/lib/alternatives /staged-alternatives && \
rm -rf /tmp/* /var/* && \
ostree container commit && \
mkdir -p /var/tmp && chmod -R 1777 /var/tmp
mkdir -p /var/lib && mv /staged-alternatives /var/lib/alternatives && \
mkdir -p /tmp /var/tmp && \
chmod -R 1777 /tmp /var/tmp


# !!! WARNING - KMODS IN MAIN IMAGES ARE DEPRECATED !!!
Expand Down

0 comments on commit 4f8da2b

Please sign in to comment.