summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Schmelzer2011-05-04 10:59:11 +0200
committerSebastian Schmelzer2011-05-04 10:59:11 +0200
commit34a5b4a0cdefa549331a3bdcdccc8d07d082aa28 (patch)
tree76f7021f6dbb6377c3816bc95620c805631501fe
parentadd gplv2 (diff)
downloadusb-boot-stick-34a5b4a0cdefa549331a3bdcdccc8d07d082aa28.tar.gz
usb-boot-stick-34a5b4a0cdefa549331a3bdcdccc8d07d082aa28.tar.xz
usb-boot-stick-34a5b4a0cdefa549331a3bdcdccc8d07d082aa28.zip
fix for small, single partition usb sticks
-rwxr-xr-xinstall-usb23
-rwxr-xr-xinstaller/tpl/installer.tpl.sh23
2 files changed, 36 insertions, 10 deletions
diff --git a/install-usb b/install-usb
index 8c62945..3ad2a62 100755
--- a/install-usb
+++ b/install-usb
@@ -66,6 +66,7 @@ if [ ${FREE} -ge 50 ] ; then
,,6,*
EOF
else
+ NO_USRHOME=true
sfdisk /dev/${OUT_DEV} << EOF
,,6,*
EOF
@@ -84,15 +85,23 @@ sync
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}2
-mkfs.ext2 -L openslx-usrhome /dev/${OUT_DEV}1
+if [ "x$NO_USRHOME" != "xtrue" ]; then
+ mkfs.vfat -F 16 -n openslx-stick /dev/${OUT_DEV}2
+ mkfs.ext2 -L openslx-usrhome /dev/${OUT_DEV}1
+else
+ mkfs.vfat -F 16 -n openslx-stick /dev/${OUT_DEV}1
+fi
mkdir -p /media/openslx-stick /media/openslx-stick-usrhome
sync
-mount /dev/${OUT_DEV}2 /media/openslx-stick
-mount /dev/${OUT_DEV}1 /media/openslx-stick-usrhome
+if [ "x$NO_USRHOME" != "xtrue" ]; then
+ mount /dev/${OUT_DEV}2 /media/openslx-stick
+ mount /dev/${OUT_DEV}1 /media/openslx-stick-usrhome
+else
+ mount /dev/${OUT_DEV}1 /media/openslx-stick
+fi
mkdir -p /media/openslx-stick/boot
@@ -113,5 +122,9 @@ umount /media/openslx-stick-usrhome
rm -rf /media/openslx-stick*
-${SYSLINUX}/linux/syslinux --install -d /boot -f /dev/${OUT_DEV}2
+if [ "x$NO_USRHOME" != "xtrue" ]; then
+ ${SYSLINUX}/linux/syslinux --install -d /boot -f /dev/${OUT_DEV}2
+else
+ ${SYSLINUX}/linux/syslinux --install -d /boot -f /dev/${OUT_DEV}1
+fi
diff --git a/installer/tpl/installer.tpl.sh b/installer/tpl/installer.tpl.sh
index 1214af3..0e5c83b 100755
--- a/installer/tpl/installer.tpl.sh
+++ b/installer/tpl/installer.tpl.sh
@@ -158,6 +158,7 @@ if [ ${FREE} -ge 50 ] ; then
,,6,*
EOF
else
+ NO_USRHOME=true
sfdisk /dev/${OUT_DEV} << EOF
,,6,*
EOF
@@ -169,15 +170,23 @@ sync
dd bs=440 count=1 conv=notrunc if=$TMP_DIR/share/mbr.bin of=/dev/${OUT_DEV} $DEBUG_OUT
# create filesystems on newly createt partitions
-mkfs.vfat -F 16 -n PBStick /dev/${OUT_DEV}2 $DEBUG_OUT
-mkfs.ext2 -L openslx-usrhome /dev/${OUT_DEV}1 $DEBUG_OUT
+if [ "x$NO_USRHOME" != "xtrue" ]; then
+ mkfs.vfat -F 16 -n openslx-stick /dev/${OUT_DEV}2
+ mkfs.ext2 -L openslx-usrhome /dev/${OUT_DEV}1
+else
+ mkfs.vfat -F 16 -n openslx-stick /dev/${OUT_DEV}1
+fi
mkdir -p /media/openslx-stick /media/openslx-stick-usrhome
sync
-mount /dev/${OUT_DEV}2 /media/openslx-stick
-mount /dev/${OUT_DEV}1 /media/openslx-stick-usrhome
+if [ "x$NO_USRHOME" != "xtrue" ]; then
+ mount /dev/${OUT_DEV}2 /media/openslx-stick
+ mount /dev/${OUT_DEV}1 /media/openslx-stick-usrhome
+else
+ mount /dev/${OUT_DEV}1 /media/openslx-stick
+fi
mkdir -p /media/openslx-stick/boot
@@ -188,7 +197,11 @@ umount /media/openslx-stick-usrhome $DEBUG_OUT
rm -rf /media/openslx-stick* $DEBUG_OUT
-$TMP_DIR/bin/syslinux --install -d /boot -f /dev/${OUT_DEV}2 $DEBUG_OUT
+if [ "x$NO_USRHOME" != "xtrue" ]; then
+ ${SYSLINUX}/linux/syslinux --install -d /boot -f /dev/${OUT_DEV}2
+else
+ ${SYSLINUX}/linux/syslinux --install -d /boot -f /dev/${OUT_DEV}1
+fi
unset_quiet