ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/Linux-NBD/bin/attach-bincue
(Generate patch)

Comparing Linux-NBD/bin/attach-bincue (file contents):
Revision 1.3 by root, Tue May 20 18:13:09 2003 UTC vs.
Revision 1.4 by root, Fri Jun 6 08:26:57 2003 UTC

12 12
13my $device = undef; 13my $device = undef;
14my $image = undef; 14my $image = undef;
15my $offset = undef; 15my $offset = undef;
16my $size = undef; 16my $size = undef;
17my $mount = undef;
17my $verbose = 0; 18my $verbose = 0;
18 19
19GetOptions ( 20GetOptions (
20 "device|d=s" => \$device, 21 "device|d=s" => \$device,
21 "image|i=s" => \$image, 22 "image|i=s" => \$image,
22 "offset|o=i" => \$offset, 23 "offset|o=i" => \$offset,
23 "size|s=i" => \$size, 24 "size|s=i" => \$size,
24 "verbose|v" => \$verbose, 25 "verbose|v" => \$verbose,
26 "mount|m=s" => \$mount,
25 "help|h|?" => sub { 27 "help|h|?" => sub {
26 require Pod::Usage; 28 require Pod::Usage;
27 Pod::Usage::pod2usage(-exitstatus => 0, verbose => 2); 29 Pod::Usage::pod2usage(-exitstatus => 0, verbose => 2);
28 }, 30 },
29) or exit 1; 31) or exit 1;
74 $client->socket($a); 76 $client->socket($a);
75 $client->run_async; 77 $client->run_async;
76 78
77 $device = $client->device; 79 $device = $client->device;
78 80
81 if (defined $mount) {
82 print "Running mount (you have to unmount yourself)\n";
83 exec "mount", "-tiso9660", "-oro", $device, $mount
84 if fork == 0;
85 print "Everything set up, starting server\n";
86 } else {
79 print <<EOF; 87 print <<EOF;
80 88
81 Everything seems to be set up now, try something like: 89 Everything seems to be set up now, try something like:
82 90
83 mount -tiso9660 $device /mnt 91 mount -tiso9660 $device /mnt
84 92
85 Press ^C to exit... 93 Press ^C to exit...
86EOF 94EOF
95 }
87 96
88 # now create a server instance and handle 97 # now create a server instance and handle
89 # the requests. 98 # the requests.
90 99
91 my $server = Server->new(socket => $b); 100 my $server = Server->new(socket => $b);
92 $server->run; 101 $server->run;
102 # never returns
93} 103}
94 104
95BEGIN { 105BEGIN {
96 @Server::ISA = Linux::NBD::Server::; 106 @Server::ISA = Linux::NBD::Server::;
97}; 107};
131 141
132attach-bincue - attach a .bin (cdrom image) containing an iso9660 fs to nbd 142attach-bincue - attach a .bin (cdrom image) containing an iso9660 fs to nbd
133 143
134=head1 SYNOPSIS 144=head1 SYNOPSIS
135 145
136 attach-bincue -i iso9660.bin & # start server 146 attach-bincue -i iso9660.bin -m /mnt & # start server
137 mount -tiso9660 /dev/ndx /mnt
138 147
139 # kill server 148 # kill server
140 umount /mnt 149 umount /mnt
141 attach-bincue -d /dev/ndx # disconnect server 150 attach-bincue -d /dev/ndx # disconnect server
142 151
173 182
174=item --verbose 183=item --verbose
175 184
176Increase verbosity. With this switch, read requests will be logged to stdout. 185Increase verbosity. With this switch, read requests will be logged to stdout.
177 186
187=item --mount path
188
189Try to mount the CD as iso image on the given path.
190
178=back 191=back
179 192
180=head1 EXAMPLES 193=head1 EXAMPLES
181 194
182Common combinations of offset and blocksize 195Common combinations of offset and blocksize

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines