summaryrefslogtreecommitdiffstats
path: root/build_tools/clarch/larch/run/usb2bootiso
diff options
context:
space:
mode:
Diffstat (limited to 'build_tools/clarch/larch/run/usb2bootiso')
-rwxr-xr-xbuild_tools/clarch/larch/run/usb2bootiso66
1 files changed, 66 insertions, 0 deletions
diff --git a/build_tools/clarch/larch/run/usb2bootiso b/build_tools/clarch/larch/run/usb2bootiso
new file mode 100755
index 0000000..cb2190a
--- /dev/null
+++ b/build_tools/clarch/larch/run/usb2bootiso
@@ -0,0 +1,66 @@
+#!/bin/bash
+
+# usb2bootiso
+
+# For use after a completed run of mklarch or larchify which has produced
+# a larch USB-stick with syslinux boot. It will generate a boot iso for
+# use on computers which can't boot from the USB-stick.
+
+# $1 is the base of the 'livified' Arch installation (larchroot)
+# If no path is given, a directory (or symlink) 'larchroot' in the
+# working directory will be used.
+#===================================================================
+# 2008.06.22
+
+APP="$( basename $0 )"
+# Get path to larch base directory, via the location of this script
+FULLPATH="$( readlink -f $0 )"
+SCRIPTDIR="$( dirname ${FULLPATH} )"
+
+mkiso ()
+{
+ mkisofs -r -l $1 \
+ -no-emul-boot -boot-load-size 4 -boot-info-table \
+ -input-charset=UTF-8 \
+ -publisher "designed by gradgrind, licence: GPL" \
+ -A "larch-5" \
+ -o "bootcd.iso" "${CDDATA}"
+
+ if [ $? -eq 0 ]; then
+ echo "// Your ISO has been created as bootcd.iso"
+ else
+ echo "ERROR: iso build failed" 1>&2
+ return 1
+ fi
+}
+
+if [ -z "$1" ]; then
+ if [ -d larchroot ]; then
+ MP="$( readlink -f larchroot )"
+ else
+ echo "Must pass Arch root directory as argument"
+ exit 1
+ fi
+else
+ if ! [ -d $1 ]; then
+ echo "$1 is not a directory"
+ exit 1
+ fi
+ MP="$( readlink -f $1 )"
+fi
+
+CDDATA=$( pwd )/bootcd
+rm -rf ${CDDATA}
+mkdir -p ${CDDATA}/isolinux
+
+if ! cp -r ${MP}/.larch/cd/isolinux ${CDDATA} &>/dev/null; then
+ echo "No larch boot files found at ${MP}/.larch/cd/isolinux"
+ exit 1
+fi
+if ! cp ${MP}/usr/lib/syslinux/isolinux.bin ${CDDATA}/isolinux; then
+ echo "Couldn't find isolinux.bin"
+ exit 1
+fi
+
+mkiso "-b isolinux/isolinux.bin -c isolinux/isolinux.boot"
+