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
3a477018
Commit
3a477018
authored
Jan 31, 2016
by
Mike Hibler
Browse files
Rudiments of TRIM support in frisbee/imageunzip.
Consists of just a command line option right now!
parent
2f3b1c67
Changes
2
Hide whitespace changes
Inline
Side-by-side
clientside/os/imagezip/GNUmakefile.in
View file @
3a477018
#
# 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
#
...
...
@@ -42,6 +42,12 @@ WITH_RANGEMAP = 0
WITH_MBR = 1
WITH_GPT = 1
#
# Support disk erase (e.g., TRIM) operations
# (incomplete as of 1/2016)
#
WITH_ERASE = 0
#
# Support encrypted and signed-checksumed images.
# Requires openssl libraries.
...
...
clientside/os/imagezip/imageunzip.c
View file @
3a477018
/*
* 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
*
...
...
@@ -113,6 +113,7 @@ static int dostype = -1;
static
int
slice
=
0
;
static
int
debug
=
0
;
static
int
outfd
;
static
int
doerase
=
0
;
static
int
dofill
=
0
;
static
int
nothreads
=
0
;
static
int
rdycount
;
...
...
@@ -570,6 +571,7 @@ usage(void)
" -s slice Output to DOS slice (DOS numbering 1-4)
\n
"
" NOTE: Must specify a raw disk device.
\n
"
" -D DOS-ptype Set the DOS partition type in slice mode.
\n
"
" -E Erase (TRIM) free blocks where possible.
\n
"
" -z Write zeros to free blocks.
\n
"
" -p pattern Write 32 bit pattern to free blocks.
\n
"
" NOTE: Use -z/-p to avoid seeking.
\n
"
...
...
@@ -599,7 +601,7 @@ main(int argc, char *argv[])
#ifdef NOTHREADS
nothreads
=
1
;
#endif
while
((
ch
=
getopt
(
argc
,
argv
,
"vdhs:zp:oOnFD:W:Cr:Na:ck:eu:fIM:"
))
!=
-
1
)
while
((
ch
=
getopt
(
argc
,
argv
,
"vdhs:
E
zp:oOnFD:W:Cr:Na:ck:eu:fIM:"
))
!=
-
1
)
switch
(
ch
)
{
#ifdef FAKEFRISBEE
case
'F'
:
...
...
@@ -634,6 +636,14 @@ main(int argc, char *argv[])
dostype
=
(
int
)
strtoul
(
optarg
,
NULL
,
0
);
break
;
#ifdef WITH_ERASE
case
'E'
:
doerase
++
;
break
;
#else
fprintf
(
stderr
,
"Erase not supported
\n
"
);
exit
(
1
);
#endif
case
'p'
:
fillpat
=
strtoul
(
optarg
,
NULL
,
0
);
case
'z'
:
...
...
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