Josh Triplett wrote:
> If the user has only one disk, and chooses to do guided partitioning,
> then they have to choose which of their one disk they want to partition.
> The very next question (for the partitioning scheme) then confirms this
> by saying "Selected for partitioning:" followed by the exact name asked
> for in the previous question.  The following question then confirms the
> generated partitioning scheme (and displays the exact disk name again),
> and the question after that confirms one more time that the user wants
> to write the changes to the disk.  Thus, I think it seems entirely safe
> to default to the one-and-only disk if no other disk exists, given that
> the user will still get multiple chances to review and confirm their
> choice.

FWIW, I tend to agree with this reasoning. It think it's likely that the
current situation is a historical accident. It may be a vestigial organ
from the time when partman did not include RAID and LVM setup, or from
before udev and /sys were used to determine human readable device names.

Patch attached (untested) & committed to people/joey branch.

-- 
see shy jo
commit 28874286bb690e8a3d48954c60031623acbbfb8a
Author: Joey Hess <j...@kitenet.net>
Date:   Sun Feb 6 14:04:10 2011 -0400

    bypass select_disk prompt when there is only one disk

diff --git a/lib/auto-shared.sh b/lib/auto-shared.sh
index 3d9e66a..b3fc054 100644
--- a/lib/auto-shared.sh
+++ b/lib/auto-shared.sh
@@ -236,6 +236,12 @@ select_auto_disk() {
 
        DEVS=$(get_auto_disks)
        [ -n "$DEVS" ] || return 1
+       if ! echo "$DEVS" | grep -q '[[:space:]]'; then
+               # only one choice
+               db_set partman-auto/select_disk "$DEVS"
+               echo "$DEVS"
+               return 0
+       fi
        debconf_select critical partman-auto/select_disk "$DEVS" "" || return 1
        echo "$RET"
        return 0

Attachment: signature.asc
Description: Digital signature

Reply via email to