Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
emulab
emulab-stable
Commits
00bd3d3a
Commit
00bd3d3a
authored
Jan 27, 2005
by
Mike Hibler
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
First actual working version for SHD
parent
58ae4e74
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
13 additions
and
10 deletions
+13
-10
os/imagezip/imagezip.c
os/imagezip/imagezip.c
+7
-5
os/imagezip/shd/shd.c
os/imagezip/shd/shd.c
+2
-3
os/imagezip/shd/shd.h
os/imagezip/shd/shd.h
+4
-2
No files found.
os/imagezip/imagezip.c
View file @
00bd3d3a
...
...
@@ -445,8 +445,6 @@ main(int argc, char *argv[])
if
(
chkpointdev
)
{
#ifdef WITH_SHD
u_int32_t
ssect
=
0
;
rval
=
0
;
if
(
dorelocs
)
{
fprintf
(
stderr
,
"WARNING: no relocation info "
...
...
@@ -463,12 +461,16 @@ main(int argc, char *argv[])
struct
doslabel
doslabel
;
rval
=
read_doslabel
(
infd
,
DOSBBSECTOR
,
0
,
&
doslabel
);
if
(
rval
==
0
)
ssect
=
doslabel
.
parts
[
slice
-
1
].
dp_start
;
if
(
rval
==
0
)
{
inputminsec
=
doslabel
.
parts
[
slice
-
1
].
dp_start
;
inputmaxsec
=
inputminsec
+
doslabel
.
parts
[
slice
-
1
].
dp_size
;
}
}
if
(
rval
==
0
)
{
rval
=
read_shd
(
chkpointdev
,
infilename
,
infd
,
ssect
);
rval
=
read_shd
(
chkpointdev
,
infilename
,
infd
,
inputminsec
);
if
(
rval
==
0
)
sortrange
(
ranges
,
1
,
0
);
}
...
...
os/imagezip/shd/shd.c
View file @
00bd3d3a
...
...
@@ -25,7 +25,6 @@
#include "imagehdr.h"
#define ENTRIESPERCALL 1024
#define FAKEIT
#ifdef FAKEIT
#define SHDIOCTL fake_ioctl
...
...
@@ -79,8 +78,8 @@ read_shd(char *shddev, char *infile, int infd, u_int32_t ssect)
for
(
sr
=
sm
.
buf
;
sm
.
retsiz
>
0
;
sr
++
,
sm
.
retsiz
--
)
{
if
(
debug
>
2
)
fprintf
(
stderr
,
" %12d %9d
\n
"
,
sr
->
start
,
sr
->
size
);
addvalid
(
sr
->
start
+
ssect
,
sr
->
size
);
sr
->
start
,
(
sr
->
end
-
sr
->
start
)
);
addvalid
(
sr
->
start
+
ssect
,
(
sr
->
end
-
sr
->
start
)
);
}
sm
.
command
=
2
;
...
...
os/imagezip/shd/shd.h
View file @
00bd3d3a
...
...
@@ -3,11 +3,11 @@
* here to get everything to compile.
*/
#
define SHDGETMODIFIEDRANGES 1
/* the
ioctl
*/
#
include <sys/
ioctl
.h>
struct
shd_range
{
u_int32_t
start
;
u_int32_t
size
;
u_int32_t
end
;
};
struct
shd_modinfo
{
...
...
@@ -16,3 +16,5 @@ struct shd_modinfo {
long
bufsiz
;
/* buffer size (in entries) */
long
retsiz
;
/* size of returned data (in entries) */
};
#define SHDGETMODIFIEDRANGES _IOWR('S', 29, struct shd_modinfo)
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