Skip to content

Commit

Permalink
retrofit unwrap PR from bluefin upstream (#4)
Browse files Browse the repository at this point in the history
* retrofit unwrap PR from bluefin upstream

ublue-os/bluefin#1954

* add tig

* fix os-release for bluefin-dx build

* update readme
  • Loading branch information
detiber authored Dec 16, 2024
1 parent b9d8ced commit e3c9cfc
Show file tree
Hide file tree
Showing 9 changed files with 43 additions and 24 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
[![Latest Images](https://github.com/detiber/beardy-os/actions/workflows/bluefin-latest.yml/badge.svg)](https://github.com/detiber/beardy-os/actions/workflows/bluefin-latest.yml)
[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/beardy-os)](https://artifacthub.io/packages/search?repo=beardy-os)

See the [BlueBuild docs](https://blue-build.org/how-to/setup/) for quick setup instructions for setting up your own repository based on this template.
## NOTE:

After setup, it is recommended you update this README to describe your custom image.
This repo is used for building os images layered upon various upstream bootc/ublue-os based images. Use at your own risk, and without any support.

## Installation

Expand Down
6 changes: 4 additions & 2 deletions variants/bluefin/Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ ARG UBLUE_IMAGE_TAG="stable"
ARG FEDORA_MAJOR_VERSION="41"

# Build, cleanup, commit.
RUN --mount=type=cache,dst=/var/cache/rpm-ostree \
RUN --mount=type=cache,dst=/var/cache/libdnf5 \
--mount=type=cache,dst=/var/cache/rpm-ostree \
--mount=type=bind,from=ctx,source=/,target=/ctx \
/ctx/build_files/shared/build-base.sh

Expand All @@ -31,6 +32,7 @@ ARG UBLUE_IMAGE_TAG="stable"
ARG FEDORA_MAJOR_VERSION="41"

# Build, Clean-up, Commit
RUN --mount=type=cache,dst=/var/cache/rpm-ostree \
RUN --mount=type=cache,dst=/var/cache/libdnf5 \
--mount=type=cache,dst=/var/cache/rpm-ostree \
--mount=type=bind,from=ctx,source=/,target=/ctx \
/ctx/build_files/shared/build-dx.sh
11 changes: 6 additions & 5 deletions variants/bluefin/build_files/base/04-packages.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,15 @@ fi

# simple case to install where no packages need excluding
if [[ "${#INCLUDED_PACKAGES[@]}" -gt 0 && "${#INSTALLED_EXCLUDED_PACKAGES[@]}" -eq 0 ]]; then
rpm-ostree install \
dnf -y 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[@]})
dnf5 -y remove \
${INSTALLED_EXCLUDED_PACKAGES[@]} && \
dnf5 -y install \
${INCLUDED_PACKAGES[@]}
else
echo "No packages to install."
fi
Expand All @@ -46,6 +47,6 @@ fi

# remove any excluded packages which are still present on image
if [[ "${#INSTALLED_EXCLUDED_PACKAGES[@]}" -gt 0 ]]; then
rpm-ostree override remove \
dnf5 -y remove \
${INSTALLED_EXCLUDED_PACKAGES[@]}
fi
11 changes: 6 additions & 5 deletions variants/bluefin/build_files/dx/03-packages-dx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,15 @@ fi

# simple case to install where no packages need excluding
if [[ "${#INCLUDED_PACKAGES[@]}" -gt 0 && "${#INSTALLED_EXCLUDED_PACKAGES[@]}" -eq 0 ]]; then
rpm-ostree install \
dnf -y 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[@]})
dnf5 -y remove \
${INSTALLED_EXCLUDED_PACKAGES[@]} && \
dnf5 -y install \
${INCLUDED_PACKAGES[@]}
else
echo "No packages to install."
fi
Expand All @@ -50,6 +51,6 @@ fi

# remove any excluded packages which are still present on image
if [[ "${#INSTALLED_EXCLUDED_PACKAGES[@]}" -gt 0 ]]; then
rpm-ostree override remove \
dnf5 -y remove \
${INSTALLED_EXCLUDED_PACKAGES[@]}
fi
19 changes: 18 additions & 1 deletion variants/bluefin/build_files/shared/build-base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,23 @@

set -eoux pipefail

# there is no 'rpm-ostree cliwrap uninstall-from-root', but this is close enough. See:
# https://github.com/coreos/rpm-ostree/blob/6d2548ddb2bfa8f4e9bafe5c6e717cf9531d8001/rust/src/cliwrap.rs#L25-L32
if [ -d /usr/libexec/rpm-ostree/wrapped ]; then
# binaries which could be created if they did not exist thus may not be in wrapped dir
rm -f \
/usr/bin/yum \
/usr/bin/dnf \
/usr/bin/kernel-install
# binaries which were wrapped
mv -f /usr/libexec/rpm-ostree/wrapped/* /usr/bin
rm -fr /usr/libexec/rpm-ostree
fi

if [ ${FEDORA_MAJOR_VERSION} -lt 41 ]; then
rpm-ostree install --idempotent dnf5 dnf5-plugins
fi

# Make Alternatives Directory
mkdir -p /var/lib/alternatives

Expand All @@ -13,7 +30,7 @@ rsync -rvK /ctx/system_files/shared/ /
rsync -rvK /ctx/system_files/"${BASE_IMAGE_NAME}"/ /

# Generate image-info.json
/ctx/build_files/base/00-image-info.sh
/ctx/build_files/shared/00-image-info.sh

# # Build Fix - Fix known skew offenders
# /ctx/build_files/base/01-build-fix.sh
Expand Down
7 changes: 2 additions & 5 deletions variants/bluefin/build_files/shared/build-dx.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ rsync -rvK /ctx/system_files/dx/ /
# Apply IP Forwarding before installing Docker to prevent messing with LXC networking
sysctl -p

# Generate image-info.json (Not Needed?)
# /ctx/build_files/shared/image-info.sh
# Generate image-info.json
/ctx/build_files/shared/00-image-info.sh

# # COPR Repos
# /ctx/build_files/dx/01-install-copr-repos-dx.sh
Expand All @@ -27,9 +27,6 @@ sysctl -p
# # Fetch Install
# /ctx/build_files/dx/04-override-install-dx.sh

# Branding Changes
sed -i '/^PRETTY_NAME/s/Bluefin/Bluefin-dx/' /usr/lib/os-release

# # Systemd and Disable Repos
# /ctx/build_files/dx/09-cleanup-dx.sh

Expand Down
5 changes: 2 additions & 3 deletions variants/bluefin/build_files/shared/clean-stage.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
#!/usr/bin/bash

set -eoux pipefail
shopt -s extglob

rm -rf /tmp/* || true
rm -rf /var/!(cache)
rm -rf /var/cache/!(rpm-ostree)
find /var/* -maxdepth 0 -type d \! -name cache -exec rm -fr {} \;
find /var/cache/* -maxdepth 0 -type d \! -name libdnf5 \! -name rpm-ostree -exec rm -fr {} \;
4 changes: 3 additions & 1 deletion variants/bluefin/packages.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{
"all": {
"include": {
"all": [],
"all": [
"tig"
],
"silverblue": [],
"dx": []
},
Expand Down

0 comments on commit e3c9cfc

Please sign in to comment.