diff --git a/agama-live/README.md b/agama-live/README.md new file mode 100644 index 0000000..4922bbc --- /dev/null +++ b/agama-live/README.md @@ -0,0 +1,35 @@ +# Live ISO + +This directory contains a set of files that are used to build the Agama Live ISO +image. + +## Sources + +The sources are maintained in the [Agama Git +repository](https://github.com/openSUSE/agama/tree/master/live) repository. + +## Building the ISO + +To build the ISO locally run the + +```shell +osc build -M images +``` + +command. See the [_multibuild](_multibuild) file for the list of configured +build flavors. To build for example the openSUSE flavor run this command: + +```shell +osc build -M openSUSE images +``` + +Note: For building an ISO image you need a lot of free space at the `/var` +partition. Make sure there is at least 25GiB free space otherwise the build +might fail. + +## Changes + +Please *do not* change any file in the OBS repository. The files are +automatically uploaded from the [Agama Git +repository](https://github.com/openSUSE/agama/tree/master/live), your manual +changes will be lost at the next update. diff --git a/agama-live/_constraints b/agama-live/_constraints new file mode 100644 index 0000000..7e25096 --- /dev/null +++ b/agama-live/_constraints @@ -0,0 +1,7 @@ + + + + 25 + + + diff --git a/agama-live/_multibuild b/agama-live/_multibuild new file mode 100644 index 0000000..ca62bbc --- /dev/null +++ b/agama-live/_multibuild @@ -0,0 +1,4 @@ + + openSUSE + + diff --git a/agama-live/agama-live.changes b/agama-live/agama-live.changes new file mode 100644 index 0000000..d971b05 --- /dev/null +++ b/agama-live/agama-live.changes @@ -0,0 +1,183 @@ +------------------------------------------------------------------- +Fri Jun 14 10:36:52 UTC 2024 - Ladislav Slezák + +- Experimental Agama self-update (gh#openSUSE/agama#1341) + +------------------------------------------------------------------- +Thu Jun 13 16:07:08 UTC 2024 - Ladislav Slezák + +- Added Tumbleweed OSS and Agama Staging repositories to the Live + system itself (gh#openSUSE/agama#1332) + +------------------------------------------------------------------- +Tue Jun 11 21:39:51 UTC 2024 - Imobach Gonzalez Sosa + +- Add the jq package to the image (gh#openSUSE/agama#1314). + +------------------------------------------------------------------- +Thu Jun 6 14:30:19 UTC 2024 - Ladislav Slezák + +- Automatically generate the root password (gh#openSUSE/agama#1292) +- Allow setting the default root password in ISO metadata + (gh#openSUSE/agama#1290) +- Alloe setting teh root password from boot command line or set + it interactively during boot (gh#openSUSE/agama#1288) + +------------------------------------------------------------------- +Wed Jun 5 15:40:43 UTC 2024 - Knut Anderssen + +- Fix the cd.ikr content for booting the s390x iso + (gh#openSUSE/agama#1289). + +------------------------------------------------------------------- +Tue May 21 10:38:39 UTC 2024 - Imobach Gonzalez Sosa + +- Add the procps4 package to the image (gh#openSUSE/agama#1245). + +------------------------------------------------------------------- +Fri May 17 09:52:27 UTC 2024 - Imobach Gonzalez Sosa + +- Version 8 + +------------------------------------------------------------------- +Fri Feb 9 16:16:29 UTC 2024 - Ladislav Slezák + +- Image size reduced: + - Removed translations and locale definitions for unsupported + languages, removed translations for unused tools + - Removed sound card and TV card drivers (not needed for the installer) + - Removed alsa packages + - Removed unused firmware files +- Require 25GB disk space for build (PXE build might fail with + just 20GB) + +------------------------------------------------------------------- +Thu Feb 1 08:27:29 UTC 2024 - Josef Reidinger + +- Improve multipath experience: preload kernel module and set probing + to smart option (bsc#1215598) + +------------------------------------------------------------------- +Thu Dec 21 15:43:06 UTC 2023 - Imobach Gonzalez Sosa + +- Version 7 + +------------------------------------------------------------------- +Mon Dec 4 16:03:08 UTC 2023 - José Iván López González + +- Remove dependencies included by Agama packages (related to + gh#openSUSE/agama#911). + +------------------------------------------------------------------- +Fri Dec 1 14:23:09 UTC 2023 - Imobach Gonzalez Sosa + +- Version 6 + +------------------------------------------------------------------- +Mon Nov 13 18:02:39 UTC 2023 - Josef Reidinger + +- Use by default zram to allow having 2GiB memory requirements + (jsc#PED-7303) + +------------------------------------------------------------------- +Mon Nov 6 08:30:01 UTC 2023 - Marcus Schäfer + +- Fix s390 PXE build by using 'custom' bootloader for s390 target + There is an error inside grub2-zipl-setup which calls zipl that + then complains with "Unable to create temporary device node: No such device or address". + We don't see this issue with zipl in the kiwi integration test from here: + https://build.opensuse.org/project/show/Virtualization:Appliances:Images:Testing_s390:tumbleweed + Thus I don't think it's an issue with kiwi but most probably a conflict + between the zipl setup and the raw btrfs filesystem usage in this case. + Long story short, the zipl issue needs extra inspection and the fix + here is simple because we actually don't need a bootloader to be installed + into the disk image because it is expected to be deployed via a remote + boot infrastructure. Therefore this change disables the bootloader + install for s390 by setting the attribute: bootloader="custom" + +------------------------------------------------------------------- +Tue Oct 24 08:04:07 UTC 2023 - Marcus Schäfer + +- Add new profile ALP-PXE which builds a variant of the agama + installer that is an oem disk image which can be remote deployed + into a ramdisk to boot into the agama installation. The size constraints + are similar to the live-iso size. For more details please refer + to README.pxe + +---------------------------------------------------------------------------- +Mon Oct 23 12:03:55 UTC 2023 - Imobach González Sosa + +- Add adobe-sourcehansans-jp-fonts +- Version 5 + +---------------------------------------------------------------------------- +Thu Oct 19 20:19:11 UTC 2023 - Imobach González Sosa + +- Add libstorage-ng translations + +---------------------------------------------------------------------------- +Wed Sep 27 08:45:26 UTC 2023 - Imobach González Sosa + +- Version 4 + +---------------------------------------------------------------------------- +Tue Sep 26 07:55:34 UTC 2023 - Imobach González Sosa + +- Clean-up zypper logs + +---------------------------------------------------------------------------- +Tue Sep 26 05:28:35 UTC 2023 - Imobach González Sosa + +- Added nvme-cli requested by https://bugzilla.suse.com/show_bug.cgi?id=1215572 + +---------------------------------------------------------------------------- +Wed Aug 30 09:44:04 UTC 2023 - Imobach González Sosa + +- Add microos-tools package and enable proxy setup services. + +---------------------------------------------------------------------------- +Tue Aug 29 09:19:26 UTC 2023 - Imobach González Sosa + +- Enable ppc64le images + +---------------------------------------------------------------------------- +Thu Aug 03 10:23:49 UTC 2023 - Imobach González Sosa + +- Disable building the ALP image for ppc64le + +---------------------------------------------------------------------------- +Wed Aug 02 10:37:21 UTC 2023 - Imobach González Sosa + +- Version 3 + +---------------------------------------------------------------------------- +Tue Aug 01 09:56:42 UTC 2023 - Imobach González Sosa + +- Replace "default" flavor with a new "openSUSE" flavor that only includes + openSUSE-based products. +- Replace ALP-build-key with suse-build-key. + +---------------------------------------------------------------------------- +Mon Jul 31 11:34:26 UTC 2023 - Imobach González Sosa + +- Replace ALP-build-key with suse-build-key + +---------------------------------------------------------------------------- +Tue Jul 25 14:43:39 UTC 2023 - José Iván López González + +- Update filtering + +---------------------------------------------------------------------------- +Wed Jul 05 08:27:33 UTC 2023 - Imobach González Sosa + +- Bump version to match Agama + +---------------------------------------------------------------------------- +Thu Jun 08 14:12:15 UTC 2023 - Josef Reidinger + +- add to live image also dbus services written in rust + +---------------------------------------------------------------------------- +Thu Jun 01 14:05:13 UTC 2023 - Ladislav Slezák + +- osc copypac from project:YaST:Head:Agama package:agama-live revision:13 diff --git a/agama-live/agama-live.kiwi b/agama-live/agama-live.kiwi new file mode 100644 index 0000000..217ff50 --- /dev/null +++ b/agama-live/agama-live.kiwi @@ -0,0 +1,138 @@ + + + + + + + YaST Team + yast2-maintainers@suse.de + Agama Live ISO + + + + + + + 8.0.0 + zypper + en_US + us + Europe/Berlin + true + false + bgrt + openSUSE + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/agama-live/config-cdroot.tar.xz b/agama-live/config-cdroot.tar.xz new file mode 100644 index 0000000..93f851a Binary files /dev/null and b/agama-live/config-cdroot.tar.xz differ diff --git a/agama-live/config.sh b/agama-live/config.sh new file mode 100644 index 0000000..d83b48b --- /dev/null +++ b/agama-live/config.sh @@ -0,0 +1,172 @@ +#! /bin/bash + +set -ex + +# KIWI functions +test -f /.kconfig && . /.kconfig +test -f /.profile && . /.profile + +# greeting +echo "Configure image: [$kiwi_iname]..." + +# setup baseproduct link +suseSetupProduct + +# configure the repositories in the Live system +# import the OBS key for the systemsmanagement OBS project +rpm --import /tmp/systemsmanagement_key.gpg +rm /tmp/systemsmanagement_key.gpg +# import the openSUSE keys +rpm --import /usr/lib/rpm/gnupg/keys/*.asc + +# activate services +systemctl enable sshd.service +systemctl enable NetworkManager.service +systemctl enable avahi-daemon.service +systemctl enable agama.service +systemctl enable agama-web-server.service +systemctl enable agama-auto.service +systemctl enable agama-hostname.service +systemctl enable agama-proxy-setup.service +systemctl enable agama-certificate-issue.path +systemctl enable agama-certificate-wait.service +systemctl enable agama-welcome-issue.service +systemctl enable agama-avahi-issue.service +systemctl enable agama-ssh-issue.service +systemctl enable agama-self-update.service +systemctl enable live-password-cmdline.service +systemctl enable live-password-dialog.service +systemctl enable live-password-iso.service +systemctl enable live-password-random.service +systemctl enable live-password-systemd.service +systemctl enable setup-systemd-proxy-env.path +systemctl enable x11-autologin.service +systemctl enable spice-vdagentd.service +systemctl enable zramswap + +# default target +systemctl set-default graphical.target + +# disable snapshot cleanup +systemctl disable snapper-cleanup.timer +systemctl disable snapper-timeline.timer + +# disable unused services +systemctl disable YaST2-Firstboot.service +systemctl disable YaST2-Second-Stage.service + +### setup dracut for live system +label=${kiwi_install_volid:-$kiwi_iname} +arch=$(uname -m) + +echo "Setting default live root: live:LABEL=$label" +mkdir /etc/cmdline.d +echo "root=live:LABEL=$label" >/etc/cmdline.d/10-liveroot.conf +echo "root_disk=live:LABEL=$label" >>/etc/cmdline.d/10-liveroot.conf +# if there's a default network location, add it here +# echo "root_net=" >> /etc/cmdline.d/10-liveroot.conf +echo 'install_items+=" /etc/cmdline.d/10-liveroot.conf "' >/etc/dracut.conf.d/10-liveroot-file.conf +echo 'add_dracutmodules+=" dracut-menu "' >>/etc/dracut.conf.d/10-liveroot-file.conf + +if [ "${arch}" = "s390x" ];then + # workaround for custom bootloader setting + touch /config.bootoptions +fi + +# replace the @@LIVE_MEDIUM_LABEL@@ with the real Live partition label name from KIWI +sed -i -e "s/@@LIVE_MEDIUM_LABEL@@/$label/g" /usr/bin/live-password + +################################################################################ +# Reducing the used space + +# Clean-up logs +rm /var/log/zypper.log /var/log/zypp/history + +du -h -s /usr/{share,lib}/locale/ + +# Agama expects that the same locales available in the installation system can +# be also used later in the installed system and offers them in the web UI to +# select. But to make the Live ISO smaller it makes sense to delete the locales +# not supported by Agama itself. To solve this problem the list of available +# locales is saved to a file before deleting the locales not supported by Agama. +# Agama then reads this file instead of running the "localectl list-locales" +# command. +mkdir -p /etc/agama.d +# emulate "localectl list-locales" call, it cannot be used here because it +# insists on running systemd as PID 1 :-/ +ls -1 -d /usr/lib/locale/*.utf8 | sed -e "s#/usr/lib/locale/##" -e "s#utf8#UTF-8#" > /etc/agama.d/locales + +# delete translations and unusupported languages (makes ISO about 22MiB smaller) +# build list of ignore options for "ls" with supported languages like "-I cs* -I de* -I es* ..." +readarray -t IGNORE_OPTS < <(ls /usr/share/agama/web_ui/po.*.js.gz | sed -e "s#/usr/share/agama/web_ui/po\.\(.*\)\.js\.gz#-I\n\\1*#") +# additionally keep the en_US translations +ls -1 "${IGNORE_OPTS[@]}" -I en_US /usr/share/locale/ | xargs -I% sh -c "echo 'Removing translations %...' && rm -rf /usr/share/locale/%" + +# delete locale definitions for unsupported languages (explicitly keep the C and en_US locales) +ls -1 "${IGNORE_OPTS[@]}" -I "en_US*" -I "C.*" /usr/lib/locale/ | xargs -I% sh -c "echo 'Removing locale %...' && rm -rf /usr/lib/locale/%" + +# delete unused translations (MO files) +for t in zypper gettext-runtime p11-kit; do + rm /usr/share/locale/*/LC_MESSAGES/$t.mo +done +du -h -s /usr/{share,lib}/locale/ + +# remove documentation +du -h -s /usr/share/doc/packages/ +rm -rf /usr/share/doc/packages/* +# remove man pages +du -h -s /usr/share/man +rm -rf /usr/share/man/* + +## removing drivers and firmware makes the Live ISO about 370MiB smaller +# +# Agama does not use sound, added by icewm dependencies +rpm -e --nodeps alsa alsa-utils alsa-ucm-conf || true + +# driver and firmware cleanup +# Note: openSUSE Tumbleweed Live completely removes firmware for some server +# network cars, because you very likely won't run TW KDE Live on a server. +# But for Agama installer it makes more sense to run on server. So we keep it +# and remove the drivers for sound cards and TV cards instead. Those do not +# make sense on a server. +du -h -s /lib/modules /lib/firmware +# delete sound drivers +rm -rfv /lib/modules/*/kernel/sound +# delete TV cards and radio cards +rm -rfv /lib/modules/*/kernel/drivers/media/ + +# remove the unused firmware (not referenced by kernel drivers) +/tmp/fw_cleanup.rb --delete +# remove the script, not needed anymore +rm /tmp/fw_cleanup.rb +du -h -s /lib/modules /lib/firmware + +################################################################################ +# The rest of the file was copied from the openSUSE Tumbleweed Live ISO +# https://build.opensuse.org/package/view_file/openSUSE:Factory:Live/livecd-tumbleweed-kde/config.sh?expand=1 +# + +# disable the services included by dependencies +for s in purge-kernels; do + systemctl -f disable $s || true +done + +# Only used for OpenCL and X11 acceleration on vmwgfx (?), saves ~50MiB +rpm -e --nodeps Mesa-gallium || true +# Too big and will have to be dropped anyway (unmaintained, known security issues) +rm -rf /usr/lib*/libmfxhw*.so.* /usr/lib*/mfx/ + +# the new, optional nvidia gsp firmware blobs are huge - ~ 70MB +du -h -s /lib/firmware/nvidia +find /lib/firmware/nvidia -name gsp | xargs -r rm -rf +du -h -s /lib/firmware/nvidia +# The gems are unpackaged already, no need to store them twice +du -h -s /usr/lib*/ruby/gems/*/cache/ +rm -rf /usr/lib*/ruby/gems/*/cache/ + +# Not needed, boo#1166406 +rm -f /boot/vmlinux*.[gx]z +rm -f /lib/modules/*/vmlinux*.[gx]z + +# Remove generated files (boo#1098535) +rm -rf /var/cache/zypp/* /var/lib/zypp/AnonymousUniqueId /var/lib/systemd/random-seed diff --git a/agama-live/fix_bootconfig b/agama-live/fix_bootconfig new file mode 100644 index 0000000..1482824 --- /dev/null +++ b/agama-live/fix_bootconfig @@ -0,0 +1,89 @@ +#! /bin/bash + +# This script uses the KIWI 'editbootconfig' hook to modify the Live layout +# and ISO generation. +# +# Note that the 'editbootconfig' hook runs before the initrd is generated - +# this is too early for our purposes. So we have to do some gray area +# trickery: +# +# 1. Inject our modification scripts via config-cdroot.tar.xz into the Live tree. +# 2. Inject a 'xorriso' wrapper script into /usr/local/bin to hook into the ISO +# creation directly. +# This script (a) adjusts the boot config, (b) runs xorriso, and (c) makes +# it zIPL bootable on s390x. +# + +# KIWI config +test -f .profile && . .profile + +dst=${1#iso:} + +arch=`uname -m` + +# removing live root setting from command line - it's in /etc/cmdline.d instead +if [ -f $dst/boot/grub2/grub.cfg ] ; then + sed -i -E -e 's/\s+root=\S+//' -e 's/\s+rd.live\.image//' $dst/boot/grub2/grub.cfg +fi + +bootfix=$dst/fix_bootconfig.$arch +if [ -f $bootfix ] ; then + echo "bootconfig script found: \"$bootfix\"" +fi + +if [ $arch = ppc64le ] ; then + mkdir -p $dst/boot/grub2 + cp -r usr/share/grub2/powerpc-ieee1275 $dst/boot/grub2 + mv $dst/boot/grub2/powerpc-ieee1275/grub.elf $dst/boot/grub2 +fi + +cat </usr/local/bin/xorriso +#! /bin/bash + +set -x + +# get ISO file name and ISO volume id from xorriso parameters +for i in "\$@" ; do + if [ -n "\$iso_opt" ] ; then + iso_opt= + export iso="\$i" + continue + fi + if [ -n "\$volid_opt" ] ; then + volid_opt= + export volid="\$i" + continue + fi + if [ "\$i" = "-outdev" ] ; then + iso_opt=1 + continue + fi + if [ "\$i" = "-volid" ] ; then + volid_opt=1 + continue + fi +done + +volid=${kiwi_install_volid:-$kiwi_iname} + +[ -x $bootfix ] && $bootfix $dst +rm -f $dst/fix_bootconfig.* + +case $arch in + s390x) + /usr/bin/xorriso "\$@" -volid "\$volid" -boot_image any bin_path=boot/s390x/cd.ikr -boot_image any boot_info_table=off -boot_image any load_size=512 + err=\$? + [ -x /usr/bin/isozipl ] && isozipl "\$iso" + ;; + ppc64le) + /usr/bin/xorriso "\$@" -volid "\$volid" -boot_image any chrp_boot_part=on + err=\$? + ;; + *) + /usr/bin/xorriso "\$@" -volid "\$volid" +esac + +exit \$err +XXX + +chmod +x /usr/local/bin/xorriso diff --git a/agama-live/images.sh b/agama-live/images.sh new file mode 100644 index 0000000..e5c5c7c --- /dev/null +++ b/agama-live/images.sh @@ -0,0 +1,19 @@ +#! /bin/bash + +echo 'add memory size check for livenetroot installation' + +[[ -f /usr/lib/dracut/modules.d/90livenet/livenetroot.sh ]] || exit 1 + +echo 'let memsize=$(($(sed -n "s/MemTotal: *\([[:digit:]]*\).*/\1/p" /proc/meminfo) / 1024))' > /tmp/livenetroot-mod +echo 'let imgsize=$(($(curl -sI "$liveurl" | sed -n "s/Content-Length: *\([[:digit:]]*\).*/\1/p") / (1024 * 1024)))' >> /tmp/livenetroot-mod +echo '' >> /tmp/livenetroot-mod +echo 'if [ $((memsize - imgsize)) -lt 1024 ]; then' >> /tmp/livenetroot-mod +echo " sed -i 'N;/echo \"\$RDSOSREPORT\"/s/echo$/echo\\" >> /tmp/livenetroot-mod +echo ' echo Warning!!!\' >> /tmp/livenetroot-mod +echo ' echo The memory size of your system is too small for this live image.\' >> /tmp/livenetroot-mod +echo ' echo Expect killed processes due to out of memory conditions.\' >> /tmp/livenetroot-mod +echo " echo /' usr/bin/dracut-emergency" >> /tmp/livenetroot-mod +echo ' emergency_shell' >> /tmp/livenetroot-mod +echo 'fi' >> /tmp/livenetroot-mod + +sed -i '/info "fetching $liveurl"$/ r /tmp/livenetroot-mod' /usr/lib/dracut/modules.d/90livenet/livenetroot.sh diff --git a/agama-live/root.tar.xz b/agama-live/root.tar.xz new file mode 100644 index 0000000..d8da63f Binary files /dev/null and b/agama-live/root.tar.xz differ