From abcd2c847f41c026ef3e146d58a793958d06c50c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ladislav=20Slez=C3=A1k?= Date: Tue, 21 Jan 2025 10:45:47 +0100 Subject: [PATCH] Improve Makefile for building the Live ISO - Allow building the SLE image (using internal OBS) - Allow passing extra parameters to OSC build (like preferred RPMs) - Updated documentation --- live/Makefile | 7 ++-- live/README.md | 92 ++++++++++++++++++++++++++++++-------------------- 2 files changed, 60 insertions(+), 39 deletions(-) diff --git a/live/Makefile b/live/Makefile index cb1535e0d9..af167f01b7 100644 --- a/live/Makefile +++ b/live/Makefile @@ -15,6 +15,8 @@ FLAVOR = openSUSE # to use a different project run "make build OBS_PROJECT=" OBS_PROJECT = "systemsmanagement:Agama:Devel" OBS_PACKAGE = "agama-installer" +# to use internal OBS add "OBS_API=https://api.suse.de" +OBS_API = "https://api.opensuse.org" # files to copy from src/ COPY_FILES = $(patsubst $(SRCDIR)/%,$(DESTDIR)/%,$(wildcard $(SRCDIR)/*)) @@ -53,8 +55,9 @@ $(DESTDIR)/%.tar.xz: % $$(shell find % -type f,l) # build the ISO locally build: $(DESTDIR) - if [ ! -e $(DESTDIR)/.osc ]; then make clean; osc co -o $(DESTDIR) $(OBS_PROJECT) $(OBS_PACKAGE); fi + if [ ! -e $(DESTDIR)/.osc ]; then make clean; osc -A $(OBS_API) co -o $(DESTDIR) $(OBS_PROJECT) $(OBS_PACKAGE); fi $(MAKE) all - (cd $(DESTDIR) && osc build -M $(FLAVOR) images) + # allow passing optional parameters to osc like "-p " or "-k " + (cd $(DESTDIR) && osc -A $(OBS_API) build -M $(FLAVOR) $(OSC_OPTS) images) .PHONY: build all clean diff --git a/live/README.md b/live/README.md index a37116fa73..7d752c51b0 100644 --- a/live/README.md +++ b/live/README.md @@ -5,24 +5,27 @@ ## Table of Content - [Live ISO](#live-iso) + - [Table of Content](#table-of-content) - [Layout](#layout) - - [Building the Sources](#building-the-sources) - - [Building the ISO Image](#building-the-iso-image) - - [Build Options](#build-options) - - [Image Definition](#image-definition) - - [KIWI Files](#kiwi-files) - - [Image Configuration](#image-configuration) - - [GRUB2 menu](#grub2-menu) - - [SSH Server](#ssh-server) + - [Building the sources](#building-the-sources) + - [Building the ISO image](#building-the-iso-image) + - [Build options](#build-options) + - [Using another project](#using-another-project) + - [Using internal build service](#using-internal-build-service) + - [Using locally built RPM packages](#using-locally-built-rpm-packages) + - [Image definition](#image-definition) + - [KIWI files](#kiwi-files) + - [Image configuration](#image-configuration) + - [GRUB2 menu](#grub2-menu) + - [SSH server](#ssh-server) - [Autologin](#autologin) - - [Firefox Profile](#firefox-profile) + - [Firefox profile](#firefox-profile) - [Dracut menu](#dracut-menu) - [Avahi/mDNS](#avahimdns) - [The Default Hostname](#the-default-hostname) - [Service Advertisement](#service-advertisement) - - [The Default Cockpit/Agama TCP Port](#the-default-cockpitagama-tcp-port) - - [Autoinstallation Support](#autoinstallation-support) - - [Firmware Cleanup](#firmware-cleanup) + - [Autoinstallation support](#autoinstallation-support) + - [Firmware cleanup](#firmware-cleanup) --- @@ -38,7 +41,7 @@ This directory contains a set of files that are used to build the Agama Live ISO - [config-cdroot](config-cdroot) subdirectory contains file which are copied to the uncompressed root of the ISO image, the files can be accessed just by mounting the ISO file or the DVD medium -## Building the Sources +## Building the sources To build the sources for OBS just run the @@ -56,7 +59,7 @@ make clean or just simply delete the `dist` subdirectory. -## Building the ISO Image +## Building the ISO image To build the ISO locally run the @@ -70,7 +73,7 @@ build for output for the exact ISO file name. 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 will fail. -### Build Options +### Build options By default this will build the openSUSE image. If you want to build another image then run @@ -82,6 +85,8 @@ make build FLAVOR=openSUSE-PXE See the [_multibuild](src/_multibuild) file for the list of available build flavors. +#### Using another project + By default it will use the [systemsmanagement:Agama:Devel](https://build.opensuse.org/project/show/systemsmanagement:Agama:Devel) OBS project. If you want to build using another project, like your fork, then delete the `dist` @@ -90,17 +95,42 @@ directory and checkout the OBS project manually and run the build: ```shell rm -rf dist # replace with your OBS account name -osc co -o dist home::branches:systemsmanagement:Agama:Devel agama-installer-openSUSE -make build +make build OBS_PROJECT=home::branches:systemsmanagement:Agama:Devel +``` + +#### Using internal build service + +To build a SLE image using the internal OBS instance run + +```shell +make build OBS_API=https://api.suse.de OBS_PROJECT= OBS_PACKAGE=agama-installer-SLE FLAVOR=SLE ``` -## Image Definition +#### Using locally built RPM packages + +If you have a locally built RPM which you want to include in the ISO instead of the RPM from the +build service use the `-p` osc option with directory containing the RPMS. The workflow should look +like this: + +```shell +# first create a place for storing the RPM packages, if the directory already +# exists make sure it does not contain any previous results +mkdir ~/rpms + +# build the updated RPM package locally and save the result into the created directory +osc build -k ~/rpms + +# then build the Live ISO using these packages +make build OSC_OPTS="-p ~/rpms" +``` + +## Image definition The [KIWI](https://github.com/OSInside/kiwi) image builder is used by OBS to build the Live ISO. See the [KIWI documentation](https://osinside.github.io/kiwi/index.html) for more details about the build workflow and the `.kiwi` file format. -### KIWI Files +### KIWI files The main Kiwi source files are located in the [src](src) subdirectory: @@ -118,11 +148,11 @@ The main Kiwi source files are located in the [src](src) subdirectory: - [fix_bootconfig](src/fix_bootconfig) - a special KIWI hook script which sets the boot configuration on S390 and PPC64 architectures. -## Image Configuration +## Image configuration The Live ISO is configured to allow using some features and allow running Agama there. -## GRUB2 Menu +## GRUB2 menu grub.cfg, defining boot menu items of the Agama image, is generated by scripts stored in [config-cdroot](https://github.com/openSUSE/agama/tree/master/live/config-cdroot). @@ -130,8 +160,7 @@ grub.cfg, defining boot menu items of the Agama image, is generated by scripts s Both x86_64 and aarch64 grub.cfg are basically copies of KIWI autogenerated grub.cfg. The x86_64 grub.cfg contains UEFI fix for Booting from disk (Issue #1609). - -### SSH Server +### SSH server The SSH connection for the root user is enabled in the [10_root_login.conf](root/etc/ssh/sshd_config.d/10_root_login.conf) file. @@ -147,7 +176,7 @@ Automatic root login and staring the graphical environment is configured in seve - Icewm uses the usual YaST2 installation [preferences.yast2](root/etc/icewm/preferences.yast2) configuration file -### Firefox Profile +### Firefox profile The default Firefox configuration is defined in the [profile](root/root/.mozilla/firefox/profile) file. It disables several features which do not make sense in Live ISO like remembering the used @@ -203,24 +232,13 @@ That allows scanning all running Agama instances in the local network with comma avahi-browse -t -r _agama._sub._https._tcp ``` -### The Default Cockpit/Agama TCP Port - -The default Cockpit TCP port is 9090. That makes sense for the system management framework as the -default ports might be used by a running Apache or other web servers. - -But Agama runs from a Live ISO where running a web server does not make much sense so we can safely -use the default HTTP(S) ports. - -The default port is changed in the -[listen.conf](root/etc/systemd/system/cockpit.socket.d/listen.conf) file. - -### Autoinstallation Support +### Autoinstallation support The autoinstallation is started using the [agama-auto](root/etc/systemd/system/agama-auto.service) service which starts the [auto.sh](root/usr/bin/auto.sh) script. This script downloads the installation profile, applies it to Agama and starts the installation. -### Firmware Cleanup +### Firmware cleanup The [fw_cleanup.rb](root/tmp/fw_cleanup.rb) script removes the unused firmware from the image. Many firmware files are not needed, this makes the final ISO much smaller.