mirror of
https://github.com/ManInDark/bootc-image.git
synced 2026-01-20 22:44:28 +01:00
Compare commits
3 Commits
73ccad4340
...
dadc897884
| Author | SHA1 | Date | |
|---|---|---|---|
|
dadc897884
|
|||
|
784ca0de59
|
|||
|
490a3bab8e
|
@@ -1,24 +1,26 @@
|
||||
FROM scratch AS ctx
|
||||
COPY build_files /
|
||||
|
||||
FROM ghcr.io/ublue-os/akmods-nvidia:main-42 AS nvidia
|
||||
|
||||
FROM ghcr.io/ublue-os/base-main:42
|
||||
|
||||
RUN rm -r /opt && mkdir /opt
|
||||
|
||||
RUN --mount=type=bind,from=ctx,source=/,target=/ctx \
|
||||
--mount=type=bind,from=nvidia,source=/,target=/nvidia \
|
||||
--mount=type=cache,dst=/var/cache \
|
||||
--mount=type=cache,dst=/var/log \
|
||||
--mount=type=tmpfs,dst=/tmp \
|
||||
/ctx/nvidia.sh
|
||||
|
||||
RUN --mount=type=bind,from=ctx,source=/,target=/ctx \
|
||||
--mount=type=cache,dst=/var/cache \
|
||||
--mount=type=cache,dst=/var/log \
|
||||
--mount=type=tmpfs,dst=/tmp \
|
||||
/ctx/build.sh
|
||||
|
||||
RUN --mount=type=bind,from=ctx,source=/,target=/ctx \
|
||||
--mount=type=bind,from=nvidia,source=/,target=/nvidia \
|
||||
--mount=type=cache,dst=/var/cache \
|
||||
--mount=type=cache,dst=/var/log \
|
||||
--mount=type=tmpfs,dst=/tmp \
|
||||
/ctx/nvidia.sh
|
||||
/ctx/initramfs.sh
|
||||
|
||||
RUN bootc container lint
|
||||
|
||||
@@ -8,7 +8,7 @@ dnf5 update -y --setopt=install_weak_deps=False
|
||||
dnf5 install -y man-pages man-db glibc-langpack-en glibc-langpack-de plymouth
|
||||
dnf5 install -y --setopt=exclude=gnome-tour,malcontent-control gnome-shell gnome-keyring gnome-keyring-pam gnome-bluetooth gnome-terminal nautilus seahorse evolution totem gstreamer1-plugin-libav gnome-extensions-app gnome-browser-connector gnome-shell-extension-appindicator
|
||||
dnf5 install -y gnome-calculator gnome-disk-utility gnome-backgrounds
|
||||
dnf5 install -y curl git btop nvtop tmux flatpak pciutils tailscale make fzf direnv xsel chromium pandoc-common pandoc-pdf ansible-core ansible-collection-community-general vlc
|
||||
dnf5 install -y curl git btop nvtop tmux flatpak pciutils tailscale make fzf direnv xsel chromium pandoc-common pandoc-pdf texlive-collection-langgerman ansible-core ansible-collection-community-general vlc
|
||||
git clone https://github.com/Tudmotu/gnome-shell-extension-clipboard-indicator.git /usr/share/gnome-shell/extensions/clipboard-indicator@tudmotu.com
|
||||
flatpak remote-add --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo
|
||||
echo "LANG=de_DE.UTF-8" >> /etc/default/locale
|
||||
|
||||
14
build_files/initramfs.sh
Executable file
14
build_files/initramfs.sh
Executable file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/bash
|
||||
# https://github.com/ublue-os/bluefin/blob/ba5d621270982b245343abcae47b3393cc5cffb8/build_files/base/19-initramfs.sh
|
||||
|
||||
echo "::group:: ===$(basename "$0")==="
|
||||
|
||||
set -oue pipefail
|
||||
|
||||
KERNEL_SUFFIX=""
|
||||
QUALIFIED_KERNEL="$(rpm -qa | grep -P 'kernel-(|'"$KERNEL_SUFFIX"'-)(\d+\.\d+\.\d+)' | sed -E 's/kernel-(|'"$KERNEL_SUFFIX"'-)//')"
|
||||
export DRACUT_NO_XATTR=1
|
||||
/usr/bin/dracut --no-hostonly --kver "$QUALIFIED_KERNEL" --reproducible -v --add ostree -f "/lib/modules/$QUALIFIED_KERNEL/initramfs.img"
|
||||
chmod 0600 "/lib/modules/$QUALIFIED_KERNEL/initramfs.img"
|
||||
|
||||
echo "::endgroup::"
|
||||
@@ -1,13 +1,65 @@
|
||||
rpm-ostree install -y rpmdevtools akmods
|
||||
rpm-ostree install -y 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
|
||||
rpm-ostree install -y ffmpeg x265-libs
|
||||
#!/usr/bin/bash
|
||||
# based on https://raw.githubusercontent.com/ublue-os/bluefin/ba5d621270982b245343abcae47b3393cc5cffb8/build_files/base/03-install-kernel-akmods.sh
|
||||
|
||||
# https://rpmfusion.org/Howto/NVIDIA
|
||||
# https://www.tecmint.com/install-nvidia-drivers-in-linux
|
||||
# https://github.com/ublue-os/akmods
|
||||
# https://github.com/Comprehensive-Wall28/Nvidia-Fedora-Guide
|
||||
# following Nvidia-Fedora-Guide installation
|
||||
rpm-ostree install -y akmod-nvidia xorg-x11-drv-nvidia-cuda # xorg-x11-drv-nvidia
|
||||
echo "::group:: ===$(basename "$0")==="
|
||||
|
||||
dnf5 clean all
|
||||
# Set Variables
|
||||
export AKMODS_FLAVOR=main
|
||||
export KERNEL="6.17.9-200.fc42.x86_64"
|
||||
export IMAGE_NAME=""
|
||||
|
||||
set -eoux pipefail
|
||||
|
||||
# Remove Existing Kernel
|
||||
for pkg in kernel kernel-core kernel-modules kernel-modules-core kernel-modules-extra; do
|
||||
rpm --erase $pkg --nodeps
|
||||
done
|
||||
|
||||
# Fetch Common AKMODS & Kernel RPMS
|
||||
skopeo copy --retry-times 3 docker://ghcr.io/ublue-os/akmods:"${AKMODS_FLAVOR}"-"$(rpm -E %fedora)"-"${KERNEL}" dir:/tmp/akmods
|
||||
AKMODS_TARGZ=$(jq -r '.layers[].digest' </tmp/akmods/manifest.json | cut -d : -f 2)
|
||||
tar -xvzf /tmp/akmods/"$AKMODS_TARGZ" -C /tmp/
|
||||
mv /tmp/rpms/* /tmp/akmods/
|
||||
# NOTE: kernel-rpms should auto-extract into correct location
|
||||
|
||||
# Install Kernel
|
||||
dnf5 -y install \
|
||||
/tmp/kernel-rpms/kernel-[0-9]*.rpm \
|
||||
/tmp/kernel-rpms/kernel-core-*.rpm \
|
||||
/tmp/kernel-rpms/kernel-modules-*.rpm
|
||||
|
||||
# TODO: Figure out why akmods cache is pulling in akmods/kernel-devel
|
||||
dnf5 -y install \
|
||||
/tmp/kernel-rpms/kernel-devel-*.rpm
|
||||
|
||||
dnf5 versionlock add kernel kernel-devel kernel-devel-matched kernel-core kernel-modules kernel-modules-core kernel-modules-extra
|
||||
|
||||
# Everyone
|
||||
# NOTE: we won't use dnf5 copr plugin for ublue-os/akmods until our upstream provides the COPR standard naming
|
||||
sed -i 's@enabled=0@enabled=1@g' /etc/yum.repos.d/_copr_ublue-os-akmods.repo
|
||||
|
||||
# Nvidia AKMODS
|
||||
|
||||
# Fetch Nvidia RPMs
|
||||
skopeo copy --retry-times 3 docker://ghcr.io/ublue-os/akmods-nvidia-open:"${AKMODS_FLAVOR}"-"$(rpm -E %fedora)"-"${KERNEL}" dir:/tmp/akmods-rpms
|
||||
NVIDIA_TARGZ=$(jq -r '.layers[].digest' </tmp/akmods-rpms/manifest.json | cut -d : -f 2)
|
||||
tar -xvzf /tmp/akmods-rpms/"$NVIDIA_TARGZ" -C /tmp/
|
||||
mv /tmp/rpms/* /tmp/akmods-rpms/
|
||||
|
||||
# Monkey patch right now...
|
||||
if ! grep -q negativo17 <(rpm -qi mesa-dri-drivers); then
|
||||
dnf5 -y swap --repo=updates-testing \
|
||||
mesa-dri-drivers mesa-dri-drivers
|
||||
fi
|
||||
|
||||
# Install Nvidia RPMs
|
||||
curl -sSL "https://raw.githubusercontent.com/ublue-os/main/main/build_files/nvidia-install.sh" -o /tmp/nvidia-install.sh
|
||||
chmod +x /tmp/nvidia-install.sh
|
||||
/tmp/nvidia-install.sh
|
||||
rm -f /usr/share/vulkan/icd.d/nouveau_icd.*.json
|
||||
ln -sf libnvidia-ml.so.1 /usr/lib64/libnvidia-ml.so
|
||||
tee /usr/lib/bootc/kargs.d/00-nvidia.toml <<EOF
|
||||
kargs = ["rd.driver.blacklist=nouveau", "modprobe.blacklist=nouveau", "nvidia-drm.modeset=1", "initcall_blacklist=simpledrm_platform_driver_init"]
|
||||
EOF
|
||||
|
||||
echo "::endgroup::"
|
||||
Reference in New Issue
Block a user