Skip to content

Commit 7436876

Browse files
authored
feat(live): add a kiwi variant which includes only the minimal software to run Agama (#2256)
## Problem The PXE image is too big and it is not possible to use it on a system with 2GiB of RAM. It must include a minimal desktop and a browser, which takes quite some space. However, in many situations the system can be installed remotely or using the CLI. For those scenario, we should offer an smaller PXE image that does not include the desktop stack. ## Solution Split the main list of packages in two: * Mandatory packages (basic system, kernel, Agama, etc.). * Graphical stack (X.org, IceWM, etc.). Additionally, the MINI image does not contain: * GPU kernel drivers. * Wi-Fi and Bluetooth drivers. > [!WARNING] > This PR conflicts with the switch to Wayland (#1868), but it can be adapted later. The same approach still applies.
2 parents 1887bf4 + 6fad2bf commit 7436876

File tree

4 files changed

+98
-32
lines changed

4 files changed

+98
-32
lines changed

live/Makefile

+5
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ all: $(DESTDIR) $(COPY_FILES) $(DESTDIR)/config-cdroot.tar.xz $(DESTDIR)/root.ta
3030
clean:
3131
rm -rf $(DESTDIR)/*
3232

33+
# remove the destination directory completely (useful when changing OBS target as it also cleans
34+
# the .osc checkout directory)
35+
distclean:
36+
rm -rf $(DESTDIR)
37+
3338
$(DESTDIR):
3439
mkdir -p $@
3540

live/src/agama-installer.changes

+6
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
-------------------------------------------------------------------
2+
Thu Apr 10 05:20:55 UTC 2025 - Imobach Gonzalez Sosa <[email protected]>
3+
4+
- Add a new SUSE_SLE_16_PXE_MINI that only includes the software
5+
to use Agama remotely (jsc#PED-12152).
6+
17
-------------------------------------------------------------------
28
Tue Apr 8 15:52:18 UTC 2025 - Josef Reidinger <[email protected]>
39

live/src/agama-installer.kiwi

+37-24
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
<!-- TODO: add SPx in the future -->
1717
<profile name="SUSE_SLE_16" description="SLE-based image" import="true" />
1818
<profile name="SUSE_SLE_16_PXE" description="SLE OEM image for remote installation" import="true" />
19+
<profile name="SUSE_SLE_16_PXE_MINI" description="Minimal SLE OEM image for remote installation" import="true" />
1920
<profile name="openSUSE_PXE" description="openSUSE OEM image for remote installation" import="true" />
2021
<profile name="Leap_16.0_PXE" description="openSUSE Leap OEM image for remote installation" import="true" />
2122
</profiles>
@@ -46,7 +47,7 @@
4647
<bootloader name="custom" />
4748
</type>
4849
</preferences>
49-
<preferences arch="ppc64le" profiles="openSUSE_PXE,Leap_16.0_PXE,SUSE_SLE_16_PXE">
50+
<preferences arch="ppc64le" profiles="openSUSE_PXE,Leap_16.0_PXE,SUSE_SLE_16_PXE,SUSE_SLE_16_PXE_MINI">
5051
<!-- For some reason the compression results on ppc64le are not as good as on the other archs -->
5152
<type image="oem" filesystem="btrfs" fsmountoptions="compress=zstd:15" firmware="ofw" installpxe="true" installboot="install" kernelcmdline="rd.kiwi.ramdisk ramdisk_size=3174400">
5253
<bootloader name="grub2" console="serial" timeout="1"/>
@@ -60,7 +61,7 @@
6061
<size unit="M">3000</size>
6162
</type>
6263
</preferences>
63-
<preferences arch="s390x" profiles="openSUSE_PXE,Leap_16.0_PXE,SUSE_SLE_16_PXE">
64+
<preferences arch="s390x" profiles="openSUSE_PXE,Leap_16.0_PXE,SUSE_SLE_16_PXE,SUSE_SLE_16_PXE_MINI">
6465
<type image="oem" filesystem="btrfs" fsmountoptions="compress=zstd:15" installpxe="true" installboot="install" kernelcmdline="rd.kiwi.ramdisk ramdisk_size=2097152">
6566
<bootloader name="custom"/>
6667
<oemconfig>
@@ -73,7 +74,7 @@
7374
<size unit="M">1900</size>
7475
</type>
7576
</preferences>
76-
<preferences arch="aarch64,x86_64" profiles="openSUSE_PXE,Leap_16.0_PXE,SUSE_SLE_16_PXE">
77+
<preferences arch="aarch64,x86_64" profiles="openSUSE_PXE,Leap_16.0_PXE,SUSE_SLE_16_PXE,SUSE_SLE_16_PXE_MINI">
7778
<type image="oem" filesystem="btrfs" fsmountoptions="compress=zstd:15" firmware="uefi" installiso="true" installpxe="true" installboot="install" kernelcmdline="rd.kiwi.ramdisk ramdisk_size=2097152">
7879
<bootloader name="grub2" timeout="1"/>
7980
<oemconfig>
@@ -93,11 +94,14 @@
9394
<repository type="rpm-md">
9495
<source path="obsrepositories:/"/>
9596
</repository>
96-
<packages type="image" profiles="openSUSE_PXE,Leap_16.0_PXE,SUSE_SLE_16_PXE">
97+
<packages type="image" profiles="openSUSE_PXE,Leap_16.0_PXE,SUSE_SLE_16_PXE,SUSE_SLE_16_PXE_MINI">
98+
<package name="NetworkManager-config-server"/>
9799
<package name="dracut-kiwi-oem-repart"/>
98100
<package name="dracut-kiwi-oem-dump"/>
99101
<archive name="root-PXE.tar.xz"/>
100102
</packages>
103+
104+
<!-- common set of packages (SSH-based and remote installation, etc.) -->
101105
<packages type="image">
102106
<package name="avahi"/>
103107
<package name="bind-utils"/>
@@ -113,10 +117,6 @@
113117
<package name="grub2-s390x-emu" arch="s390x" />
114118
<package name="grub2-powerpc-ieee1275" arch="ppc64le"/>
115119
<package name="syslinux" arch="x86_64"/>
116-
<package name="fontconfig"/>
117-
<package name="fonts-config"/>
118-
<package name="adobe-sourcecodepro-fonts"/>
119-
<package name="adobe-sourcehansans-jp-fonts"/>
120120
<package name="openssh"/>
121121
<package name="iproute2"/>
122122
<package name="less"/>
@@ -128,7 +128,6 @@
128128
<package name="kernel-firmware"/>
129129
<package name="adaptec-firmware"/>
130130
<package name="atmel-firmware"/>
131-
<package name="bluez-firmware"/>
132131
<package name="ipw-firmware"/>
133132
<package name="mpt-firmware"/>
134133
<package name="zd1211-firmware"/>
@@ -138,30 +137,19 @@
138137
<package name="dracut-kiwi-live"/>
139138
<package name="blog" arch="s390x" />
140139
<package name="libblogger2" arch="s390x" />
141-
<package name="xauth"/>
142-
<package name="MozillaFirefox"/>
143-
<package name="libpwquality-tools"/>
144140
<package name="NetworkManager"/>
145141
<package name="agama"/>
146142
<package name="agama-yast"/>
147143
<package name="agama-web-ui"/>
148144
<package name="agama-cli"/>
149145
<package name="agama-cli-bash-completion"/>
150146
<package name="agama-auto"/>
151-
<package name="agama-integration-tests"/>
152147
<package name="rubygem(agama-yast)"/>
153148
<package name="rubygem(byebug)"/>
154149
<package name="microos-tools"/>
155-
<package name="icewm-lite"/>
156-
<package name="xinit"/>
157-
<package name="xset"/>
158-
<package name="xorg-x11-server"/>
159-
<package name="xorg-x11-fonts-core"/>
160-
<package name="xf86-input-libinput" />
161150
<package name="psmisc"/>
162151
<package name="joe"/>
163152
<package name="checkmedia"/>
164-
<package name="spice-vdagent"/>
165153
<package name="libtss2-tcti-device0"/>
166154
<package name="jq"/>
167155
<package name="yast2-schema"/>
@@ -170,6 +158,26 @@
170158
<package name="aaa_base-extras"/>
171159
<archive name="root.tar.xz"/>
172160
</packages>
161+
162+
<!-- packages for local installation (desktop, browser, etc.) -->
163+
<packages type="image" profiles="Leap_16.0,Leap_16.0_PXE,openSUSE,openSUSE_PXE,SUSE_SLE_16,SUSE_SLE_16_PXE">
164+
<package name="bluez-firmware"/>
165+
<package name="agama-integration-tests"/>
166+
<package name="fontconfig"/>
167+
<package name="fonts-config"/>
168+
<package name="adobe-sourcecodepro-fonts"/>
169+
<package name="adobe-sourcehansans-jp-fonts"/>
170+
<package name="xauth"/>
171+
<package name="MozillaFirefox"/>
172+
<package name="icewm-lite"/>
173+
<package name="xinit"/>
174+
<package name="xset"/>
175+
<package name="xorg-x11-server"/>
176+
<package name="xorg-x11-fonts-core"/>
177+
<package name="xf86-input-libinput" />
178+
<package name="spice-vdagent"/>
179+
</packages>
180+
173181
<!-- additional packages for the Leap distributions -->
174182
<packages type="image" profiles="Leap_16.0,Leap_16.0_PXE">
175183
<package name="agama-products-opensuse"/>
@@ -178,9 +186,11 @@
178186
<package name="patterns-openSUSE-base"/>
179187
<package name="staging-build-key"/>
180188
<package name="openSUSE-build-key"/>
181-
<package name="MozillaFirefox-branding-openSUSE"/>
182189
<package name="kernel-default-extra"/>
183190
</packages>
191+
<packages type="image" profiles="Leap_16.0">
192+
<package name="MozillaFirefox-branding-openSUSE"/>
193+
</packages>
184194
<!-- additional packages for the openSUSE distributions -->
185195
<packages type="image" profiles="openSUSE,openSUSE_PXE">
186196
<package name="agama-products-opensuse"/>
@@ -189,22 +199,25 @@
189199
<package name="patterns-openSUSE-base"/>
190200
<package name="staging-build-key"/>
191201
<package name="openSUSE-build-key"/>
202+
</packages>
203+
<packages type="image" profiles="openSUSE">
192204
<package name="MozillaFirefox-branding-openSUSE"/>
193205
</packages>
194206
<!-- additional packages for the SLE distributions -->
195-
<packages type="image" profiles="SUSE_SLE_16,SUSE_SLE_16_PXE">
207+
<packages type="image" profiles="SUSE_SLE_16,SUSE_SLE_16_PXE,SUSE_SLE_16_PXE_MINI">
196208
<package name="agama-products-sle"/>
197209
<package name="grub2-branding-SLE" arch="aarch64,x86_64"/>
198210
<package name="patterns-base-base"/>
199211
<package name="suse-build-key"/>
212+
</packages>
213+
<packages type="image" profiles="SUSE_SLE_16,SUSE_SLE_16_PXE">
200214
<package name="MozillaFirefox-branding-SLE"/>
201215
<package name="kernel-default-extra"/>
202216
</packages>
203217
<packages type="bootstrap">
204218
<package name="udev"/>
205219
<package name="filesystem"/>
206220
<package name="glibc-locale"/>
207-
<package name="cracklib-dict-full"/>
208221
<package name="ca-certificates"/>
209222
<package name="ca-certificates-mozilla"/>
210223
</packages>
@@ -215,7 +228,7 @@
215228
<package name="openSUSE-release"/>
216229
<package name="openSUSE-release-ftp"/>
217230
</packages>
218-
<packages type="bootstrap" profiles="SUSE_SLE_16,SUSE_SLE_16_PXE">
231+
<packages type="bootstrap" profiles="SUSE_SLE_16,SUSE_SLE_16_PXE,SUSE_SLE_16_PXE_MINI">
219232
<package name="SLES-release"/>
220233
</packages>
221234
</image>

live/src/config.sh

+50-8
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#! /bin/bash
1+
#!/bin/bash
22

33
set -ex
44

@@ -61,11 +61,16 @@ systemctl enable checkmedia.service
6161
systemctl enable qemu-guest-agent.service
6262
systemctl enable setup-systemd-proxy-env.path
6363
systemctl enable x11-autologin.service
64-
systemctl enable spice-vdagentd.service
64+
test -f /usr/lib/systemd/system/spice-vdagentd.service && systemctl enable spice-vdagentd.service
6565
systemctl enable zramswap
6666

67-
# default target
68-
systemctl set-default graphical.target
67+
# set the default target
68+
if [[ "$kiwi_profiles" == *MINI* ]]; then
69+
# the MINI images do not include graphical environment
70+
systemctl set-default multi-user.target
71+
else
72+
systemctl set-default graphical.target
73+
fi
6974

7075
# disable snapshot cleanup
7176
systemctl disable snapper-cleanup.timer
@@ -140,6 +145,33 @@ dd bs=1 count=1 seek=2G if=/dev/zero of=/var/lib/live_free_space
140145

141146
################################################################################
142147
# Reducing the used space
148+
#
149+
# Profile specific cleanup
150+
#
151+
152+
# Extra cleanup for the MINI images
153+
if [[ "$kiwi_profiles" == *MINI* ]]; then
154+
# remove the GPU drivers, not needed when running in text mode only,
155+
# the related firmware is deleted by the script below
156+
rm -rf /usr/lib/modules/*/kernel/drivers/gpu
157+
158+
# remove WiFi drivers
159+
rm -rf /usr/lib/modules/*/kernel/drivers/net/wireless
160+
# remove Bluetooth drivers
161+
rm -rf /usr/lib/modules/*/kernel/drivers/bluetooth
162+
rm -rf /usr/lib/modules/*/kernel/net/bluetooth
163+
fi
164+
165+
# Remove the SUSEConnect CLI tool from the openSUSE images and the mini PXE image,
166+
# keep it in the SLE images, it might be useful for testing/debugging
167+
# (Agama uses libsuseconnect.so directly via the Ruby bindings and does not need the CLI,
168+
# registration in theory would be still possible even in the openSUSE images)
169+
if [[ "$kiwi_profiles" == *MINI* ]] || [[ "$kiwi_profiles" == *Leap* ]] || [[ "$kiwi_profiles" == *openSUSE* ]]; then
170+
rm -f /usr/bin/suseconnect
171+
fi
172+
173+
################################################################################
174+
# Generic cleanup in all images
143175

144176
# Clean-up logs
145177
rm /var/log/zypper.log /var/log/zypp/history
@@ -207,7 +239,14 @@ if [ -n "$python" ]; then
207239
fi
208240

209241
# remove OpenGL support
210-
rpm -qa | grep ^Mesa | xargs rpm -e --nodeps
242+
rpm -qa | grep ^Mesa | xargs --no-run-if-empty rpm -e --nodeps
243+
244+
# remove unused SUSEConnect libzypp plugins
245+
rm -f /usr/lib/zypper/commands/zypper-migration
246+
rm -f /usr/lib/zypper/commands/zypper-search-packages
247+
248+
# delete some FireFox audio codec support
249+
rm -f /usr/lib64/firefox/libmozavcodec.so
211250

212251
# uninstall libyui-qt and libqt (pulled in by the YaST dependencies),
213252
# not present in SLES, do not fail if not installed
@@ -280,9 +319,12 @@ rpm -e --nodeps Mesa-gallium || true
280319
rm -rf /usr/lib*/libmfxhw*.so.* /usr/lib*/mfx/
281320

282321
# the new, optional nvidia gsp firmware blobs are huge - ~ 70MB
283-
du -h -s /lib/firmware/nvidia
284-
find /lib/firmware/nvidia -name gsp | xargs -r rm -rf
285-
du -h -s /lib/firmware/nvidia
322+
if [ -e /lib/firmware/nvidia ]; then
323+
du -h -s /lib/firmware/nvidia
324+
find /lib/firmware/nvidia -name gsp | xargs -r rm -rf
325+
du -h -s /lib/firmware/nvidia
326+
fi
327+
286328
# The gems are unpackaged already, no need to store them twice
287329
du -h -s /usr/lib*/ruby/gems/*/cache/
288330
rm -rf /usr/lib*/ruby/gems/*/cache/

0 commit comments

Comments
 (0)