Commit 53faf2cc authored by Mike Hibler's avatar Mike Hibler

A "creative fix" (aka, ugly hack) for saving images on dongle-booted nodes.

parent 33f15c8e
#!/usr/bin/perl -wT
#
# Copyright (c) 2000-2011 University of Utah and the Flux Group.
# Copyright (c) 2000-2012 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";
}
......
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