Commit 280f4177 authored by Ryan Jackson's avatar Ryan Jackson

Changes to make these work under busybox

parent 4ffacdc3
......@@ -22,20 +22,34 @@ is_label_or_uuid()
get_label()
{
local disk="$1"
local label=''
[ -x /lib/udev/vol_id ] || return 1
if [ -x /lib/udev/vol_id ]; then
label=`/lib/udev/vol_id --label-raw $disk`
elif [ -x /sbin/blkid ]; then
label=`/sbin/blkid | \
sed -n "s;^$disk"': *.*LABEL="\([^"]*\)".*;\1;p'`
else
return 1
fi
label=`/lib/udev/vol_id --label-raw $disk`
[ -n "$label" ] && echo LABEL=$label
}
get_uuid()
{
local disk="$1"
local uuid=''
[ -x /lib/udev/vol_id ] || return 1
if [ -x /lib/udev/vol_id ]; then
uuid=`/lib/udev/vol_id --uuid-raw $disk`
elif [ -x /sbin/blkid ]; then
uuid=`/sbin/blkid | \
sed -n "s;^$disk"': *.*UUID="\([^"]*\)".*;\1;p'`
else
return 1
fi
uuid=`/lib/udev/vol_id --uuid $disk`
[ -n "$uuid" ] && echo UUID=$uuid
}
......
......@@ -52,7 +52,11 @@ sd_to_hd_map() {
for host in $pata_controllers; do
host_num=${host##*host}
target=$host/target$host_num:0:0/$host_num:0:0:0
if [ -d $target/block ]; then
if [ -e $target/block:* ]; then
scsi_disk=`ls -d $target/block:*`
scsi_disk=${scsi_disk##*:}
echo $scsi_disk=hd${ide_disks%% *}
elif [ -d $target/block ]; then
scsi_disk=`ls -d $target/block/*`
scsi_disk=${scsi_disk##*/}
echo $scsi_disk=hd${ide_disks%% *}
......@@ -60,7 +64,11 @@ sd_to_hd_map() {
ide_disks=${ide_disks#* }
target=$host/target$host_num:0:1/$host_num:0:1:0
if [ -d $target/block ]; then
if [ -e $target/block:* ]; then
scsi_disk=`ls -d $target/block:*`
scsi_disk=${scsi_disk##*:}
echo $scsi_disk=hd${ide_disks%% *}
elif [ -d $target/block ]; then
scsi_disk=`ls -d $target/block/*`
scsi_disk=${scsi_disk##*/}
echo $scsi_disk=hd${ide_disks%% *}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment