Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
emulab
emulab-devel
Commits
00bd3d3a
Commit
00bd3d3a
authored
Jan 27, 2005
by
Mike Hibler
Browse files
First actual working version for SHD
parent
58ae4e74
Changes
3
Hide whitespace changes
Inline
Side-by-side
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
Supports
Markdown
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