summaryrefslogtreecommitdiffstats
path: root/create-installer.sh
diff options
context:
space:
mode:
authorMichael Neves2012-01-27 15:03:56 +0100
committerMichael Neves2012-01-27 15:03:56 +0100
commit8e8af091fd55501dcbab42836726cd25a494c077 (patch)
tree1af1be3fa81ca5196f5a7dba0e0df8218bde2cc5 /create-installer.sh
parentadded boot media type in kcl of preboot environment (diff)
downloadusb-boot-stick-8e8af091fd55501dcbab42836726cd25a494c077.tar.gz
usb-boot-stick-8e8af091fd55501dcbab42836726cd25a494c077.tar.xz
usb-boot-stick-8e8af091fd55501dcbab42836726cd25a494c077.zip
pbs-serials added
Diffstat (limited to 'create-installer.sh')
-rwxr-xr-xcreate-installer.sh60
1 files changed, 60 insertions, 0 deletions
diff --git a/create-installer.sh b/create-installer.sh
new file mode 100755
index 0000000..0bd5038
--- /dev/null
+++ b/create-installer.sh
@@ -0,0 +1,60 @@
+#!/bin/bash
+# -----------------------------------------------------------------------------
+# Copyright (c) 2011 - OpenSLX GmbH
+#
+# This program is free software distributed under the GPL version 2.
+# See http://openslx.org/COPYING
+#
+# If you have any feedback please consult http://openslx.org/feedback and
+# send your suggestions, praise, or complaints to feedback@openslx.org
+#
+# General information about OpenSLX can be found at http://openslx.org/
+# -----------------------------------------------------------------------------
+# PreBoot USB stick preparation utility
+# -----------------------------------------------------------------------------
+
+ROOT_DIR=$(dirname $(readlink -f $0))
+
+if [ $(whoami) != "root" ]; then
+ echo "you should be root"
+ exit 1;
+fi
+
+OUT_DEV=$1
+SYSLINUX=$ROOT_DIR/contrib/syslinux/latest
+
+PBSI=$ROOT_DIR/installer/pbstick-installer
+
+PATH="$PATH:$ROOT_DIR/bin/"
+
+[ ! -f $SYSLINUX/Makefile ] && env.setup-syslinux.sh
+
+rm -rf $ROOT_DIR/installer/tmp
+rm -f $ROOT_DIR/installer/stick-payload.tar.bz2
+
+mkdir -p $ROOT_DIR/installer/tmp/share \
+ $ROOT_DIR/installer/tmp/bin \
+ $ROOT_DIR/installer/tmp/boot
+
+cp -f $SYSLINUX/mbr/mbr.bin $ROOT_DIR/installer/tmp/share
+cp -f $SYSLINUX/linux/syslinux $ROOT_DIR/installer/tmp/bin
+
+[ ! -f $ROOT_DIR/build/kernel-preboot-latest ] && build.kernel.sh
+cp -f $ROOT_DIR/build/kernel-preboot-latest $ROOT_DIR/installer/tmp/boot/kernel
+
+build.initramfs.sh
+cp -f $ROOT_DIR/build/initramfs-default $ROOT_DIR/installer/tmp/boot/initramfs
+
+cp -f $SYSLINUX/com32/menu/menu.c32 $ROOT_DIR/installer/tmp/boot/
+cp -f $SYSLINUX/com32/menu/vesamenu.c32 $ROOT_DIR/installer/tmp/boot/
+cp -f $ROOT_DIR/config/extlinux/* $ROOT_DIR/installer/tmp/boot/
+mv $ROOT_DIR/installer/tmp/boot/extlinux.conf $ROOT_DIR/installer/tmp/boot/syslinux.cfg
+
+cd $ROOT_DIR/installer/tmp/
+tar cjf ../stick-payload.tar.bz2 *
+cd $ROOT_DIR
+
+cat $ROOT_DIR/installer/tpl/installer.tpl.sh > $PBSI
+echo "PAYLOAD:" >> $PBSI
+cat $ROOT_DIR/installer/stick-payload.tar.bz2 | uuencode - >> $PBSI
+chmod +rx $PBSI