diff options
author | Dieter Plaetinck <dieter@plaetinck.be> | 2010-12-12 18:11:39 +0100 |
---|---|---|
committer | Dieter Plaetinck <dieter@plaetinck.be> | 2010-12-12 18:47:13 +0100 |
commit | 180fc3f5ac6952725e3be153f3f6b2dcc6f2ea3a (patch) | |
tree | 73abad758b1e3e1a180bfe9d6f90126dcce44f89 /src/core/libs/lib-ui.sh | |
parent | 71f1288b0641740b6f6c6cc6b2cf8e5308caf51c (diff) |
clean up disk selection dialogs
instead of first showing a nice overview with disk sizes, and then
making the user select a disk from a dry list, we now do both at once
Diffstat (limited to 'src/core/libs/lib-ui.sh')
-rw-r--r-- | src/core/libs/lib-ui.sh | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/core/libs/lib-ui.sh b/src/core/libs/lib-ui.sh index 8b886fe..f31031a 100644 --- a/src/core/libs/lib-ui.sh +++ b/src/core/libs/lib-ui.sh @@ -37,17 +37,17 @@ printk() } -# TODO: pass disks as argument to decouple backend logic -# Get a list of available disks for use in the "Available disks" dialogs. -# Something like: -# /dev/sda: 640133 MiB (640 GiB) -# /dev/sdb: 640135 MiB (640 GiB) -_getavaildisks() +# Get a list of available partionable blockdevices for use in ask_option +# populates $BLOCKFRIENDLY with entries like: +# /dev/sda /dev/sda_640133_MiB_(640_GiB) +listblockfriendly() { + BLOCKFRIENDLY= for i in $(finddisks) do get_blockdevice_size $i MiB - echo "$i: $BLOCKDEVICE_SIZE MiB ($(($BLOCKDEVICE_SIZE/2**10)) GiB)\n" + [ -n "$BLOCKFRIENDLY" ] && BLOCKFRIENDLY="$BLOCKFRIENDLY " + BLOCKFRIENDLY="$BLOCKFRIENDLY$i ${i}_${BLOCKDEVICE_SIZE}_MiB_($(($BLOCKDEVICE_SIZE/2**10))_GiB)" done } |