Add more logic in finding a suitable install disk.

Turns out hardcoding sda as install disk breaks for example in some
IBM bladecenter models, because sda is the CDROM.
ksolomko/vlan
Andreas Granig 13 years ago
parent 23ef82bbce
commit d5e46a6d3d

@ -61,8 +61,17 @@ STATUS_WAIT=0
if [ -L /sys/block/vda ] ; then if [ -L /sys/block/vda ] ; then
export DISK=vda # will be configured as /dev/vda export DISK=vda # will be configured as /dev/vda
else else
export DISK=sda # will be configured as /dev/sda # in some cases, sda is not the HDD, but the CDROM,
# so better walk through all devices.
for i in /sys/block/sd*; do
if grep -q 0 ${i}/removable; then
export DISK=$(basename $i)
break
fi fi
done
fi
test -z "${DISK}"
&& die "Error: No non-removable disk suitable for installation found"
### helper functions {{{ ### helper functions {{{

Loading…
Cancel
Save