Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
emulab-devel
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
143
Issues
143
List
Boards
Labels
Service Desk
Milestones
Merge Requests
6
Merge Requests
6
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
emulab
emulab-devel
Commits
f070f698
Commit
f070f698
authored
Mar 19, 2016
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow call to ask for the delta image instead of the full image.
parent
48a4dfcd
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
7 deletions
+19
-7
utils/spewimage.in
utils/spewimage.in
+17
-7
www/spewimage.php
www/spewimage.php
+2
-0
No files found.
utils/spewimage.in
View file @
f070f698
#!/usr/bin/perl -wT
#!/usr/bin/perl -wT
#
#
# Copyright (c) 2000-201
5
University of Utah and the Flux Group.
# Copyright (c) 2000-201
6
University of Utah and the Flux Group.
#
#
# {{{EMULAB-LICENSE
# {{{EMULAB-LICENSE
#
#
...
@@ -34,14 +34,15 @@ use POSIX qw(mktime strftime);
...
@@ -34,14 +34,15 @@ use POSIX qw(mktime strftime);
sub
usage
()
sub
usage
()
{
{
print
STDERR
print
STDERR
"
Usage: spewimage [-h] [-t timestamp] -k access_key <imageid>
\n
"
.
"
Usage: spewimage [-h] [-t timestamp]
[-e]
-k access_key <imageid>
\n
"
.
"
Spew an image file to a (widearea) node.
\n
";
"
Spew an image file to a (widearea) node.
\n
";
exit
(
-
1
);
exit
(
-
1
);
}
}
my
$optlist
=
"
t:k:hsd
";
my
$optlist
=
"
t:k:hsd
e
";
my
$debug
=
0
;
my
$debug
=
0
;
my
$headonly
=
0
;
my
$headonly
=
0
;
my
$sigfile
=
0
;
my
$sigfile
=
0
;
my
$delta
=
0
;
my
$access_key
;
my
$access_key
;
my
$timestamp
;
# GM Time.
my
$timestamp
;
# GM Time.
...
@@ -102,6 +103,9 @@ if (defined($options{"h"})) {
...
@@ -102,6 +103,9 @@ if (defined($options{"h"})) {
if
(
defined
(
$options
{"
d
"}))
{
if
(
defined
(
$options
{"
d
"}))
{
$debug
=
1
;
$debug
=
1
;
}
}
if
(
defined
(
$options
{"
e
"}))
{
$delta
=
1
;
}
if
(
defined
(
$options
{"
s
"}))
{
if
(
defined
(
$options
{"
s
"}))
{
$sigfile
=
1
;
$sigfile
=
1
;
}
}
...
@@ -147,8 +151,11 @@ exit(0);
...
@@ -147,8 +151,11 @@ exit(0);
#
#
sub
SpewImage
()
sub
SpewImage
()
{
{
my
$file
=
(
$sigfile
?
my
$file
=
(
$delta
?
$image
->
FullImageSigFile
()
:
$image
->
FullImageFile
());
(
$sigfile
?
$image
->
DeltaImageSigFile
()
:
$image
->
DeltaImageFile
())
:
(
$sigfile
?
$image
->
FullImageSigFile
()
:
$image
->
FullImageFile
()));
open
(
FD
,
"
<
$file
")
open
(
FD
,
"
<
$file
")
or
fatal
("
Could not open
$file
!
\n
");
or
fatal
("
Could not open
$file
!
\n
");
...
@@ -212,8 +219,11 @@ sub VerifyImage()
...
@@ -212,8 +219,11 @@ sub VerifyImage()
# The current user needs to be able to read the image file and must
# The current user needs to be able to read the image file and must
# have provided proper access key.
# have provided proper access key.
#
#
my
$file
=
(
$sigfile
?
my
$file
=
(
$delta
?
$image
->
FullImageSigFile
()
:
$image
->
FullImageFile
());
(
$sigfile
?
$image
->
DeltaImageSigFile
()
:
$image
->
DeltaImageFile
())
:
(
$sigfile
?
$image
->
FullImageSigFile
()
:
$image
->
FullImageFile
()));
if
(
!
-
r
$file
)
{
if
(
!
-
r
$file
)
{
if
(
$debug
)
{
if
(
$debug
)
{
...
...
www/spewimage.php
View file @
f070f698
...
@@ -54,6 +54,7 @@ if (!isset($_SERVER["SSL_PROTOCOL"])) {
...
@@ -54,6 +54,7 @@ if (!isset($_SERVER["SSL_PROTOCOL"])) {
$reqargs
=
RequiredPageArguments
(
"image"
,
PAGEARG_IMAGE
,
$reqargs
=
RequiredPageArguments
(
"image"
,
PAGEARG_IMAGE
,
"access_key"
,
PAGEARG_STRING
);
"access_key"
,
PAGEARG_STRING
);
$optargs
=
OptionalPageArguments
(
"stamp"
,
PAGEARG_INTEGER
,
$optargs
=
OptionalPageArguments
(
"stamp"
,
PAGEARG_INTEGER
,
"delta"
,
PAGEARG_BOOLEAN
,
"sigfile"
,
PAGEARG_BOOLEAN
);
"sigfile"
,
PAGEARG_BOOLEAN
);
#
#
...
@@ -84,6 +85,7 @@ $access_key = escapeshellarg($access_key);
...
@@ -84,6 +85,7 @@ $access_key = escapeshellarg($access_key);
$arg
=
""
;
$arg
=
""
;
$arg
.
=
(
isset
(
$stamp
)
?
"-t "
.
escapeshellarg
(
$stamp
)
:
""
);
$arg
.
=
(
isset
(
$stamp
)
?
"-t "
.
escapeshellarg
(
$stamp
)
:
""
);
$arg
.
=
(
isset
(
$sigfile
)
&&
$sigfile
?
"-s "
:
""
);
$arg
.
=
(
isset
(
$sigfile
)
&&
$sigfile
?
"-s "
:
""
);
$arg
.
=
(
isset
(
$delta
)
&&
$delta
?
"-e "
:
""
);
$group
=
$image
->
Group
();
$group
=
$image
->
Group
();
$pid
=
$group
->
pid
();
$pid
=
$group
->
pid
();
$unix_gid
=
$group
->
unix_gid
();
$unix_gid
=
$group
->
unix_gid
();
...
...
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