forked from ublue-os/bazzite
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathContainerfile
341 lines (320 loc) · 16.1 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
ARG BASE_IMAGE_NAME="${BASE_IMAGE_NAME:-kinoite}"
ARG IMAGE_FLAVOR="${IMAGE_FLAVOR:-main}"
ARG SOURCE_IMAGE="${SOURCE_IMAGE:-$BASE_IMAGE_NAME-$IMAGE_FLAVOR}"
ARG BASE_IMAGE="ghcr.io/ublue-os/${SOURCE_IMAGE}"
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION:-38}"
FROM ${BASE_IMAGE}:${FEDORA_MAJOR_VERSION} AS bazzite
ARG IMAGE_NAME="${IMAGE_NAME}"
ARG BASE_IMAGE_NAME="${BASE_IMAGE_NAME}"
ARG IMAGE_FLAVOR="${IMAGE_FLAVOR}"
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION}"
COPY system_files/desktop/shared /
COPY system_files/desktop/${BASE_IMAGE_NAME} /
# Add ublue packages, add needed negativo17 repo and then immediately disable due to incompatibility with RPMFusion
COPY --from=ghcr.io/ublue-os/akmods:${FEDORA_MAJOR_VERSION} /rpms /tmp/akmods-rpms
COPY --from=ghcr.io/ublue-os/ublue-update:latest /rpms/ublue-update.noarch.rpm /tmp/rpms/ublue-update.noarch.rpm
COPY --from=ghcr.io/ublue-os/bling:latest /rpms/ublue-os-wallpapers-*.noarch.rpm /tmp/rpms/ublue-os-wallpapers.rpm
RUN sed -i 's@enabled=0@enabled=1@g' /etc/yum.repos.d/_copr_ublue-os-akmods.repo && \
wget https://negativo17.org/repos/fedora-multimedia.repo -O /etc/yum.repos.d/negativo17-fedora-multimedia.repo && \
rpm-ostree install \
/tmp/akmods-rpms/kmods/*gcadapter_oc*.rpm \
/tmp/akmods-rpms/kmods/*openrgb*.rpm \
/tmp/akmods-rpms/kmods/*evdi*.rpm \
/tmp/rpms/ublue-update.noarch.rpm \
/tmp/rpms/ublue-os-wallpapers.rpm && \
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/negativo17-fedora-multimedia.repo
# Setup Copr repos
RUN wget https://copr.fedorainfracloud.org/coprs/kylegospo/bazzite/repo/fedora-$(rpm -E %fedora)/kylegospo-bazzite-fedora-$(rpm -E %fedora).repo -O /etc/yum.repos.d/_copr_kylegospo-bazzite.repo && \
wget https://copr.fedorainfracloud.org/coprs/kylegospo/bazzite-multilib/repo/fedora-$(rpm -E %fedora)/kylegospo-bazzite-multilib-fedora-$(rpm -E %fedora).repo?arch=x86_64 -O /etc/yum.repos.d/_copr_kylegospo-bazzite-multilib.repo && \
wget https://copr.fedorainfracloud.org/coprs/ublue-os/distrobox-git/repo/fedora-$(rpm -E %fedora)/ublue-os-distrobox-git-fedora-$(rpm -E %fedora).repo -O /etc/yum.repos.d/_copr_ublue-os-distrobox-git.repo && \
wget https://copr.fedorainfracloud.org/coprs/kylegospo/system76-scheduler/repo/fedora-$(rpm -E %fedora)/kylegospo-system76-scheduler-fedora-$(rpm -E %fedora).repo -O /etc/yum.repos.d/_copr_kylegospo-system76-scheduler.repo && \
wget https://copr.fedorainfracloud.org/coprs/kylegospo/hl2linux-selinux/repo/fedora-$(rpm -E %fedora)/kylegospo-hl2linux-selinux-fedora-$(rpm -E %fedora).repo -O /etc/yum.repos.d/_copr_kylegospo-hl2linux-selinux.repo && \
wget https://copr.fedorainfracloud.org/coprs/kylegospo/obs-vkcapture/repo/fedora-$(rpm -E %fedora)/kylegospo-obs-vkcapture-fedora-$(rpm -E %fedora).repo?arch=x86_64 -O /etc/yum.repos.d/_copr_kylegospo-obs-vkcapture.repo && \
wget https://copr.fedorainfracloud.org/coprs/kylegospo/wallpaper-engine-kde-plugin/repo/fedora-$(rpm -E %fedora)/kylegospo-wallpaper-engine-kde-plugin-fedora-$(rpm -E %fedora).repo -O /etc/yum.repos.d/_copr_kylegospo-wallpaper-engine-kde-plugin.repo && \
wget https://copr.fedorainfracloud.org/coprs/kylegospo/gnome-vrr/repo/fedora-$(rpm -E %fedora)/kylegospo-gnome-vrr-fedora-$(rpm -E %fedora).repo -O /etc/yum.repos.d/_copr_kylegospo-gnome-vrr.repo && \
wget https://copr.fedorainfracloud.org/coprs/ycollet/audinux/repo/fedora-$(rpm -E %fedora)/ycollet-audinux-fedora-$(rpm -E %fedora).repo -O /etc/yum.repos.d/_copr_ycollet-audinux.repo && \
wget https://copr.fedorainfracloud.org/coprs/lyessaadi/gradience/repo/fedora-$(rpm -E %fedora)/lyessaadi-gradience-fedora-$(rpm -E %fedora).repo -O /etc/yum.repos.d/_copr_lyessaadi-gradience.repo
# Remove unneeded packages
RUN rpm-ostree override remove \
ublue-os-update-services \
firefox \
firefox-langpacks \
toolbox \
htop \
distrobox \
google-noto-sans-cjk-vf-fonts
# Install new packages
RUN rpm-ostree install \
extest.i686 \
python3-pip \
libadwaita \
distrobox-git \
duperemove \
fuse-libs.i686 \
rmlint \
compsize \
ddccontrol \
ddccontrol-gtk \
input-remapper \
system76-scheduler \
hl2linux-selinux \
libobs_glcapture \
libobs_vkcapture \
obs-vkcapture \
ladspa-noise-suppression-for-voice \
btop \
neofetch \
fish \
xdotool \
yad \
google-noto-sans-cjk-fonts \
lato-fonts \
fira-code-fonts
# Configure KDE & GNOME
RUN if grep -q "kinoite" <<< "${BASE_IMAGE_NAME}"; then \
rpm-ostree override remove \
plasma-welcome \
qt5-qdbusviewer && \
rpm-ostree install \
steamdeck-kde-presets-desktop \
wallpaper-engine-kde-plugin \
sddm-sugar-steamOS \
kdeconnectd && \
rpm-ostree override replace \
--experimental \
--from repo=copr:copr.fedorainfracloud.org:kylegospo:gnome-vrr \
xorg-x11-server-Xwayland && \
git clone https://github.com/maxiberta/kwin-system76-scheduler-integration.git --depth 1 /tmp/kwin-system76-scheduler-integration && \
git clone https://github.com/catsout/wallpaper-engine-kde-plugin.git --depth 1 /tmp/wallpaper-engine-kde-plugin && \
kpackagetool5 --type=KWin/Script --global --install /tmp/kwin-system76-scheduler-integration && \
kpackagetool5 --type=Plasma/Wallpaper --global --install /tmp/wallpaper-engine-kde-plugin/plugin && \
rm -rf /tmp/kwin-system76-scheduler-integration && \
rm -rf /tmp/wallpaper-engine-kde-plugin \
; else \
rpm-ostree override replace \
--experimental \
--from repo=copr:copr.fedorainfracloud.org:kylegospo:gnome-vrr \
mutter \
gnome-control-center \
gnome-control-center-filesystem \
xorg-x11-server-Xwayland && \
rpm-ostree install \
steamdeck-backgrounds \
gradience \
adw-gtk3-theme \
gnome-tweaks \
gnome-shell-extension-user-theme \
gnome-shell-extension-gsconnect \
gnome-shell-extension-system76-scheduler \
gnome-shell-extension-caribou-blocker \
gnome-shell-extension-compiz-windows-effect \
gnome-shell-extension-just-perfection \
gnome-shell-extension-blur-my-shell \
gnome-shell-extension-caffeine \
openssh-askpass && \
rpm-ostree override remove \
gnome-classic-session \
gnome-tour \
yelp \
; fi
# Install ROCM and Waydroid on non-Nvidia images
RUN if grep -qv "nvidia" <<< "${IMAGE_NAME}"; then \
rpm-ostree install \
rocm-hip \
rocm-opencl \
waydroid \
lzip \
weston \
; fi
# Cleanup & Finalize
RUN rm /usr/share/applications/shredder.desktop && \
rm /usr/share/vulkan/icd.d/lvp_icd.*.json && \
mkdir -p "/usr/etc/profile.d/" && \
ln -s "/usr/share/ublue-os/firstboot/launcher/login-profile.sh" \
"/usr/etc/profile.d/ublue-firstboot.sh" && \
cp "/usr/share/ublue-os/firstboot/yafti.yml" "/etc/yafti.yml" && \
pip install --prefix=/usr yafti && \
sed -i 's/stage/none/g' /etc/rpm-ostreed.conf && \
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/_copr_ublue-os-akmods.repo && \
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/_copr_ublue-os-distrobox-git.repo && \
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/_copr_kylegospo-bazzite.repo && \
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/_copr_kylegospo-bazzite-multilib.repo && \
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/_copr_kylegospo-system76-scheduler.repo && \
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/_copr_kylegospo-hl2linux-selinux.repo && \
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/_copr_kylegospo-obs-vkcapture.repo && \
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/_copr_kylegospo-wallpaper-engine-kde-plugin.repo && \
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/_copr_kylegospo-gnome-vrr.repo && \
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/_copr_ycollet-audinux.repo && \
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/_copr_lyessaadi-gradience.repo && \
sed -i 's/#DefaultTimeoutStopSec.*/DefaultTimeoutStopSec=15s/' /etc/systemd/user.conf && \
sed -i 's/#DefaultTimeoutStopSec.*/DefaultTimeoutStopSec=15s/' /etc/systemd/system.conf && \
mkdir -p /etc/flatpak/remotes.d && \
wget -q https://dl.flathub.org/repo/flathub.flatpakrepo -P /etc/flatpak/remotes.d && \
systemctl enable com.system76.Scheduler.service && \
systemctl enable displaylink.service && \
systemctl enable duperemove-weekly@$(systemd-escape /var/home).timer && \
systemctl enable input-remapper.service && \
systemctl unmask flatpak-system-install.service && \
systemctl enable flatpak-system-install.service && \
systemctl disable rpm-ostreed-automatic.timer && \
systemctl --global enable ublue-update.timer && \
systemctl enable bazzite-hardware-setup.service && \
systemctl --global enable bazzite-user-setup.service && \
if grep -q "kinoite" <<< "${BASE_IMAGE_NAME}"; then \
sed -i '/^PRETTY_NAME/s/Kinoite/Bazzite/' /usr/lib/os-release && \
systemctl --global enable com.system76.Scheduler.dbusproxy.service \
; else \
rm /usr/share/applications/yad-icon-browser.desktop && \
sed -i '/^PRETTY_NAME/s/Silverblue/Bazzite GNOME/' /usr/lib/os-release \
; fi && \
if grep -q "nvidia" <<< "${IMAGE_NAME}"; then \
sed -i 's@DESKTOP_WAYLAND=true@DESKTOP_WAYLAND=false@g' /etc/default/desktop-wayland \
; else \
systemctl disable waydroid-container.service && \
rm /usr/share/wayland-sessions/weston.desktop \
; fi && \
echo -e "IMAGE_NAME=${IMAGE_NAME}\nBASE_IMAGE_NAME=${BASE_IMAGE_NAME}\nIMAGE_FLAVOR=${IMAGE_FLAVOR}\nFEDORA_MAJOR_VERSION=${FEDORA_MAJOR_VERSION}" >> /etc/default/bazzite && \
rm -rf \
/tmp/* \
/var/* && \
mkdir -p /var/tmp && \
chmod -R 1777 /var/tmp && \
mkdir -p /var/lib/duperemove && \
ostree container commit
FROM bazzite as bazzite-deck
ARG IMAGE_NAME="${IMAGE_NAME}"
ARG BASE_IMAGE_NAME="${BASE_IMAGE_NAME}"
ARG IMAGE_FLAVOR="${IMAGE_FLAVOR}"
ARG FEDORA_MAJOR_VERSION="${FEDORA_MAJOR_VERSION}"
COPY system_files/deck/shared /
COPY system_files/deck/${BASE_IMAGE_NAME} /
# Setup Copr repos
RUN wget https://copr.fedorainfracloud.org/coprs/kylegospo/LatencyFleX/repo/fedora-$(rpm -E %fedora)/kylegospo-LatencyFleX-fedora-$(rpm -E %fedora).repo -O /etc/yum.repos.d/_copr_kylegospo-latencyflex.repo && \
sed -i 's@enabled=0@enabled=1@g' /etc/yum.repos.d/_copr_ublue-os-akmods.repo && \
sed -i 's@enabled=0@enabled=1@g' /etc/yum.repos.d/_copr_kylegospo-bazzite.repo && \
sed -i 's@enabled=0@enabled=1@g' /etc/yum.repos.d/_copr_kylegospo-bazzite-multilib.repo && \
sed -i 's@enabled=0@enabled=1@g' /etc/yum.repos.d/_copr_kylegospo-hl2linux-selinux.repo && \
sed -i 's@enabled=0@enabled=1@g' /etc/yum.repos.d/_copr_kylegospo-obs-vkcapture.repo && \
sed -i 's@enabled=0@enabled=1@g' /etc/yum.repos.d/_copr_kylegospo-wallpaper-engine-kde-plugin.repo && \
sed -i 's@enabled=0@enabled=1@g' /etc/yum.repos.d/_copr_ycollet-audinux.repo
# Install Valve's Steam Deck drivers as kmods
COPY --from=ghcr.io/ublue-os/akmods:${FEDORA_MAJOR_VERSION} /rpms /tmp/akmods-rpms
RUN rpm-ostree install \
/tmp/akmods-rpms/kmods/*steamdeck*.rpm
# Remove unneeded packages
RUN rpm-ostree override remove \
ddccontrol \
ddccontrol-db \
ddccontrol-gtk && \
if grep -q "kinoite" <<< "${BASE_IMAGE_NAME}"; then \
rpm-ostree override remove \
steamdeck-kde-presets-desktop \
; fi
# Install gamescope-limiter patched Mesa and patched udisks2 (Needed for SteamOS SD card mounting)
RUN rpm-ostree override replace \
--experimental \
--from repo=copr:copr.fedorainfracloud.org:kylegospo:bazzite-multilib \
mesa-dri-drivers \
mesa-libEGL \
mesa-libgbm \
mesa-libGL \
mesa-libglapi \
mesa-vulkan-drivers && \
rpm-ostree override replace \
--experimental \
--from repo=copr:copr.fedorainfracloud.org:kylegospo:bazzite \
udisks2
# Configure KDE & GNOME
RUN if grep -q "kinoite" <<< "${BASE_IMAGE_NAME}"; then \
rpm-ostree override remove \
krfb \
krfb-libs && \
rpm-ostree install \
steamdeck-kde-presets \
; else \
rpm-ostree install \
gnome-shell-extension-bazzite-menu \
gnome-shell-extension-search-light \
sddm \
sddm-sugar-steamOS \
; fi
# Install new packages & dock updater - done manually due to proprietary parts preventing it from being on Copr
RUN rpm-ostree install \
mesa-va-drivers \
jupiter-fan-control \
jupiter-hw-support-btrfs \
vpower \
ds-inhibit \
steam_notif_daemon \
ryzenadj \
latencyflex-vulkan-layer \
vkBasalt \
mangohud \
sdgyrodsu \
python-vdf \
python-crcmod && \
git clone https://gitlab.com/evlaV/jupiter-dock-updater-bin.git --depth 1 /tmp/jupiter-dock-updater-bin && \
mv -v /tmp/jupiter-dock-updater-bin/packaged/usr/lib/jupiter-dock-updater /usr/lib/jupiter-dock-updater
# Install Steam and Lutris into their own OCI layer
RUN rpm-ostree install \
steam \
lutris \
gamescope \
gamescope-session \
wine-core \
winetricks && \
if grep -q "kinoite" <<< "${BASE_IMAGE_NAME}"; then \
rpm-ostree override remove \
gamemode \
; else \
rpm-ostree override remove \
gamemode \
gnome-shell-extension-gamemode \
; fi
# Cleanup & Finalize
RUN rm /usr/share/applications/winetricks.desktop && \
ln -s /usr/bin/steamos-logger /usr/bin/steamos-info && \
ln -s /usr/bin/steamos-logger /usr/bin/steamos-notice && \
ln -s /usr/bin/steamos-logger /usr/bin/steamos-warning && \
sed -i 's/870/913/' /usr/share/alsa/ucm2/AMD/acp5x/acp5x.conf && \
sed -i 's@/usr/bin/steam@/usr/bin/bazzite-steam@g' /usr/share/applications/steam.desktop && \
mkdir -p "/etc/xdg/autostart" && \
cp "/usr/share/applications/steam.desktop" "/etc/xdg/autostart/steam.desktop" && \
sed -i 's@/usr/bin/bazzite-steam %U@/usr/bin/bazzite-steam -silent %U@g' /etc/xdg/autostart/steam.desktop && \
cp "/usr/share/ublue-os/firstboot/yafti.yml" "/etc/yafti.yml" && \
sed -i 's/#HandlePowerKey=poweroff/HandlePowerKey=suspend/g' /etc/systemd/logind.conf && \
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/_copr_ublue-os-akmods.repo && \
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/_copr_kylegospo-bazzite.repo && \
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/_copr_kylegospo-bazzite-multilib.repo && \
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/_copr_kylegospo-latencyflex.repo && \
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/_copr_kylegospo-hl2linux-selinux.repo && \
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/_copr_kylegospo-obs-vkcapture.repo && \
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/_copr_kylegospo-wallpaper-engine-kde-plugin.repo && \
sed -i 's@enabled=1@enabled=0@g' /etc/yum.repos.d/_copr_ycollet-audinux.repo && \
mv /etc/sddm.conf /etc/sddm.conf.d/steamos.conf && \
if grep -q "kinoite" <<< "${BASE_IMAGE_NAME}"; then \
systemctl enable plasma-autologin.service \
; else \
systemctl mask power-profiles-daemon.service && \
systemctl disable gdm.service && \
systemctl enable sddm.service && \
systemctl enable gnome-autologin.service \
; fi && \
systemctl enable jupiter-fan-control.service && \
systemctl enable duperemove-weekly@$(systemd-escape /run/media/mmcblk0p1).timer && \
systemctl enable vpower.service && \
systemctl enable ds-inhibit.service && \
systemctl --global enable sdgyrodsu.service && \
systemctl disable input-remapper.service && \
systemctl --global disable ublue-update.timer && \
rm -f /usr/etc/sddm.conf && \
rm -f /etc/default/bazzite && \
echo -e "IMAGE_NAME=${IMAGE_NAME}\nBASE_IMAGE_NAME=${BASE_IMAGE_NAME}\nIMAGE_FLAVOR=${IMAGE_FLAVOR}\nFEDORA_MAJOR_VERSION=${FEDORA_MAJOR_VERSION}" >> /etc/default/bazzite && \
rm -rf \
/tmp/* \
/var/* && \
mkdir -p /var/tmp && \
chmod -R 1777 /var/tmp && \
mkdir -p /var/lib/duperemove && \
mkdir -p /var/lib/bluetooth && \
ostree container commit