From a12eb5eeee3ffc1711fae8142160079e86a345a0 Mon Sep 17 00:00:00 2001 From: Lucas Affonso Xavier de Morais Date: Fri, 5 Sep 2014 12:28:43 -0300 Subject: [partitioner] partitioner adapted to work with more options in SLX_PARTITION_TABLE --- .../modules/partitioner/opt/openslx/scripts/partitioner | 15 ++++++++++----- 1 file 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 -- cgit v1.2.3-55-g7522