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
cbe641a1
Commit
cbe641a1
authored
Apr 23, 2015
by
Leigh B Stoller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add option to get the sig file for an image instead of the ndz file.
parent
c959bc9d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
6 deletions
+16
-6
utils/spewimage.in
utils/spewimage.in
+10
-3
www/spewimage.php
www/spewimage.php
+6
-3
No files found.
utils/spewimage.in
View file @
cbe641a1
#!/usr/bin/perl -wT
#
# Copyright (c) 2000-201
3
University of Utah and the Flux Group.
# Copyright (c) 2000-201
5
University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
...
...
@@ -38,9 +38,10 @@ sub usage()
"
Spew an image file to a (widearea) node.
\n
";
exit
(
-
1
);
}
my
$optlist
=
"
t:k:h
";
my
$optlist
=
"
t:k:h
s
";
my
$debug
=
0
;
my
$headonly
=
0
;
my
$sigfile
=
0
;
my
$access_key
;
my
$timestamp
;
# GM Time.
...
...
@@ -98,6 +99,9 @@ if (! getopts($optlist, \%options)) {
if
(
defined
(
$options
{"
h
"}))
{
$headonly
=
1
;
}
if
(
defined
(
$options
{"
s
"}))
{
$sigfile
=
1
;
}
if
(
defined
(
$options
{"
k
"}))
{
$access_key
=
$options
{"
k
"};
...
...
@@ -141,7 +145,8 @@ exit(0);
sub
SpewImage
()
{
my
$file
=
$image
->
path
();
$file
.=
"
.sig
"
if
(
$sigfile
);
open
(
FD
,
"
<
$file
")
or
fatal
("
Could not open
$file
!
\n
");
...
...
@@ -205,6 +210,8 @@ sub VerifyImage()
# have provided proper access key.
#
my
$file
=
$image
->
path
();
$file
.=
"
.sig
"
if
(
$sigfile
);
if
(
!
-
r
$file
)
{
if
(
$debug
)
{
print
STDERR
"
Cannot read
$file
\n
";
...
...
www/spewimage.php
View file @
cbe641a1
<?php
#
# Copyright (c) 2003-201
4
University of Utah and the Flux Group.
# Copyright (c) 2003-201
5
University of Utah and the Flux Group.
#
# {{{EMULAB-LICENSE
#
...
...
@@ -53,7 +53,8 @@ if (!isset($_SERVER["SSL_PROTOCOL"])) {
#
$reqargs
=
RequiredPageArguments
(
"image"
,
PAGEARG_IMAGE
,
"access_key"
,
PAGEARG_STRING
);
$optargs
=
OptionalPageArguments
(
"stamp"
,
PAGEARG_INTEGER
);
$optargs
=
OptionalPageArguments
(
"stamp"
,
PAGEARG_INTEGER
,
"sigfile"
,
PAGEARG_BOOLEAN
);
#
# A cleanup function to keep the child from becoming a zombie, since
...
...
@@ -80,7 +81,9 @@ register_shutdown_function("SPEWCLEANUP");
$imageid
=
$image
->
imageid
();
$versid
=
$image
->
versid
();
$access_key
=
escapeshellarg
(
$access_key
);
$arg
=
(
isset
(
$stamp
)
?
"-t "
.
escapeshellarg
(
$stamp
)
:
""
);
$arg
=
""
;
$arg
.
=
(
isset
(
$stamp
)
?
"-t "
.
escapeshellarg
(
$stamp
)
:
""
);
$arg
.
=
(
isset
(
$sigfile
)
&&
$sigfile
?
"-s "
:
""
);
$group
=
$image
->
Group
();
$pid
=
$group
->
pid
();
$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