Files
rocky/bin/make-rocky
T

36 lines
1.1 KiB
Bash
Raw Normal View History

2026-05-27 09:12:36 +02:00
#!/bin/bash
2026-06-10 13:28:26 +02:00
#============================================================================
# Title : make-iso
# Description : Make a custom Rocky Linux installable ISO
# ---------------------------------------------------------------------------
# requires lorax, genisoimage: dnf install lorax genisoimage
2026-05-27 09:12:36 +02:00
2026-06-10 12:02:38 +02:00
die() { echo "$(basename $0): [die] $@" >&2 ; exit 1 ; }
2026-07-10 10:18:21 +02:00
test $(id -u) == 0 || die "Run as root (sudo $(basename $0) <opts>"
rpm -q --quiet lorax || die "lorax not installed"
rpm -q --quiet genisoimage || die "genisoimage not installed"
2026-06-10 13:28:26 +02:00
# Setup temp working directory - clean it up when program ends
readonly WORKDIR=$(/bin/mktemp --tmpdir -d)
cleanup() { /bin/rm -rf ${WORKDIR:-/none} ; }
trap "cleanup" INT TERM HUP EXIT
topdir=$(git rev-parse --show-toplevel)
echo $topdir
2026-06-09 15:35:06 +02:00
isopath=/nfs/sw/os/rocky/Rocky-9.7-x86_64-minimal.iso
2026-06-10 12:02:38 +02:00
target=/nfs/pve/template/iso/custom.iso
2026-06-10 13:28:26 +02:00
ks=$topdir/kickstart/rocky-9.cfg
custom=$topdir/custom
cp -r $custom $WORKDIR
cp $ks $WORKDIR
2026-05-27 09:12:36 +02:00
2026-06-10 13:28:26 +02:00
test -f $target && sudo rm -f $target
2026-06-10 12:02:38 +02:00
2026-06-10 14:43:23 +02:00
$topdir/bin/mkksiso -a $WORKDIR/custom --ks=$WORKDIR/$(basename $ks) --custom_cfg $topdir/kickstart/isolinux.cfg $isopath $target
2026-05-27 09:12:36 +02:00