Skip to content

One Zero One

Code for Your Node

  • Home
  • Posts
  • Contact

Customizing the AlmaLinux Installer Media

  1. Home
  2. Customizing the AlmaLinux Installer Media
  • Andy Lievertz
  • January 6, 2022
  • 1
Posted in Linux, Systems AdministrationTagged in almalinux, centos, custom, installer, iso, kickstart, linux, red hat enterprise linux, rhel

This article shows you how to customize the AlmaLinux (or Red Hat Enterprise Linux, or Rocky Linux, or CentOS Linux) installer media to include a kickstart file and additional file assets. Commands prepended with # should be run as root while commands prepended with $ should be run as your regular user.

Prerequisites

  • A basic AlmaLinux workstation installation (temporary is fine).
  • The Alma Linux boot ISO in your user home directory.
  • A kickstart file in your user home directory (~/ks.cfg). Kickstart files are a complicated topic warranting their own article and are not detailed here.
  • An Assets subdirectory of your user home directory containing any additional files you want to be available during installation (wallpapers, configuration files, etc.)

Steps

Install required packages.

# dnf install createrepo genisoimage isomd5sum syslinux

Create a directory to mount the AlmaLinux ISO and a working directory.

# mkdir /mnt/almalinux
$ mkdir ~/almalinux-custom

Mount the ISO.

# mount -o loop ~/AlmaLinux-8.5-x86_64-boot.iso /mnt/almalinux

Copy the ISO contents to a working directory.

$ rsync -av --progress /mnt/almalinux/ ~/almalinux-custom/

Unmount the ISO.

# umount /mnt/almalinux

Copy the kickstart file.

$ cp ~/ks.cfg ~/almalinux-custom/

Copy the Assets directory to the root of the custom ISO and update the metadata.

$ cp -r ~/Assets ~/almalinux-custom/
$ createrepo -dpo ~/almalinux-custom ~/almalinux-custom/Assets/

Add kickstart to boot options to grub.cfg for UEFI boot and modify the boot order. Remove the strikethrough items and add the bold items.

$ nano ~/almalinux-custom/EFI/BOOT/grub.cfg
set default="1"
set default="0"

set timeout=60
set timeout=0

​​​​​​​menuentry 'Install AlmaLinux 8' --class fedora --class gnu-linux --class gnu --class os {
        linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=AlmaLinux-8-5-x86_64-dvd quiet inst.text inst.ks=cdrom:/ks.cfg inst.stage2=hd:LABEL=AlmaLinux-8-5-x86_64-custom
        initrdefi /images/pxeboot/initrd.img

Add kickstart options to isolinux.cfg for legacy BIOS boot and modify boot order. Remove the strikethrough items and add the bold items.

$ nano /mnt/almalinux-custom/isolinux/isolinux.cfg
​​​​​​​timeout 600
timeout 0

l​​​​​​​abel linux

  menu label ^Install AlmaLinux 8
  kernel vmlinuz
  append initrd=initrd.img inst.stage2=hd:LABEL=AlmaLinux-8-5-x86_64-dvd quiet inst.text inst.ks=cdrom:/ks.cfg inst.stage2=hd:LABEL=AlmaLinux-8-5-x86_64-custom

Create the custom ISO.

$ mkisofs -o /mnt/hgfs/data/AlmaLinux-8.5-x86_64-custom.iso -b isolinux/isolinux.bin -J -R -l -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e images/efiboot.img -no-emul-boot -graft-points -V "AlmaLinux-8-5-x86_64-custom" /mnt/almalinux-custom/

Use isohybrid to enable writing to USB devices.

$ isohybrid --uefi ~/AlmaLinux-8.5-x86_64-custom.iso

Add the MD5 checksum.

$ implantisomd5 ~/AlmaLinux-8.5-x86_64-custom.iso
  • Share:  
  • Facebook
  • Twitter
  • Google+

Andy Lievertz

View all posts by Andy Lievertz | Website

Previous post

Common Elements for Windows Answer Files

Next post

Example AlmaLinux Kickstart

Related Posts

Update Visual Studio Code Updates Settings with PowerShell

  • Andy Lievertz
  • June 2, 2022
  • 0

On Windows systems, Visual Studio Code settings are stored in a subfolder of the User profile. %APPDATA%\Code\User\settings.json There is no global settings file, so if you are deploying in an […]

Read More

Demystifying Microsoft Endpoint Manager Win32 App Deployments

  • Andy Lievertz
  • May 12, 2022
  • 0

Some aspects of traditional Windows application (win32) deployment using Microsoft Endpoint Manager (Intune) can be frustratingly elusive. Understanding a few things about the program environment and detection capabilities will help […]

Read More

One thought on “Customizing the AlmaLinux Installer Media”

Comments are closed.

Recent Posts

  • Update Visual Studio Code Updates Settings with PowerShell
  • Demystifying Microsoft Endpoint Manager Win32 App Deployments
  • Making Libvirt User-friendly in AlmaLinux
  • Example AlmaLinux Kickstart
  • Customizing the AlmaLinux Installer Media

Categories

  • Bash
  • Emulation
  • Linux
  • PowerShell
  • Scripting
  • Systems Administration
  • Uncategorized
  • Virtualization

Search

Copyright © 2021 | All Rights Reserved.

Loading