git.lirion.de

Of git, get, and gud

aboutsummaryrefslogtreecommitdiffstats
path: root/gen
diff options
context:
space:
mode:
Diffstat (limited to 'gen')
-rwxr-xr-xgen47
1 files changed, 47 insertions, 0 deletions
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"