diff options
Diffstat (limited to 'gen')
-rwxr-xr-x | gen | 47 |
1 files changed, 47 insertions, 0 deletions
@@ -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" |