From 92d09f370f1ebd0a27abda0a463df953d4b79ef0 Mon Sep 17 00:00:00 2001 From: Harald Pfeiffer Date: Mon, 9 Mar 2020 15:48:20 +0100 Subject: InComm --- gen | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100755 gen (limited to 'gen') diff --git a/gen b/gen new file mode 100755 index 0000000..6729b72 --- /dev/null +++ b/gen @@ -0,0 +1,47 @@ +#!/usr/bin/env bash +# vim:tabstop=4:syntax=sh +# export SHELLCHECK_OPTS='--exclude=SC2128,SC2164' + +# define things + +# location of isohdpfx.bin: +PFXB="/usr/lib/ISOLINUX/isohdpfx.bin" + +# script from here + +RETVAL=0 +DIRS=( $(find . -maxdepth 1 -mindepth 1 -type d|grep -vP '/diff[^/]*'|awk -F/ '{print $NF}') ) +# shellcheck disable=SC2128 +[ -z "$DIRS" ]&&exit 1 + +for i in "${DIRS[@]}";do + ISOVERSTR="$(echo "$i"|sed 's/debian/Debian/;s/-//')" + # shellcheck disable=SC2128,SC2164 + ( + cd "$i/src" 2>/dev/null + [ "$?" -ne 0 ]&&printf "%b not accessible!\n" "$i/src" >&2&&exit 2 + xorriso -as mkisofs -r -J -joliet-long -l -cache-inodes -isohybrid-mbr "$PFXB"\ + -partition_offset 16 -A "$ISOVERSTR" -b isolinux/isolinux.bin -c isolinux/boot.cat\ + -no-emul-boot -boot-load-size 4 -boot-info-table -o "$i"-serial-install.iso ../src/ + case "$?" in + 0);; + *) printf "Creation of %b failed!" "$i-serial-install.iso" >&2;exit 4;; + esac + mv -v "$i"-serial-install.iso ../dst/ + case "$?" in + 0);; + *) printf "Move of %b failed!" "$i-serial-install.iso" >&2;exit 8;; + esac + );LRV="$?" + case "$LRV" in + 0);; + *) + case "$RETVAL" in + 0) RETVAL="$((100+LRV))";; + *) RETVAL=$((RETVAL+LRV));; + esac + ;; + esac +done + +exit "$RETVAL" -- cgit v1.2.3