Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
53faf2cc
Commit
53faf2cc
authored
Nov 15, 2012
by
Mike Hibler
Browse files
A "creative fix" (aka, ugly hack) for saving images on dongle-booted nodes.
parent
33f15c8e
Changes
1
Hide whitespace changes
Inline
Side-by-side
os/create-image
View file @
53faf2cc
#!/usr/bin/perl -wT
#
# Copyright (c) 2000-201
1
University of Utah and the Flux Group.
# Copyright (c) 2000-201
2
University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
...
...
@@ -149,6 +149,19 @@ if ($^O eq 'linux') {
$dunit
-=
4
if
(
$dtype
eq
'
ad
'
&&
$dunit
>
3
);
$dunit
=~
y/01234567/abcdefgh/
;
#
# XXX woeful TPM dongle-boot hack.
# If we are imaging /dev/sda and dmesg reports that
# that device is write-protected, assume it is the boot dongle
# and use /dev/sdb instead!
#
if
(
$dunit
eq
"
a
")
{
if
(
!
system
("
dmesg | fgrep -q '[sda] Write Protect is on'
"))
{
print
STDERR
"
WARNING: suspect dongle-booted node, using sdb instead of sda
\n
";
$dunit
=
"
b
";
}
}
$device
=
"
/dev/sd
$dunit
";
}
...
...
Write
Preview
Supports
Markdown
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