Skip to content

Commit

Permalink
feat(live): Improve Makefile for building the Live ISO (#1928)
Browse files Browse the repository at this point in the history
## Improvements

- Allow building the SLE image (using internal OBS)
- Allow passing extra parameters to OSC build (like preferred RPMs)
- Updated documentation
  - Documented the new features
  - Removed outdated Cockpit section
  - Unified heading style
  • Loading branch information
lslezak authored Feb 7, 2025
1 parent 01caffe commit 6311784
Show file tree
Hide file tree
Showing 2 changed files with 59 additions and 38 deletions.
5 changes: 4 additions & 1 deletion live/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ 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"
# default OBS build target
OBS_TARGET = "images"
ARCH = $(shell uname -m)

# files to copy from src/
COPY_FILES = $(patsubst $(SRCDIR)/%,$(DESTDIR)/%,$(wildcard $(SRCDIR)/*))
Expand Down Expand Up @@ -58,6 +61,6 @@ build: $(DESTDIR)
if [ ! -e $(DESTDIR)/.osc ]; then make clean; osc -A $(OBS_API) co -o $(DESTDIR) $(OBS_PROJECT) $(OBS_PACKAGE); fi
$(MAKE) all
# allow passing optional parameters to osc like "-p <dir>" or "-k <dir>"
(cd $(DESTDIR) && osc -A $(OBS_API) build -M $(FLAVOR) $(OSC_OPTS) images)
(cd $(DESTDIR) && osc -A $(OBS_API) build -M $(FLAVOR) $(OSC_OPTS) $(OBS_TARGET) $(ARCH) $(KIWI_FILE))

.PHONY: build all clean
92 changes: 55 additions & 37 deletions live/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)

---

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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

Expand All @@ -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`
Expand All @@ -90,17 +95,42 @@ directory and checkout the OBS project manually and run the build:
```shell
rm -rf dist
# replace <USER> with your OBS account name
osc co -o dist home:<USER>:branches:systemsmanagement:Agama:Devel agama-installer-openSUSE
make build
make build OBS_PROJECT=home:<USER>: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=<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:

Expand All @@ -118,20 +148,19 @@ 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).

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.
Expand All @@ -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
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit 6311784

Please sign in to comment.