Skip to content

Commit

Permalink
Add support for Live ISO to rebuild_boot_iso
Browse files Browse the repository at this point in the history
Simple way to build a Live ISO for us.
  • Loading branch information
jkonecny12 committed Aug 6, 2024
1 parent e574ab2 commit b1ee89f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 10 deletions.
14 changes: 8 additions & 6 deletions CONTRIBUTING.rst
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,12 @@ Local development workflow
^^^^^^^^^^^^^^^^^^^^^^^^^^

This workflow makes it possible to test changes to the Anaconda source code locally on your machine without any dependencies
on external infrastructure. It uses two scripts, one called ``scripts/testing/rebuild_boot_iso`` to build a fresh bootable installation image (boot.iso)
from Anaconda source code on the given branch and corresponding Fedora/CentOS Stream packages. The second script, called ``scripts/testing/update_boot_iso``
on external infrastructure. It uses two scripts, one called ``scripts/testing/rebuild_iso`` to build a fresh bootable installation image
from Anaconda source code on the given branch and corresponding Fedora/CentOS Stream packages. The second script, called ``scripts/testing/update_iso``
uses the Anaconda updates image mechanism together with the ``mkksiso`` command provided by the Lorax project to very quickly
create an updated version of the boot.iso when Anaconda code is changed. The updated boot.iso can then be booted on a VM or bare metal.

The ``rebuild_boot_iso`` script
The ``rebuild_iso`` script
"""""""""""""""""""""""""""""""

This is just a simple script that rebuilds the boot.iso from Anaconda source code on the current branch & corresponding Fedora
Expand All @@ -164,17 +164,19 @@ and also records Anaconda Git revision that was used to build the image.

This should take about 15 minutes on modern hardware.

The ``update_boot_iso`` script
See --help for further information.

The ``update_iso`` script
""""""""""""""""""""""""""""""

This is the main script that enables local development by quickly updating a boot iso with local changes.
This should take a couple seconds on modern hardware.

For the most common use case ("I have changed the Anaconda source and want to see what it does.") just do this:

1. run ``scripts/testing/rebuild_boot_iso`` first, this creates ``result/iso/boot.iso``
1. run ``scripts/testing/rebuild_iso`` first, this creates ``result/iso/boot.iso``
2. change the Anaconda source code
3. run ``scripts/testing/update_boot_iso`` which creates the ``result/iso/updated_boot.iso``
3. run ``scripts/testing/update_iso`` which creates the ``result/iso/updated_boot.iso``
4. start the ``result/iso/updated_boot.iso`` in a VM or on bare metal

The script also has a few command line options that might come handy:
Expand Down
18 changes: 14 additions & 4 deletions scripts/testing/rebuild_boot_iso → scripts/testing/rebuild_iso
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ set -eu
help() {
cat <<EOF
This script will build the anaconda RPMs and then build boot.iso
from these.
or Live ISO from these.
Before starting the build it will remove all the previous build
artifacts.
Expand All @@ -24,22 +24,27 @@ Options:
-h, --help Print this help
-a, --add-rpms Add additional RPMs (for example anaconda-webui package)
these packages have to be already requested to be in ISO
-l, --live Build Live ISO instead of boot.iso
EOF
}

BOOT_ISO="result/iso/boot.iso"
PACKAGES_DIR="result/build/01-rpm-build/"
UPDATED_BOOT_ISO="result/iso/boot.iso.git_rev"
BOOT_ISO_GIT_REVISION="result/iso/boot.iso.git_rev"

BUILD_TARGET="boot.iso"

COPY_RPMS=""

# parse arguments
eval set -- "$(getopt -o ha: --long help,add-rpms: -- "$@")"
eval set -- "$(getopt -o ha:l --long help,add-rpms:,live -- "$@")"

while true; do
case "${1:-}" in
-h|--help) help; exit 0 ;;
-a|--add-rpms) shift; COPY_RPMS="$COPY_RPMS $1" ;;
-l|--live) BUILD_TARGET="live" ;;
--) shift; break ;;
esac
shift
Expand All @@ -66,5 +71,10 @@ for i in $COPY_RPMS; do
done

# build the ISO
make -f ./Makefile.am anaconda-iso-creator-build
make -f ./Makefile.am container-iso-build
if [ "$BUILD_TARGET" = "boot.iso" ]; then
make -f ./Makefile.am anaconda-iso-creator-build
make -f ./Makefile.am container-iso-build
elif [ "$BUILD_TARGET" = "live" ]; then
make -f ./Makefile.am anaconda-live-iso-creator-build
make -f ./Makefile.am container-live-iso-build
fi
File renamed without changes.

0 comments on commit b1ee89f

Please sign in to comment.