Last change
on this file since 566 was
33,
checked in by zev, 17 years ago
|
r22250@galvatron: zev | 2007-07-23 00:46:21 -0400
- prelimary work on server-side installer script from before I got distracted trying to get block-attach to actually work
|
-
Property svn:executable set to
*
|
File size:
644 bytes
|
Rev | Line | |
---|
[33] | 1 | #!/usr/bin/env perl |
---|
| 2 | use warnings; |
---|
| 3 | use strict; |
---|
| 4 | |
---|
| 5 | my $subcmd = shift; |
---|
| 6 | |
---|
| 7 | my %cmds = ("install" => \&install); |
---|
| 8 | |
---|
| 9 | |
---|
| 10 | if (exists $cmds{$subcmd}) { |
---|
| 11 | $cmds{$subcmd}->(); |
---|
| 12 | } else { |
---|
| 13 | print "No such subcommand: '$subcmd'\n"; |
---|
| 14 | } |
---|
| 15 | |
---|
| 16 | sub install { |
---|
| 17 | my ($installer, $host_device) = @ARGV; |
---|
| 18 | $host_device =~ s#^/dev/##; |
---|
| 19 | my $installer_hostname = "magic"; |
---|
| 20 | my $guest_dev = $host_device; |
---|
| 21 | $guest_dev =~ tr#/#_#; |
---|
| 22 | |
---|
| 23 | run("xm", "block-attach", $installer, "phys:$host_device", "$guest_dev", "rw"); |
---|
| 24 | run("remctl", $installer_hostname, "installer", "install", $guest_dev); |
---|
| 25 | run("xm", "block-detach", $installer, $guest_dev, "rw"); |
---|
| 26 | } |
---|
| 27 | |
---|
| 28 | sub run { |
---|
| 29 | system("echo", @_); |
---|
| 30 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.