diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-02-24 15:19:13 -0800 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2009-02-24 15:19:13 -0800 |
commit | ed5fa7ec69c0e2261277b3ac7685efa0d61ac9e8 (patch) | |
tree | 1ebfa9a75c31e9191394ed6ee1e1891fe00dc91f /scripts | |
parent | b8e824c216ce84d302630f34fa916483ac94c394 (diff) | |
download | vyatta-cfg-quagga-ed5fa7ec69c0e2261277b3ac7685efa0d61ac9e8.tar.gz vyatta-cfg-quagga-ed5fa7ec69c0e2261277b3ac7685efa0d61ac9e8.zip |
Don't depend on /proc/ide
/proc/ide doesn't exist in all configs, and it doesn't work correctly
with KVM and other buggy virtualized ide.
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/install-system | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/scripts/install-system b/scripts/install-system index 7fee5210..e9459538 100755 --- a/scripts/install-system +++ b/scripts/install-system @@ -173,23 +173,19 @@ get_drive_size () { # Probe hardrives not shown in /proc/partitions by default probe_drives () { - # find IDE drives. Not all drives show up in /proc/partitions for - # some reason. - # TODO: not sure we have to do this for anything but compact flash - # when we test on other platforms, we will find out and modify this section - # as appropriate - drive=$(find /proc/ide/ide* -name "hd*" 2>/dev/null | /usr/bin/awk -F"/" '{ print $5 }') - - # now exclude all drives but disks + # Find drives that may not be in /proc/partitions since not mounted + drive=$(ls /sys/block | grep '[hsv]d.') + + # now exclude all drives that are read-only for drive in $drive do - media=$(cat /proc/ide/$drive/media) - if [ "$media" = "disk" ]; then - output=$(mount | grep $drive) - if [ -z "$output" ]; then - output=$(parted /dev/$DRIVE p) + if [ $(cat /sys/block/$drive/ro) -ne 0 ] + then + output=$(mount | grep $drive) + if [ -z "$output" ]; then + output=$(parted /dev/$drive p) + fi fi - fi done } |