From 4538255e79a4470c5e3df80cdd94d5532f077224 Mon Sep 17 00:00:00 2001 From: Howard Van Der Wal Date: Tue, 10 Dec 2024 16:45:48 +0900 Subject: [PATCH 1/2] New documentation on how to create a custom Rocky Linux ISO --- docs/guides/ISOs/iso_creation.md | 106 +++++++++++++++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 docs/guides/ISOs/iso_creation.md diff --git a/docs/guides/ISOs/iso_creation.md b/docs/guides/ISOs/iso_creation.md new file mode 100644 index 0000000000..c7080fa27f --- /dev/null +++ b/docs/guides/ISOs/iso_creation.md @@ -0,0 +1,106 @@ +--- +title: Creating a Custom Rocky Linux ISO +author: Howard Van Der Wal +contributors: +tested with: 9.5 +tags: +- create +- custom +- ISO +--- + +## Introduction + +Creating a custom ISO may be required for a litany of reasons. Perhaps you want to make a change to the boot process, add specific packages or update a configuration file. + +This guide will instruct you from start to finish on how to build your own Rocky Linux ISO. + +## Prerequisites + +* A 64 bit machine running Rocky Linux 9 to build the new ISO image. +* A Rocky Linux 9 DVD ISO image. +* A `kickstart` file to apply to the ISO. +* Read the Lorax [Quickstart](https://weldr.io/lorax/lorax.html#quickstart) and [mkksiso](https://weldr.io/lorax/mkksiso.html) documentation to become famililar with how the `Anaconda` `boot.iso` is created. + +## Package installation and setup + +* Install the `lorax` package: +``` +sudo dnf install -y lorax +``` + +## Building the ISO with a kickstart file + +* Run the `mkksiso` command to add a `kickstart` file and then build a new ISO: +``` +mkksiso --ks +``` +* Below is an example `kickstart` file `example-ks.cfg`, which sets up a Rocky Linux 9.5 `Server With GUI` environment: +``` +lang en_GB +keyboard --xlayouts='us' +timezone Asia/Tokyo --utc +reboot +cdrom +bootloader --append="rhgb quiet crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M" +zerombr +clearpart --all --initlabel +autopart +network --bootproto=dhcp +firstboot --disable +selinux --enforcing +firewall --enabled +%packages +@^server-product-environment +%end +``` + +## Adding a repository with its packages to an ISO image + +* Make sure the repository you want to add has the `repodata` directory inside of it. If not, this can be created using the `createrepo_c` command and this can be installed with `sudo dnf install -y createrepo_c` +* Add the repository to your `kickstart` file, using the following syntax: +``` +repo --name=extra-repo --baseurl=file:///run/install/repo// +``` +* Add your repository using the `--add` flag with the `mkksiso` tool: +``` +mkksiso --add --ks +``` + +* The process is detailed further using the `baseos` repository in the example below: +* The `base os` repository will be locally downloaded along with all of its packages: +``` +dnf reposync -p ~ --download-metadata --repo=baseos +``` +* Then add the repository to the `kickstart` file: +``` +repo --name=extra-repo --baseurl=file:///run/install/repo/baseos/ +``` +* The `kickstart` file would look like the following: +``` +lang en_GB +keyboard --xlayouts='us' +timezone Asia/Tokyo --utc +reboot +cdrom +bootloader --append="rhgb quiet crashkernel=1G-4G:192M,4G-64G:256M,64G-:512M" +zerombr +clearpart --all --initlabel +autopart +network --bootproto=dhcp +firstboot --disable +selinux --enforcing +firewall --enabled +%packages +@^server-product-environment +repo --name=extra-repo --baseurl=file:///run/install/repo/baseos/ +%end +``` +* Then point the `mkkiso` command directly to the repository directory and build the ISO: +``` +mkksiso --add ~/baseos --ks example-ks.cfg ~/Rocky-9.5-x86_64-dvd.iso ~/Rocky-9.5-x86_64-dvd-new.iso +``` + +## Conclusion + +What has been discussed here are just a few of the options available to tweak and build your own Rocky Linux ISO. For further ways, including modifying the kernel cmdline arguments, the author highly recommends to go through the [mkksiso](https://weldr.io/lorax/mkksiso.html) documentation in more detail. \ No newline at end of file From 69207e20a43dcec70323e67962948ecbec391268 Mon Sep 17 00:00:00 2001 From: Howard <87049949+metalllinux@users.noreply.github.com> Date: Tue, 10 Dec 2024 20:11:46 +0900 Subject: [PATCH 2/2] Update iso_creation.md Corrected spelling of mkksiso. --- docs/guides/ISOs/iso_creation.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/guides/ISOs/iso_creation.md b/docs/guides/ISOs/iso_creation.md index c7080fa27f..11d0aa9f16 100644 --- a/docs/guides/ISOs/iso_creation.md +++ b/docs/guides/ISOs/iso_creation.md @@ -96,11 +96,11 @@ firewall --enabled repo --name=extra-repo --baseurl=file:///run/install/repo/baseos/ %end ``` -* Then point the `mkkiso` command directly to the repository directory and build the ISO: +* Then point the `mkksiso` command directly to the repository directory and build the ISO: ``` mkksiso --add ~/baseos --ks example-ks.cfg ~/Rocky-9.5-x86_64-dvd.iso ~/Rocky-9.5-x86_64-dvd-new.iso ``` ## Conclusion -What has been discussed here are just a few of the options available to tweak and build your own Rocky Linux ISO. For further ways, including modifying the kernel cmdline arguments, the author highly recommends to go through the [mkksiso](https://weldr.io/lorax/mkksiso.html) documentation in more detail. \ No newline at end of file +What has been discussed here are just a few of the options available to tweak and build your own Rocky Linux ISO. For further ways, including modifying the kernel cmdline arguments, the author highly recommends to go through the [mkksiso](https://weldr.io/lorax/mkksiso.html) documentation in more detail.