You've already forked fedora-toolbox
forked from davejansen/fedora-bootc
First attempt at using vanilla Silverblue base
This commit is contained in:
@@ -85,8 +85,9 @@ jobs:
|
|||||||
tags: |
|
tags: |
|
||||||
# set latest tag for main branch
|
# set latest tag for main branch
|
||||||
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
|
type=raw,value=latest,enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
|
||||||
type=raw,value=${{ env.FEDORA_BASE }}
|
type=raw,value=${{ env.FEDORA_BASE }},enable=${{ github.ref == format('refs/heads/{0}', 'main') }}
|
||||||
type=raw,value=${{ env.FEDORA_BASE }}-{{date 'YYYYMMDD'}}
|
type=raw,value=${{ env.FEDORA_BASE }}-{{date 'YYYYMMDD'}},enable=${{ github.ref == format('refs/heads/{0}', 'main' }}
|
||||||
|
type=raw,value=beta,enable=${{ github.ref != format('refs/heads/{0}', 'main') }}
|
||||||
type=sha,enable=${{ github.event_name == 'pull_request' }}
|
type=sha,enable=${{ github.event_name == 'pull_request' }}
|
||||||
type=ref,event=pr
|
type=ref,event=pr
|
||||||
labels: |
|
labels: |
|
||||||
|
|||||||
@@ -3,18 +3,10 @@ ARG FEDORA_BASE=42
|
|||||||
# Allow build scripts to be referenced without being copied into the final image
|
# Allow build scripts to be referenced without being copied into the final image
|
||||||
FROM scratch AS ctx
|
FROM scratch AS ctx
|
||||||
COPY build_files /
|
COPY build_files /
|
||||||
|
COPY /sys_files /sys_files
|
||||||
|
|
||||||
# Base Image
|
# Base Image
|
||||||
FROM ghcr.io/ublue-os/silverblue-main:$FEDORA_BASE
|
FROM quay.io/fedora-ostree-desktops/silverblue:$FEDORA_BASE
|
||||||
|
|
||||||
## Other possible base images include:
|
|
||||||
# FROM ghcr.io/ublue-os/bazzite:latest
|
|
||||||
# FROM ghcr.io/ublue-os/bluefin-nvidia:stable
|
|
||||||
#
|
|
||||||
# ... and so on, here are more base images
|
|
||||||
# Universal Blue Images: https://github.com/orgs/ublue-os/packages
|
|
||||||
# Fedora base image: quay.io/fedora/fedora-bootc:41
|
|
||||||
# CentOS base images: quay.io/centos-bootc/centos-bootc:stream10
|
|
||||||
|
|
||||||
### [IM]MUTABLE /opt
|
### [IM]MUTABLE /opt
|
||||||
## Some bootable images, like Fedora, have /opt symlinked to /var/opt, in order to
|
## Some bootable images, like Fedora, have /opt symlinked to /var/opt, in order to
|
||||||
|
|||||||
@@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
set -ouex pipefail
|
set -ouex pipefail
|
||||||
|
|
||||||
|
# Copy System Files onto root
|
||||||
|
rsync -rvK /ctx/sys_files/ /
|
||||||
|
|
||||||
### Install packages
|
### Install packages
|
||||||
|
|
||||||
# Packages can be installed from any enabled yum repo on the image.
|
# Packages can be installed from any enabled yum repo on the image.
|
||||||
@@ -9,8 +12,47 @@ set -ouex pipefail
|
|||||||
# List of rpmfusion packages can be found here:
|
# List of rpmfusion packages can be found here:
|
||||||
# https://mirrors.rpmfusion.org/mirrorlist?path=free/fedora/updates/39/x86_64/repoview/index.html&protocol=https&redirect=1
|
# https://mirrors.rpmfusion.org/mirrorlist?path=free/fedora/updates/39/x86_64/repoview/index.html&protocol=https&redirect=1
|
||||||
|
|
||||||
|
# Install RPMFusion and enable fedora-multimedia with a higher priority than default
|
||||||
|
if ! grep -q fedora-multimedia <(dnf5 repolist); then
|
||||||
|
# Enable or Install Repofile
|
||||||
|
#dnf5 install \
|
||||||
|
# https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm \
|
||||||
|
# https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm
|
||||||
|
|
||||||
|
# Enable fedora-multimedia
|
||||||
|
dnf5 config-manager setopt fedora-multimedia.enabled=1 ||
|
||||||
|
dnf5 config-manager addrepo --from-repofile="https://negativo17.org/repos/fedora-multimedia.repo"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Set higher priority
|
||||||
|
dnf5 config-manager setopt fedora-multimedia.priority=90
|
||||||
|
|
||||||
# Remove system-installed Firefox as I prefer to use the Flatpak version
|
# Remove system-installed Firefox as I prefer to use the Flatpak version
|
||||||
dnf5 remove -y firefox firefox-langpacks
|
dnf5 remove -y firefox firefox-langpacks fedora-flathub-remote
|
||||||
|
|
||||||
|
# Add Flathub to the image for eventual application
|
||||||
|
mkdir -p /etc/flatpak/remotes.d/
|
||||||
|
curl --retry 3 -Lo /etc/flatpak/remotes.d/flathub.flatpakrepo https://dl.flathub.org/repo/flathub.flatpakrepo
|
||||||
|
|
||||||
|
# use override to replace mesa and others with less crippled versions
|
||||||
|
OVERRIDES=(
|
||||||
|
"intel-gmmlib"
|
||||||
|
"intel-mediasdk"
|
||||||
|
"intel-vpl-gpu-rt"
|
||||||
|
"libheif"
|
||||||
|
"libva"
|
||||||
|
"libva-intel-media-driver"
|
||||||
|
"mesa-dri-drivers"
|
||||||
|
"mesa-filesystem"
|
||||||
|
"mesa-libEGL"
|
||||||
|
"mesa-libGL"
|
||||||
|
"mesa-libgbm"
|
||||||
|
"mesa-va-drivers"
|
||||||
|
"mesa-vulkan-drivers"
|
||||||
|
)
|
||||||
|
|
||||||
|
dnf5 distro-sync --skip-unavailable -y --repo='fedora-multimedia' "${OVERRIDES[@]}"
|
||||||
|
dnf5 versionlock add "${OVERRIDES[@]}"
|
||||||
|
|
||||||
# Remove additional repositories Fedora comes with out of the box
|
# Remove additional repositories Fedora comes with out of the box
|
||||||
rm \
|
rm \
|
||||||
@@ -26,10 +68,10 @@ sed -i -e '/^metalink\=/s/\$releasever\&arch\=\$basearch$/\$releasever\&arch\=\$
|
|||||||
|
|
||||||
# Add 1Password repo
|
# Add 1Password repo
|
||||||
#rpmkeys --import https://downloads.1password.com/linux/keys/1password.asc
|
#rpmkeys --import https://downloads.1password.com/linux/keys/1password.asc
|
||||||
cp /ctx/rpm-keys/1password.asc /etc/pki/rpm-gpg/1password.asc
|
cp /ctx/rpm-keys/1password.asc /etc/pki/rpm-gpg/1password.asc
|
||||||
sh -c 'echo -e "[1password]\nname=1Password Stable Channel\nbaseurl=https://downloads.1password.com/linux/rpm/stable/\$basearch\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=1\ngpgkey=\"file:///etc/pki/rpm-gpg/1password.asc\"" > /etc/yum.repos.d/1password.repo'
|
sh -c 'echo -e "[1password]\nname=1Password Stable Channel\nbaseurl=https://downloads.1password.com/linux/rpm/stable/\$basearch\nenabled=1\ngpgcheck=1\nrepo_gpgcheck=1\ngpgkey=\"file:///etc/pki/rpm-gpg/1password.asc\"" > /etc/yum.repos.d/1password.repo'
|
||||||
|
|
||||||
# Add Tailscale repo
|
# Add Tailscale repo
|
||||||
#rpmkeys --import https://pkgs.tailscale.com/stable/fedora/repo.gpg
|
#rpmkeys --import https://pkgs.tailscale.com/stable/fedora/repo.gpg
|
||||||
#dnf5 config-manager addrepo --from-repofile=https://pkgs.tailscale.com/stable/fedora/tailscale.repo
|
#dnf5 config-manager addrepo --from-repofile=https://pkgs.tailscale.com/stable/fedora/tailscale.repo
|
||||||
cp /ctx/rpm-keys/tailscale.gpg /etc/pki/rpm-gpg/tailscale.gpg
|
cp /ctx/rpm-keys/tailscale.gpg /etc/pki/rpm-gpg/tailscale.gpg
|
||||||
@@ -42,6 +84,10 @@ sh -c 'echo -e "[tailscale-stable]\nname=Tailscale stable\nbaseurl=https://pkgs.
|
|||||||
dnf5 install -y \
|
dnf5 install -y \
|
||||||
gvfs-nfs \
|
gvfs-nfs \
|
||||||
openssl \
|
openssl \
|
||||||
|
wl-clipboard \
|
||||||
|
ffmpeg ffmpeg-libs ffmpegthumbnailer \
|
||||||
|
heif-pixbuf-loader intel-vaapi-driver libavcodec libheif \
|
||||||
|
libcamera libcamera-gstreamer libcamera-ipa libcamera-tools pipewire-plugin-libcamera \
|
||||||
gnome-shell-extension-appindicator \
|
gnome-shell-extension-appindicator \
|
||||||
1password 1password-cli \
|
1password 1password-cli \
|
||||||
tailscale
|
tailscale
|
||||||
@@ -58,34 +104,27 @@ rm \
|
|||||||
# dnf5 config-manager setopt 1password.enabled=0 tailscale-stable.enabled=0
|
# dnf5 config-manager setopt 1password.enabled=0 tailscale-stable.enabled=0
|
||||||
# sed -i 's/enabled=1/enabled=0/' \
|
# sed -i 's/enabled=1/enabled=0/' \
|
||||||
# /etc/yum.repos.d/1password.repo \
|
# /etc/yum.repos.d/1password.repo \
|
||||||
# /etc/yum.repos.d/tailscale.repo
|
# /etc/yum.repos.d/tailscale.repo \
|
||||||
|
|
||||||
# Add Flathub
|
# Fedora Flatpak service is a part of the flatpak package, ensure it's overridden by moving to replace it at the end of the build.
|
||||||
#flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
|
mv -f /usr/lib/systemd/system/flatpak-add-flathub-repos.service /usr/lib/systemd/system/flatpak-add-fedora-repos.service
|
||||||
#flatpak remote-modify --enable --no-filter flathub
|
|
||||||
|
|
||||||
# Re-install all pre-installed (GNOME) applications from Flathub
|
# Enable Tailscale
|
||||||
#flatpak install --reinstall flathub "$(flatpak list --app-runtime=org.fedoraproject.Platform --columns=application | tail -n +1 )"
|
|
||||||
|
|
||||||
# ...and remove the fedora flatpak remotes
|
|
||||||
#flatpak remote-delete --force fedora
|
|
||||||
#flatpak remote-delete --force fedora-testing
|
|
||||||
|
|
||||||
|
|
||||||
# TODO: Add flathub remove, enable, and remove filter
|
|
||||||
# TODO: Install core GNOME Flatpak apps
|
|
||||||
# TODO: Install my own commonly used Flatpak apps
|
|
||||||
# IDEA: Can I set certain dconf settings, like Ptyxis config, temperature settings, etc?
|
|
||||||
# IDEA: Can I set certain Flatpak system defaults (ie. no read/write anywhere by default)
|
|
||||||
|
|
||||||
# Use a COPR Example:
|
|
||||||
#
|
|
||||||
# dnf5 -y copr enable ublue-os/staging
|
|
||||||
# dnf5 -y install package
|
|
||||||
# Disable COPRs so they don't end up enabled on the final image:
|
|
||||||
# dnf5 -y copr disable ublue-os/staging
|
|
||||||
|
|
||||||
#### Example for enabling a System Unit File
|
|
||||||
|
|
||||||
# systemctl enable podman.socket
|
|
||||||
systemctl enable tailscaled
|
systemctl enable tailscaled
|
||||||
|
|
||||||
|
# Cleanup
|
||||||
|
|
||||||
|
# Remove dnf5 versionlocks
|
||||||
|
dnf5 versionlock clear
|
||||||
|
|
||||||
|
# Remove tmp files and everything in dirs that make bootc unhappy
|
||||||
|
rm -rf /tmp/* || true
|
||||||
|
rm -rf /usr/etc
|
||||||
|
rm -rf /boot && mkdir /boot
|
||||||
|
# Preserve cache mounts
|
||||||
|
find /var/* -maxdepth 0 -type d \! -name cache \! -name log -exec rm -rf {} \;
|
||||||
|
find /var/cache/* -maxdepth 0 -type d \! -name libdnf5 -exec rm -rf {} \;
|
||||||
|
|
||||||
|
# Make sure /var/tmp is properly created
|
||||||
|
mkdir -p /var/tmp
|
||||||
|
chmod -R 1777 /var/tmp
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
[Unit]
|
||||||
|
Description=Add Flathub flatpak repositories. This replaces a service included by Fedora that normally installs their repo.
|
||||||
|
ConditionPathExists=!/var/lib/flatpak/.ublue-initialized
|
||||||
|
Before=flatpak-system-helper.service
|
||||||
|
|
||||||
|
[Service]
|
||||||
|
Type=oneshot
|
||||||
|
RemainAfterExit=yes
|
||||||
|
ExecStart=/usr/bin/flatpak remote-add --system --if-not-exists flathub /etc/flatpak/remotes.d/flathub.flatpakrepo
|
||||||
|
ExecStart=/usr/bin/flatpak remote-add --system --if-not-exists --disable --title "Fedora Flatpaks" fedora oci+https://registry.fedoraproject.org
|
||||||
|
ExecStart=/usr/bin/flatpak remote-add --system --if-not-exists --disable --title "Fedora Flatpaks (testing)" fedora-testing oci+https://registry.fedoraproject.org#testing
|
||||||
|
ExecStartPost=/usr/bin/touch /var/lib/flatpak/.ublue-initialized
|
||||||
|
|
||||||
|
[Install]
|
||||||
|
WantedBy=multi-user.target
|
||||||
Reference in New Issue
Block a user