summaryrefslogtreecommitdiff
path: root/utility/vbutil_kernel.c
diff options
context:
space:
mode:
authorvbendeb <vbendeb@chromium.org>2010-10-21 13:46:16 -0700
committervbendeb <vbendeb@chromium.org>2010-10-21 13:46:16 -0700
commit00b9088fb25c0be9132a4fc342a137df88ff74a4 (patch)
treebb8e35e4cc47a03a270e5cfbae241867bf6301aa /utility/vbutil_kernel.c
parenteb868eeb1d2eb15d99eaa0625521c418472e8baa (diff)
downloadvboot-00b9088fb25c0be9132a4fc342a137df88ff74a4.tar.gz
Consider zero a valid kernel version.
SAFT testing requires changing kernel version to one level below the current value (set to 1). This change allows version number set to zero for test purposes. Change-Id: Ia6f11578d9a6bc8c5544c56413c5589011d6334a BUG=chromium-os:1976 TEST=manual Ran `vbutil_kernel --repack --version 0 <other params>' it used to fail, now it succeeds. This is also verified by using in http://codereview.chromium.org/3781016 to support TPM testing. Review URL: http://codereview.chromium.org/3968006
Diffstat (limited to 'utility/vbutil_kernel.c')
-rw-r--r--utility/vbutil_kernel.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/utility/vbutil_kernel.c b/utility/vbutil_kernel.c
index 23b6eb2f..cb476818 100644
--- a/utility/vbutil_kernel.c
+++ b/utility/vbutil_kernel.c
@@ -750,7 +750,7 @@ int main(int argc, char* argv[]) {
char* key_block_file = NULL;
char* signpubkey = NULL;
char* signprivate = NULL;
- uint64_t version = 0;
+ int version = -1;
char* vmlinuz = NULL;
char* bootloader = NULL;
char* config_file = NULL;
@@ -862,7 +862,7 @@ int main(int argc, char* argv[]) {
return r;
case OPT_MODE_REPACK:
- if (!config_file && !key_block_file && !version) {
+ if (!config_file && !key_block_file && (version<0)) {
fprintf(stderr,
"You must supply at least one of "
"--config, --keyblock or --version\n");
@@ -874,8 +874,8 @@ int main(int argc, char* argv[]) {
return 1;
r = ReplaceConfig(bp, config_file);
if (!r) {
- if (version) {
- bp->kernel_version = version;
+ if (version >= 0) {
+ bp->kernel_version = (uint64_t) version;
}
r = Pack(filename, key_block_file, signprivate, bp, pad, vblockonly);
}