summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLucas Affonso Xavier de Morais2014-09-05 17:28:43 +0200
committerMichael Pereira Neves2014-10-28 14:14:50 +0100
commita12eb5eeee3ffc1711fae8142160079e86a345a0 (patch)
tree2761c60efb3a6d9758ff59bd8ab6ae7e69b43725
parent[partitioner] minor fixes. (diff)
downloadtm-scripts-a12eb5eeee3ffc1711fae8142160079e86a345a0.tar.gz
tm-scripts-a12eb5eeee3ffc1711fae8142160079e86a345a0.tar.xz
tm-scripts-a12eb5eeee3ffc1711fae8142160079e86a345a0.zip
[partitioner] partitioner adapted to work with more options in SLX_PARTITION_TABLE
-rwxr-xr-xserver/modules/partitioner/opt/openslx/scripts/partitioner15
1 files changed, 10 insertions, 5 deletions
diff --git a/server/modules/partitioner/opt/openslx/scripts/partitioner b/server/modules/partitioner/opt/openslx/scripts/partitioner
index 03e089c4..0b682dba 100755
--- a/server/modules/partitioner/opt/openslx/scripts/partitioner
+++ b/server/modules/partitioner/opt/openslx/scripts/partitioner
@@ -12,8 +12,8 @@ BLOCKSIZE=1024
. $CONFIGPATH
# testing if the sizes and ID's of the disk is defined in the config file
-
# picking disk that will be used
+
DISKS=$(cat $PARTITIONSPATH | tr -s ' ' | cut -d ' ' -f5 | grep -e "[a-z]$")
if [ -z "$DISKS" ]; then
dialog --msgbox "ERROR: Can't find an hard disk." 10 40
@@ -88,12 +88,17 @@ for PARTITION in $SLX_PARTITION_TABLE; do
if [ $COUNTER -eq 4 ]; then
COUNTER=$(($COUNTER+1))
fi
+ echo "id: $1"
PARTTBL["$SLX_CHOOSEN_DISK$COUNTER/id"]=$1
- PARTTBL["$SLX_CHOOSEN_DISK$COUNTER/size"]=$(echo $2 | egrep -o "[0-9]*")
- if [ -n $3 ]; then
- PARTTBL["$SLX_CHOOSEN_DISK$COUNTER/mountpoint"]=$3
+ shift
+ echo "size: $1"
+ PARTTBL["$SLX_CHOOSEN_DISK$COUNTER/size"]=$(echo $1 | egrep -o "[0-9]*")
+ shift
+ if [ -n $1 ]; then
+ PARTTBL["$SLX_CHOOSEN_DISK$COUNTER/mountpoint"]=$1
fi
- if [ "$4" = "bootable" ]; then
+ shift
+ if [[ "$*" == *bootable* ]]; then
PARTTBL["$SLX_CHOOSEN_DISK$COUNTER/bootable"]=1
else
PARTTBL["$SLX_CHOOSEN_DISK$COUNTER/bootable"]=0