Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emulab
emulab-devel
Commits
280f4177
Commit
280f4177
authored
Dec 14, 2008
by
Ryan Jackson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Changes to make these work under busybox
parent
4ffacdc3
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
28 additions
and
6 deletions
+28
-6
tmcd/linux/guess_linux_root_device
tmcd/linux/guess_linux_root_device
+18
-4
tmcd/linux/remap_ide_disks
tmcd/linux/remap_ide_disks
+10
-2
No files found.
tmcd/linux/guess_linux_root_device
View file @
280f4177
...
...
@@ -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
}
...
...
tmcd/linux/remap_ide_disks
View file @
280f4177
...
...
@@ -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
%% *
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment