diff options
author | Sebastian | 2011-04-26 19:38:11 +0200 |
---|---|---|
committer | Sebastian | 2011-04-26 19:38:11 +0200 |
commit | e8f2057c4ba4e366f132e2a8780324232c725fd3 (patch) | |
tree | 9b411c31c01a20e397b633ae672b27a24858f998 /installer | |
parent | update fbgui... (diff) | |
download | usb-boot-stick-e8f2057c4ba4e366f132e2a8780324232c725fd3.tar.gz usb-boot-stick-e8f2057c4ba4e366f132e2a8780324232c725fd3.tar.xz usb-boot-stick-e8f2057c4ba4e366f132e2a8780324232c725fd3.zip |
create installer working ..
Diffstat (limited to 'installer')
-rwxr-xr-x | installer/tpl/installer.tpl.sh | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/installer/tpl/installer.tpl.sh b/installer/tpl/installer.tpl.sh new file mode 100755 index 0000000..8e335e3 --- /dev/null +++ b/installer/tpl/installer.tpl.sh @@ -0,0 +1,48 @@ +#!/bin/bash + +ROOT_DIR=$(dirname $(readlink -f $0)) +SELF=$(readlink -f $0) +TMP_DIR="/tmp/pbstick-$$" + +OUT_DEV=$1 + +if [ $(whoami) != "root" ]; then + echo "you should be root" + exit 1; +fi + +if [ -z $OUT_DEV ]; then + echo "no outputdev specified - usage $0 [devicename of usbstick] (eg sdc for /dev/sdc)" + exit 1 +fi + +mkdir -p $TMP_DIR + +match=$(grep --text --line-number '^PAYLOAD:$' $SELF | cut -d ':' -f 1) +payload_start=$((match + 1)) +cd $TMP_DIR +tail -n +$payload_start $SELF | uudecode | tar -xjvf - +cd $ROOT_DIR + + +PATH="$PATH:$TMP_DIR/bin/" + +for i in 1 2 3 4 5 6 7 8 9; do + umount /dev/${OUT_DEV}$i &> /dev/null +done + +cat $TMP_DIR/share/mbr.bin > /dev/${OUT_DEV} +mkfs.ext2 /dev/${OUT_DEV}1 + +mkdir -p /media/openslx-stick +mount /dev/${OUT_DEV}1 /media/openslx-stick + +mkdir -p /media/openslx-stick/boot + +$TMP_DIR/bin/extlinux -i /media/openslx-stick/boot + +cp -v $TMP_DIR/boot/* /media/openslx-stick/boot/ + +sync +umount /media/openslx-stick +exit 1 |