From a2676136aa7dfc0551f4e30ba3360c4cf88ec6f0 Mon Sep 17 00:00:00 2001 From: Vincent R Date: Fri, 5 Mar 2010 19:36:00 +0100 Subject: support virtio blockdevices --- src/core/libs/lib-blockdevices-filesystems.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/libs/lib-blockdevices-filesystems.sh b/src/core/libs/lib-blockdevices-filesystems.sh index 85f846c..c0fe3ad 100644 --- a/src/core/libs/lib-blockdevices-filesystems.sh +++ b/src/core/libs/lib-blockdevices-filesystems.sh @@ -141,8 +141,8 @@ finddisks() { [ "$2" ] && echo $2 fi done - #scsi/sata devices - for dev in $(ls | egrep '^sd'); do + #scsi/sata devices, and virtio blockdevices (/dev/vd*) + for dev in $(ls | egrep '^[sv]d'); do # TODO: what is the significance of 5? ASKDEV if ! [ "$(cat $dev/device/type)" = "5" ]; then echo -n "/dev/$dev$3" -- cgit v1.2.3-54-g00ecf From ec4ea774231668bf5a78afb8b6ec2cc94b75e1c6 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Fri, 5 Mar 2010 19:49:43 +0100 Subject: remove /etc from suggested list of mountpoints as thats a bad idea + add /var as suggested item. fixes FS#17136 --- src/core/libs/lib-ui-interactive.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index 8a66522..5aedda2 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -452,7 +452,7 @@ interactive_filesystem () then default=no [ -n "$fs_mountpoint" ] && default="$fs_mountpoint" - ask_option $default "Select the mountpoint" "Select a mountpoint for $part" required / 'root' /boot 'files for booting' /etc 'config files' /home 'home directories' /tmp 'temporary files' custom 'enter a custom mountpoint' || return 1 + ask_option $default "Select the mountpoint" "Select a mountpoint for $part" required / 'root' /boot 'files for booting' /home 'home directories' /var 'variable files' /tmp 'temporary files' custom 'enter a custom mountpoint' || return 1 fs_mountpoint=$ANSWER_OPTION [ "$default" == 'no' ] && default= if [ "$ANSWER_OPTION" == custom ] -- cgit v1.2.3-54-g00ecf From 528ebe9f23bb78ed20f4a87ec2d5c92c12fe16fa Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Fri, 5 Mar 2010 21:07:00 +0100 Subject: fix ask_string api doc --- src/core/libs/lib-ui.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/libs/lib-ui.sh b/src/core/libs/lib-ui.sh index 5a8140f..0f04fcb 100644 --- a/src/core/libs/lib-ui.sh +++ b/src/core/libs/lib-ui.sh @@ -249,7 +249,7 @@ ask_password () # $1 question # $2 default (optional) # $3 exitcode to use when string is empty and there was no default, or default was ignored (1 default) -# echo's the string the user gave. +# Sets $ANSWER_STRING to response. # returns 1 if the user cancelled, 0 otherwise ask_string () { -- cgit v1.2.3-54-g00ecf From b7a87de6512d3864b4b6dec5b0a6f91fc832e131 Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Fri, 5 Mar 2010 21:08:55 +0100 Subject: fix + crashfix when no disks found --- src/core/libs/lib-ui-interactive.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index 5aedda2..9ee8668 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -242,10 +242,13 @@ interactive_autoprepare() notify "Available Disks:\n\n$(_getavaildisks)\n" ask_option no 'Harddrive selection' "Select the hard drive to use" required $(finddisks 1 _) || return 1 DISC=$ANSWER_OPTION + elif [ -z "$DISCS" ]; then + ask_string "Could not find disk. Please enter path of devicefile manually" "" || return 1 + DISC=$ANSWER_STRING else DISC=$DISCS fi - + # TODO : some checks if $DISC is really a blockdevice is probably a good idea DISC=${DISC// /} # strip all whitespace. we need this for some reason.TODO: find out why get_blockdevice_size $DISC MiB @@ -910,7 +913,7 @@ interactive_grub() { DEVS=$(finddisks 1 _) DEVS="$DEVS $(findpartitions 1 _)" - if [ "$DEVS" = "" ]; then + if [ "$DEVS" = " " ]; then notify "No hard drives were found" return 1 fi -- cgit v1.2.3-54-g00ecf From 7075c72e1ef816a74eba379ea5450293a60f9f1d Mon Sep 17 00:00:00 2001 From: Dieter Plaetinck Date: Fri, 5 Mar 2010 21:41:23 +0100 Subject: fix for crashing when it cannot find packages to let user select from. fixes FS#15906 --- src/core/libs/lib-ui-interactive.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/src/core/libs/lib-ui-interactive.sh b/src/core/libs/lib-ui-interactive.sh index 9ee8668..e53966e 100644 --- a/src/core/libs/lib-ui-interactive.sh +++ b/src/core/libs/lib-ui-interactive.sh @@ -770,6 +770,7 @@ Note that right now the packages (and groups) selection is limited to the repos # sort by group _pkglist="$(echo "$_pkglist" | sort -f -k 2)" + [ -z "$_pkglist" ] && show_warning "No packages found" "Sorry. I could not find any packages. maybe your network is not setup correctly, you lost connection, no mirror setup, bad group, ..." && return 1 ask_checklist "Select Packages To Install." $_pkglist || return 1 var_TARGET_PACKAGES=$ANSWER_CHECKLIST # contains now all package names -- cgit v1.2.3-54-g00ecf From aa80222dfd8b99da392236d139517076b3292cf6 Mon Sep 17 00:00:00 2001 From: Mark Pustjens Date: Fri, 5 Mar 2010 22:19:41 +0100 Subject: add the `-D' option to the sfdisk call. This causes some extra space to be saved for the MBR, which is needed for grub2 in some cases. http://www.mail-archive.com/arch-general@archlinux.org/msg11100.html --- src/core/libs/lib-blockdevices-filesystems.sh | 2 +- tests/runtime/automatic-reuse-fs-sda/install.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/libs/lib-blockdevices-filesystems.sh b/src/core/libs/lib-blockdevices-filesystems.sh index c0fe3ad..e6227b9 100644 --- a/src/core/libs/lib-blockdevices-filesystems.sh +++ b/src/core/libs/lib-blockdevices-filesystems.sh @@ -368,7 +368,7 @@ partition() # invoke sfdisk debug 'FS' "Partition calls: sfdisk $DEVICE -uM >$LOG 2>&1 <<< $sfdisk_input" printk off - sfdisk $DEVICE -uM >$LOG 2>&1 <$LOG 2>&1 < Date: Fri, 5 Mar 2010 22:41:41 +0100 Subject: try to use UUID in fstab. fixes FS#17632 - [uuid support] regression in /etc/fstab --- src/core/libs/lib-blockdevices-filesystems.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/libs/lib-blockdevices-filesystems.sh b/src/core/libs/lib-blockdevices-filesystems.sh index e6227b9..841ccf4 100644 --- a/src/core/libs/lib-blockdevices-filesystems.sh +++ b/src/core/libs/lib-blockdevices-filesystems.sh @@ -763,10 +763,12 @@ process_filesystem () local _uuid="$(getuuid $part)" if [ -n "${_uuid}" ]; then _device="UUID=${_uuid}" + else + _device=$part fi - if ! grep -q "$part $fs_mountpoint $fs_type defaults 0 " $TMP_FSTAB 2>/dev/null #$TMP_FSTAB may not exist yet + if ! grep -q "$_device $fs_mountpoint $fs_type defaults 0 " $TMP_FSTAB 2>/dev/null #$TMP_FSTAB may not exist yet then - echo -n "$part $fs_mountpoint $fs_type defaults 0 " >> $TMP_FSTAB + echo -n "$_device $fs_mountpoint $fs_type defaults 0 " >> $TMP_FSTAB if [ "$fs_type" = "swap" ]; then echo "0" >>$TMP_FSTAB else -- cgit v1.2.3-54-g00ecf