+debug, -type, -bug
Signed-off-by: Steven Armstrong <steven@icarus.ethz.ch>
This commit is contained in:
parent
cbd073dfbd
commit
16d86dcf04
1 changed files with 15 additions and 4 deletions
|
@ -61,14 +61,17 @@ available_size=
|
||||||
primary_count=0
|
primary_count=0
|
||||||
for object in $objects; do
|
for object in $objects; do
|
||||||
device="$(cat "$object/parameter/device")"
|
device="$(cat "$object/parameter/device")"
|
||||||
if [ "$current_device" != "$device" ];
|
if [ "$current_device" != "$device" ]; then
|
||||||
echo "create_disklabel $device"
|
echo "create_disklabel $device"
|
||||||
current_device="$device"
|
current_device="$device"
|
||||||
device_name=$(echo ${device} | sed -e 's:^/dev/::;s:/:\\/:g')
|
device_name=$(echo ${device} | sed -e 's:^/dev/::;s:/:\\/:g')
|
||||||
available_size=$(( $(awk "/${device_name}\$/ { print $3; }" "$partitions") / 1024))
|
available_size=$(( $(awk "/${device_name}\$/ { print \$3; }" "$partitions") / 1024))
|
||||||
# make sure we don't go past the end of the drive
|
# make sure we don't go past the end of the drive
|
||||||
available_size=$((device_size - 2))
|
available_size=$((available_size - 2))
|
||||||
primary_count=0
|
primary_count=0
|
||||||
|
debug "----- $device"
|
||||||
|
debug "current_device=$current_device"
|
||||||
|
debug "available_size=$available_size"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
type="$(cat "$object/parameter/type")"
|
type="$(cat "$object/parameter/type")"
|
||||||
|
@ -90,9 +93,17 @@ for object in $objects; do
|
||||||
fi
|
fi
|
||||||
|
|
||||||
[ "$partition_size" = "-1" ] && die "could not translate size '$size' to a usable value"
|
[ "$partition_size" = "-1" ] && die "could not translate size '$size' to a usable value"
|
||||||
|
debug "----- $partition"
|
||||||
debug "primary_count=$primary_count"
|
debug "primary_count=$primary_count"
|
||||||
debug "available_size=$available_size"
|
|
||||||
debug "current_device=$current_device"
|
debug "current_device=$current_device"
|
||||||
|
debug "device=$device"
|
||||||
|
debug "type=$type"
|
||||||
|
debug "partition=$partition"
|
||||||
|
debug "minor=$minor"
|
||||||
|
debug "bootable=$bootable"
|
||||||
|
debug "size=$size"
|
||||||
|
debug "partition_size=$partition_size"
|
||||||
|
debug "available_size=$available_size"
|
||||||
|
|
||||||
echo "create_partition $device $minor $partition_size $type $primary_count"
|
echo "create_partition $device $minor $partition_size $type $primary_count"
|
||||||
done
|
done
|
||||||
|
|
Loading…
Reference in a new issue