summaryrefslogtreecommitdiffstats
path: root/install-usb
diff options
context:
space:
mode:
authorDirk von Suchodoletz2011-04-30 16:13:12 +0200
committerDirk von Suchodoletz2011-04-30 16:13:12 +0200
commitc205f2a9a8d2760540343a2293301edcca60ce6c (patch)
tree7ba1d3755a677a9b2d1418db2989dfa6f97297f8 /install-usb
parentupdate create installer script to use syslinux as well .. (diff)
downloadusb-boot-stick-c205f2a9a8d2760540343a2293301edcca60ce6c.tar.gz
usb-boot-stick-c205f2a9a8d2760540343a2293301edcca60ce6c.tar.xz
usb-boot-stick-c205f2a9a8d2760540343a2293301edcca60ce6c.zip
Boot ISO creator modelled after the usb-stick tool ...
Diffstat (limited to 'install-usb')
-rwxr-xr-xinstall-usb30
1 files changed, 18 insertions, 12 deletions
diff --git a/install-usb b/install-usb
index 6b8a25f..cfccfda 100755
--- a/install-usb
+++ b/install-usb
@@ -8,11 +8,11 @@ if [ $(whoami) != "root" ]; then
fi
OUT_DEV=$1
-SYSLINUX=$ROOT_DIR/contrib/syslinux/latest
+SYSLINUX=${ROOT_DIR}/contrib/syslinux/latest
-PATH="$PATH:$ROOT_DIR/bin/"
+PATH="$PATH:${ROOT_DIR}/bin/"
-[ ! -f $SYSLINUX/Makefile ] && env.setup-syslinux.sh
+[ ! -f ${SYSLINUX}/Makefile ] && env.setup-syslinux.sh
if [ -z $OUT_DEV ]; then
echo "no dev"
@@ -23,6 +23,12 @@ for i in 1 2 3 4 5 6 7 8 9; do
umount /dev/${OUT_DEV}$i &> /dev/null
done
+# get the total size of the device
+DISKSIZE=$(sfdisk -s /dev/${OUT_DEV} 2>/dev/null || echo 0)
+
+# get the size of boot stuff
+
+
# create bootable vfat partition with 96cylinders and a ext3 partition for the
# rest of the stick
sfdisk /dev/${OUT_DEV} << EOF
@@ -33,7 +39,7 @@ EOF
sync
# copy mbr to stick
-dd bs=440 count=1 conv=notrunc if=$SYSLINUX/mbr/mbr.bin of=/dev/${OUT_DEV}
+dd bs=440 count=1 conv=notrunc if=${SYSLINUX}/mbr/mbr.bin of=/dev/${OUT_DEV}
# create filesystems on newly createt partitions
mkfs.vfat -F 16 -n openslx-stick /dev/${OUT_DEV}1
@@ -49,22 +55,22 @@ mount /dev/${OUT_DEV}2 /media/openslx-stick-usrhome
mkdir -p /media/openslx-stick/boot
-[ ! -f $ROOT_DIR/build/kernel-preboot-latest ] && build.kernel.sh
-cp -v $ROOT_DIR/build/kernel-preboot-latest /media/openslx-stick/boot/kernel
+[ ! -f ${ROOT_DIR}/build/kernel-preboot-latest ] && build.kernel.sh
+cp -v ${ROOT_DIR}/build/kernel-preboot-latest /media/openslx-stick/boot/kernel
-#[ ! -f $ROOT_DIR/build/initramfs-default ] && build.initramfs.sh
+#[ ! -f ${ROOT_DIR}/build/initramfs-default ] && build.initramfs.sh
build.initramfs.sh
-cp -v $ROOT_DIR/build/initramfs-default /media/openslx-stick/boot/init
+cp -v ${ROOT_DIR}/build/initramfs-default /media/openslx-stick/boot/init
-cp -v $SYSLINUX/com32/menu/menu.c32 /media/openslx-stick/boot/
-cp -v $SYSLINUX/com32/menu/vesamenu.c32 /media/openslx-stick/boot/
+cp -v ${SYSLINUX}/com32/menu/menu.c32 /media/openslx-stick/boot/
+cp -v ${SYSLINUX}/com32/menu/vesamenu.c32 /media/openslx-stick/boot/
-cp -v $ROOT_DIR/config/extlinux/* /media/openslx-stick/boot
+cp -v ${ROOT_DIR}/config/extlinux/* /media/openslx-stick/boot
mv /media/openslx-stick/boot/extlinux.conf /media/openslx-stick/boot/syslinux.cfg
sync
umount /media/openslx-stick
umount /media/openslx-stick-usrhome
-$SYSLINUX/linux/syslinux --install -d /boot -f /dev/${OUT_DEV}1
+${SYSLINUX}/linux/syslinux --install -d /boot -f /dev/${OUT_DEV}1