This commit is contained in:
Bart Sjerps
2026-06-10 13:28:26 +02:00
parent e49e2d3909
commit 0a01479d24
8 changed files with 93 additions and 4 deletions
+23 -4
View File
@@ -1,18 +1,37 @@
#!/bin/bash
#============================================================================
# Title : make-iso
# Description : Make a custom Rocky Linux installable ISO
# ---------------------------------------------------------------------------
# requires lorax, genisoimage: dnf install lorax genisoimage
die() { echo "$(basename $0): [die] $@" >&2 ; exit 1 ; }
test $(id -u) == 0 || die "Run as root (sudo $(basename $0) <opts>"
# 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
# requires lorax, genisoimage: dnf install lorax genisoimage
isopath=/nfs/sw/os/rocky/Rocky-9.7-x86_64-minimal.iso
target=/nfs/pve/template/iso/custom.iso
ks=/users/bart/git/rocky/kickstart/rocky-9.cfg
custom=/users/bart/git/rocky/custom
ks=$topdir/kickstart/rocky-9.cfg
custom=$topdir/custom
cp -r $custom $WORKDIR
cp $ks $WORKDIR
rpm -q --quiet lorax || die "lorax not installed"
rpm -q --quiet genisoimage || die "genisoimage not installed"
test -f $target && rm -f $target
test -f $target && sudo rm -f $target
sudo mkksiso -a $custom --ks=$ks $isopath $target
mkksiso -a $WORKDIR/custom --ks=$WORKDIR/$(basename $ks) $isopath $target