forked from ublue-os/bazzite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContainerfile
344 lines (318 loc) · 14.5 KB
/
Containerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
ARG BASE_IMAGE_NAME="${BASE_IMAGE_NAME:-silverblue}"
ARG BASE_IMAGE_FLAVOR="${BASE_IMAGE_FLAVOR:-main}"
ARG IMAGE_FLAVOR="${IMAGE_FLAVOR:-main}"
ARG NVIDIA_FLAVOR=${NVIDIA_FLAVOR:-nvidia}""
ARG KERNEL_FLAVOR="${KERNEL_FLAVOR:-bazzite}"
ARG IMAGE_BRANCH="${IMAGE_BRANCH:-main}"
ARG SOURCE_IMAGE="${SOURCE_IMAGE:-$BASE_IMAGE_NAME-$BASE_IMAGE_FLAVOR}"
ARG BASE_IMAGE="ghcr.io/ublue-os/${SOURCE_IMAGE}"
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-41}"
ARG SHA_HEAD_SHORT="${SHA_HEAD_SHORT}"
ARG VERSION_TAG="${VERSION_TAG}"
ARG VERSION_PRETTY="${VERSION_PRETTY}"
FROM ghcr.io/ublue-os/akmods:${KERNEL_FLAVOR}-${FEDORA_MAJOR_VERSION} AS akmods
FROM ghcr.io/ublue-os/akmods-extra:${KERNEL_FLAVOR}-${FEDORA_MAJOR_VERSION} AS akmods-extra
FROM scratch AS ctx
COPY build_files /
FROM ${BASE_IMAGE}:${FEDORA_MAJOR_VERSION} AS drelbsos
ARG IMAGE_NAME="${IMAGE_NAME:-drelbsos}"
ARG IMAGE_VENDOR="${IMAGE_VENDOR:-ublue-os}"
ARG IMAGE_FLAVOR="${IMAGE_FLAVOR:-main}"
ARG NVIDIA_FLAVOR="${NVIDIA_FLAVOR:-nvidia}"
ARG KERNEL_FLAVOR="${KERNEL_FLAVOR:-bazzite}"
ARG IMAGE_BRANCH="${IMAGE_BRANCH:-main}"
ARG BASE_IMAGE_NAME="${BASE_IMAGE_NAME:-silverblue}"
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-41}"
ARG SHA_HEAD_SHORT="${SHA_HEAD_SHORT}"
ARG VERSION_TAG="${VERSION_TAG}"
ARG VERSION_PRETTY="${VERSION_PRETTY}"
COPY system_files/desktop/shared /
# Setup Copr repos (new)
RUN --mount=type=cache,dst=/var/cache/libdnf5 \
--mount=type=cache,dst=/var/cache/rpm-ostree \
--mount=type=bind,from=ctx,source=/,target=/ctx \
--mount=type=tmpfs,dst=/tmp \
/ctx/unwrap && \
dnf5 -y install dnf5-plugins && \
for copr in \
kylegospo/bazzite \
ublue-os/staging \
kylegospo/LatencyFleX \
kylegospo/rom-properties \
kylegospo/webapp-manager \
hhd-dev/hhd \
che/nerd-fonts \
hikariknight/looking-glass-kvmfr \
rok/cdemu \
rodoma92/rmlint \
ilyaz/LACT; \
do \
dnf5 -y copr enable $copr; \
dnf5 -y config-manager setopt copr:copr.fedorainfracloud.org:${copr////:}.priority=98 ;\
done && unset -v copr && \
dnf5 -y config-manager addrepo --overwrite --from-repofile=https://download.opensuse.org/repositories/hardware:/razer/Fedora_$(rpm -E %fedora)/hardware:razer.repo && \
dnf5 -y 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 && \
sed -i 's@enabled=0@enabled=1@g' /etc/yum.repos.d/negativo17-fedora-multimedia.repo && \
dnf5 -y config-manager addrepo --from-repofile=https://negativo17.org/repos/fedora-rar.repo && \
dnf5 -y config-manager setopt "*bazzite*".priority=1 && \
dnf5 -y config-manager setopt "*akmods*".priority=2 && \
eval "$(/ctx/dnf5-setopt setopt '*negativo17*' priority=4 exclude='mesa-* *xone*')" && \
dnf5 -y config-manager setopt "*rpmfusion*".priority=5 "*rpmfusion*".exclude="mesa-*" && \
dnf5 -y config-manager setopt "*fedora*".exclude="mesa-* kernel-core-* kernel-modules-* kernel-uki-virt-*" && \
dnf5 -y config-manager setopt "*staging*".exclude="scx-scheds kf6-* mesa* mutter* rpm-ostree* systemd* gnome-shell gnome-settings-daemon gnome-control-center gnome-software libadwaita tuned*" && \
/ctx/cleanup
# Install kernel
RUN --mount=type=cache,dst=/var/cache/libdnf5 \
--mount=type=cache,dst=/var/cache/rpm-ostree \
--mount=type=bind,from=akmods,src=/kernel-rpms,dst=/tmp/kernel-rpms \
--mount=type=bind,from=akmods,src=/rpms,dst=/tmp/akmods-rpms \
--mount=type=bind,from=akmods-extra,src=/rpms,dst=/tmp/akmods-extra-rpms \
--mount=type=bind,from=ctx,source=/,target=/ctx \
--mount=type=tmpfs,dst=/tmp \
/ctx/install-kernel-akmods && \
dnf5 -y config-manager setopt "*rpmfusion*".enabled=0 && \
dnf5 -y copr enable bieszczaders/kernel-cachyos-addons && \
dnf5 -y install \
scx-scheds && \
dnf5 -y copr disable bieszczaders/kernel-cachyos-addons && \
for toswap in rpm-ostree bootc; do \
dnf5 -y swap --repo copr:copr.fedorainfracloud.org:kylegospo:bazzite $toswap $toswap; \
done && unset -v toswap && \
/ctx/cleanup
# Install codec stuff
# Install patched fwupd
# Install Valve's patched Mesa, Pipewire, Bluez, and Xwayland
# Install patched switcheroo control with proper discrete GPU support
RUN --mount=type=cache,dst=/var/cache/libdnf5 \
--mount=type=cache,dst=/var/cache/rpm-ostree \
--mount=type=bind,from=ctx,source=/,target=/ctx \
--mount=type=tmpfs,dst=/tmp \
dnf5 -y install --enable-repo="*rpmfusion*" --disable-repo="*fedora-multimedia*" \
libaacs \
libbdplus \
libbluray \
libbluray-utils && \
/ctx/cleanup
# Remove unneeded packages
RUN --mount=type=cache,dst=/var/cache/libdnf5 \
--mount=type=cache,dst=/var/cache/rpm-ostree \
--mount=type=bind,from=ctx,source=/,target=/ctx \
--mount=type=tmpfs,dst=/tmp \
dnf5 -y remove \
ublue-os-update-services \
opensc \
firefox \
firefox-langpacks && \
/ctx/cleanup
# Install new packages
RUN --mount=type=cache,dst=/var/cache/libdnf5 \
--mount=type=cache,dst=/var/cache/rpm-ostree \
--mount=type=bind,from=ctx,source=/,target=/ctx \
--mount=type=tmpfs,dst=/tmp \
dnf5 -y install \
twitter-twemoji-fonts \
google-noto-sans-cjk-fonts \
lato-fonts \
fira-code-fonts \
nerd-fonts \
google-droid-sans-mono-fonts \
python3-pip \
libadwaita \
duperemove \
sqlite \
xwininfo \
xrandr \
compsize \
ryzenadj \
ddcutil \
input-remapper \
i2c-tools \
udica \
python3-icoextract \
webapp-manager \
zsh \
btop \
lshw \
xdotool \
wmctrl \
libcec \
yad \
f3 \
pulseaudio-utils \
lzip \
rar \
libxcrypt-compat \
vulkan-tools \
xwiimote-ng \
fastfetch \
vim \
topgrade \
ydotool \
cdemu-daemon \
cdemu-client \
gcdemu \
openrazer-daemon \
egl-utils \
ncdu \
btrfs-assistant \
podman-compose \
edk2-ovmf \
qemu \
unetbootin \
libvirt \
lsb_release \
wlr-randr && \
mkdir -p /etc/xdg/autostart && \
sed -i 's/ --xdg-runtime=\\"${XDG_RUNTIME_DIR}\\"//g' /usr/bin/btrfs-assistant-launcher && \
curl -Lo /usr/bin/installcab https://raw.githubusercontent.com/KyleGospo/steam-proton-mf-wmv/master/installcab.py && \
chmod +x /usr/bin/installcab && \
curl -Lo /usr/bin/install-mf-wmv https://github.com/KyleGospo/steam-proton-mf-wmv/blob/master/install-mf-wmv.sh && \
chmod +x /usr/bin/install-mf-wmv && \
curl -Lo /tmp/ls-iommu.tar.gz $(curl https://api.github.com/repos/HikariKnight/ls-iommu/releases/latest | jq -r '.assets[] | select(.name| test(".*x86_64.tar.gz$")).browser_download_url') && \
mkdir -p /tmp/ls-iommu && \
tar --no-same-owner --no-same-permissions --no-overwrite-dir -xvzf /tmp/ls-iommu.tar.gz -C /tmp/ls-iommu && \
rm -f /tmp/ls-iommu.tar.gz && \
cp -r /tmp/ls-iommu/ls-iommu /usr/bin/ && \
/ctx/cleanup
# Configure GNOME overrides
RUN --mount=type=cache,dst=/var/cache/libdnf5 \
--mount=type=cache,dst=/var/cache/rpm-ostree \
--mount=type=bind,from=ctx,source=/,target=/ctx \
--mount=type=tmpfs,dst=/tmp \
dnf5 -y install \
nautilus-gsconnect \
gnome-randr-rust \
gnome-shell-extension-appindicator \
gnome-shell-extension-user-theme \
gnome-shell-extension-gsconnect \
gnome-shell-extension-bazzite-menu \
firewall-config \
rom-properties-gtk3 && \
/ctx/cleanup
# Cleanup & Finalize
COPY system_files/overrides /
RUN --mount=type=cache,dst=/var/cache/libdnf5 \
--mount=type=cache,dst=/var/cache/rpm-ostree \
--mount=type=bind,from=ctx,source=/,target=/ctx \
--mount=type=tmpfs,dst=/tmp \
rm -f /etc/profile.d/toolbox.sh && \
mkdir -p /var/tmp && chmod 1777 /var/tmp && \
sed -i 's/#UserspaceHID.*/UserspaceHID=true/' /etc/bluetooth/input.conf && \
sed -i "s/^SCX_SCHEDULER=.*/SCX_SCHEDULER=scx_bpfland/" /etc/default/scx && \
rm -f /usr/lib/systemd/system/service.d/50-keep-warm.conf && \
mkdir -p "/etc/profile.d/" && \
ln -s "/usr/share/ublue-os/firstboot/launcher/login-profile.sh" \
"/etc/profile.d/ublue-firstboot.sh" && \
mkdir -p "/etc/xdg/autostart" && \
echo "import \"/usr/share/ublue-os/just/81-bazzite-fixes.just\"" >> /usr/share/ublue-os/justfile && \
echo "import \"/usr/share/ublue-os/just/84-bazzite-virt.just\"" >> /usr/share/ublue-os/justfile && \
sed -i 's/stage/check/g' /etc/rpm-ostreed.conf && \
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/_copr_ublue-os-akmods.repo && \
for copr in \
kylegospo/bazzite \
ublue-os/staging \
kylegospo/LatencyFleX \
kylegospo/rom-properties \
kylegospo/webapp-manager \
hhd-dev/hhd \
che/nerd-fonts \
lizardbyte/beta \
hikariknight/looking-glass-kvmfr; \
do \
dnf5 -y copr disable $copr; \
done && unset -v copr && \
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/negativo17-fedora-multimedia.repo && \
eval "$(/ctx/dnf5-setopt setopt '*negativo17*' enabled=0)" && \
mkdir -p /etc/flatpak/remotes.d && \
curl -Lo /etc/flatpak/remotes.d/flathub.flatpakrepo https://dl.flathub.org/repo/flathub.flatpakrepo && \
systemctl enable input-remapper.service && \
systemctl enable bazzite-flatpak-manager.service && \
systemctl enable incus-workaround.service && \
systemctl enable bazzite-hardware-setup.service && \
systemctl enable dev-hugepages1G.mount && \
systemctl --global enable bazzite-user-setup.service && \
systemctl --global enable podman.socket && \
systemctl --global enable systemd-tmpfiles-setup.service && \
sed -i 's@\[Desktop Entry\]@\[Desktop Entry\]\nNoDisplay=true@g' /usr/share/applications/yad-icon-browser.desktop && \
sed -i '/^PRETTY_NAME/s/Bazzite/DrelbsOS/' /usr/lib/os-release && \
curl -Lo /etc/dxvk-example.conf https://raw.githubusercontent.com/doitsujin/dxvk/master/dxvk.conf && \
curl -Lo /usr/lib/sysctl.d/99-bore-scheduler.conf https://github.com/CachyOS/CachyOS-Settings/raw/master/usr/lib/sysctl.d/99-bore-scheduler.conf && \
curl -Lo /etc/distrobox/docker.ini https://github.com/ublue-os/toolboxes/raw/refs/heads/main/apps/docker/distrobox.ini && \
curl -Lo /etc/distrobox/incus.ini https://github.com/ublue-os/toolboxes/raw/refs/heads/main/apps/incus/distrobox.ini && \
/ctx/image-info && \
/ctx/build-initramfs && \
/ctx/finalize
FROM ghcr.io/ublue-os/akmods-${NVIDIA_FLAVOR}:${KERNEL_FLAVOR}-${FEDORA_MAJOR_VERSION} AS nvidia-akmods
FROM drelbsos AS drelbsos-nvidia
ARG IMAGE_NAME="${IMAGE_NAME:-drelbsos-nvidia}"
ARG IMAGE_VENDOR="${IMAGE_VENDOR:-ublue-os}"
ARG IMAGE_FLAVOR="${IMAGE_FLAVOR:-nvidia}"
ARG NVIDIA_FLAVOR="${NVIDIA_FLAVOR:-nvidia}"
ARG KERNEL_FLAVOR="${KERNEL_FLAVOR:-bazzite}"
ARG IMAGE_BRANCH="${IMAGE_BRANCH:-main}"
ARG BASE_IMAGE_NAME="${BASE_IMAGE_NAME:-silverblue}"
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-41}"
ARG VERSION_TAG="${VERSION_TAG}"
ARG VERSION_PRETTY="${VERSION_PRETTY}"
# Install NVIDIA driver
RUN --mount=type=cache,dst=/var/cache/libdnf5 \
--mount=type=cache,dst=/var/cache/rpm-ostree \
--mount=type=bind,from=ctx,source=/,target=/ctx \
--mount=type=bind,from=nvidia-akmods,src=/rpms,dst=/tmp/akmods-rpms \
--mount=type=tmpfs,dst=/tmp \
dnf5 -y copr enable ublue-os/staging && \
dnf5 -y install \
mesa-vdpau-drivers.x86_64 \
mesa-vdpau-drivers.i686 && \
curl -Lo /tmp/nvidia-install.sh https://raw.githubusercontent.com/ublue-os/hwe/1ea2a91b839fc8d635fdf546a74e66bc4eb48c2a/nvidia-install.sh && \
chmod +x /tmp/nvidia-install.sh && \
IMAGE_NAME="${BASE_IMAGE_NAME}" /tmp/nvidia-install.sh && \
rm -f /usr/share/vulkan/icd.d/nouveau_icd.*.json && \
rm -f /usr/share/vulkan/icd.d/lvp_icd.*.json && \
ln -s libnvidia-ml.so.1 /usr/lib64/libnvidia-ml.so && \
dnf5 -y copr disable ublue-os/staging && \
/ctx/cleanup
# sed -i 's@enabled=0@enabled=1@g' /etc/yum.repos.d/negativo17-fedora-multimedia.repo && \
# sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/rpmfusion*.repo && \
# sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/fedora-cisco-openh264.repo && \
# dnf5 install -y /tmp/akmods-rpms/ublue-os/ublue-os-nvidia-addons-*.rpm && \
# sed -i '0,/enabled=0/{s/enabled=0/enabled=1/}' /etc/yum.repos.d/negativo17-fedora-nvidia.repo && \
# sed -i '0,/enabled=0/{s/enabled=0/enabled=1/}' /etc/yum.repos.d/nvidia-container-toolkit.repo && \
# sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/negativo17-fedora-multimedia.repo && \
# source /tmp/akmods-rpms/kmods/nvidia-vars && \
# dnf5 install -y \
# libnvidia-fbc \
# libnvidia-ml.i686 \
# libva-nvidia-driver \
# nvidia-driver \
# nvidia-driver-cuda \
# nvidia-driver-libs.i686 \
# # TODO needed for x86
# vulkan-loader.i686 \
# nvidia-settings \
# nvidia-container-toolkit ${VARIANT_PKGS} \
# /tmp/akmods-rpms/kmods/kmod-nvidia*.fc${RELEASE}.rpm && \
# sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/negativo17-fedora-nvidia.repo && \
# sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/nvidia-container-toolkit.repo && \
# sed -i "s/^MODULE_VARIANT=.*/MODULE_VARIANT=$KERNEL_MODULE_TYPE/" /etc/nvidia/kernel.conf && \
# systemctl enable ublue-nvctk-cdi.service && \
# semodule --verbose --install /usr/share/selinux/packages/nvidia-container.pp && \
# # Universal Blue specific Initramfs fixes
# cp /etc/modprobe.d/nvidia-modeset.conf /usr/lib/modprobe.d/nvidia-modeset.conf && \
# sed -i 's@omit_drivers@force_drivers@g' /usr/lib/dracut/dracut.conf.d/99-nvidia.conf && \
# sed -i 's@ nvidia @ i915 amdgpu nvidia @g' /usr/lib/dracut/dracut.conf.d/99-nvidia.conf && \
# rm -f /usr/share/vulkan/icd.d/nouveau_icd.*.json && \
# rm -f /usr/share/vulkan/icd.d/lvp_icd.*.json && \
# ln -s libnvidia-ml.so.1 /usr/lib64/libnvidia-ml.so && \
# dnf5 -y copr disable ublue-os/staging && \
# /ctx/cleanup
# Cleanup & Finalize
RUN --mount=type=cache,dst=/var/cache/libdnf5 \
--mount=type=cache,dst=/var/cache/rpm-ostree \
--mount=type=bind,from=ctx,source=/,target=/ctx \
--mount=type=tmpfs,dst=/tmp \
/ctx/image-info && \
/ctx/build-initramfs && \
/ctx/finalize