Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(431)

Issue 6253014: Add script to validate kernel params before we sign images (Closed)

Created:
9 years, 11 months ago by jimhebert
Modified:
9 years, 7 months ago
Reviewers:
Sumit, gauravsh, Will Drewry
CC:
chromium-os-reviews_chromium.org, Randall Spangler, Luigi Semenzato, Bill Richardson, gauravsh
Visibility:
Public.

Description

Add script to validate kernel params before we sign images Change-Id: I8ffedf8afa00862d135f80db9350927cc0332979 BUG=chrome-os-partner:1991 TEST=Have run it manually with various config data producing test-pass and the different sources of test-fails Committed: http://chrome-svn/viewvc/chromeos?view=rev&revision=d7c9e82

Patch Set 1 #

Total comments: 9

Patch Set 2 : Fixes for review feedback. #

Total comments: 5

Patch Set 3 : Fixes for nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+155 lines, -0 lines) Patch
A scripts/image_signing/ensure_secure_kernelparams.config View 1 2 1 chunk +40 lines, -0 lines 0 comments Download
A scripts/image_signing/ensure_secure_kernelparams.sh View 1 2 1 chunk +115 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
jimhebert
Thanks in advance for your review!
9 years, 11 months ago (2011-01-26 19:17:38 UTC) #1
gauravsh
http://codereview.chromium.org/6253014/diff/1/scripts/image_signing/ensure_secure_kernelparams.config File scripts/image_signing/ensure_secure_kernelparams.config (right): http://codereview.chromium.org/6253014/diff/1/scripts/image_signing/ensure_secure_kernelparams.config#newcode21 scripts/image_signing/ensure_secure_kernelparams.config:21: required_dmparams_common="vroot none ro,0 1740800 verity /dev/sd%D%P \ comment about ...
9 years, 11 months ago (2011-01-26 22:55:57 UTC) #2
jimhebert
Thanks! PTAL. Since the diff is messy (due to the main() mass-indent), I have included ...
9 years, 11 months ago (2011-01-27 21:38:22 UTC) #3
gauravsh
LGTM with some style nits. Please fix and test before submitting. http://codereview.chromium.org/6253014/diff/6001/scripts/image_signing/ensure_secure_kernelparams.config File scripts/image_signing/ensure_secure_kernelparams.config (right): ...
9 years, 11 months ago (2011-01-27 22:25:59 UTC) #4
gauravsh
9 years, 11 months ago (2011-01-27 22:27:34 UTC) #5
Also, before submitting, edit the issue description to reference the bug
correctly. It should be BUG=chrome-os-partner:1991

On 2011/01/27 21:38:22, jimhebert wrote:
> Thanks! PTAL. Since the diff is messy (due to the main() mass-indent), I
> have included notes in-line below.
> 
> On Wed, Jan 26, 2011 at 2:55 PM, <mailto:gauravsh@chromium.org> wrote:
> 
> >
> >
> >
>
http://codereview.chromium.org/6253014/diff/1/scripts/image_signing/ensure_se...
> > File scripts/image_signing/ensure_secure_kernelparams.config (right):
> >
> >
> >
>
http://codereview.chromium.org/6253014/diff/1/scripts/image_signing/ensure_se...
> > scripts/image_signing/ensure_secure_kernelparams.config:21:
> > required_dmparams_common="vroot none ro,0 1740800 verity /dev/sd%D%P \
> > comment about where do you get this parameter from? I think the 1750800
> > number is based on the rootfs size - a mention of that would be nice.
> >
> 
> Done.
> 
> 
> >
> >
> >
>
http://codereview.chromium.org/6253014/diff/1/scripts/image_signing/ensure_se...
> > File scripts/image_signing/ensure_secure_kernelparams.sh (right):
> >
> >
> >
>
http://codereview.chromium.org/6253014/diff/1/scripts/image_signing/ensure_se...
> > scripts/image_signing/ensure_secure_kernelparams.sh:3: # Copyright (c)
> > 2010 The Chromium OS Authors. All rights reserved.
> > 2011
> >
> 
> Done.
> 
> 
> >
> >
> >
>
http://codereview.chromium.org/6253014/diff/1/scripts/image_signing/ensure_se...
> > scripts/image_signing/ensure_secure_kernelparams.sh:14: echo "Usage $0
> > <image>"
> > nit: use $PROG instead of $0 (for consistency, nothing else)
> >
> 
> Done.
> 
> 
> >
> >
> >
>
http://codereview.chromium.org/6253014/diff/1/scripts/image_signing/ensure_se...
> > scripts/image_signing/ensure_secure_kernelparams.sh:19: . "$(dirname
> > "$0")/${0/%.sh/.config}"
> > the substitution is a bit cryptic. I would suggest explicitly naming the
> > expectations file here. Better yet, make the expectation file be an
> > argument (maybe, optional) to the script.
> >
> 
> Optional command-line-argument added.  Commenting added as well to help
> address the cryptic-ness of what it does in the default case.
> 
> 
> >
> >
> >
>
http://codereview.chromium.org/6253014/diff/1/scripts/image_signing/ensure_se...
> > scripts/image_signing/ensure_secure_kernelparams.sh:45: testpass=true
> > all globals should be all uppercase. if you prefer, you can encapsulate
> > the whole loop into a main() function and a "main $@" that starts off
> > the main script.
> >
> 
> I opted for main()
> 
> 
> >
> >
> >
>
http://codereview.chromium.org/6253014/diff/1/scripts/image_signing/ensure_se...
> > scripts/image_signing/ensure_secure_kernelparams.sh:53: board=$(grep
> > CHROMEOS_RELEASE_BOARD= "$rootfs/etc/lsb-release" | \
> > Note that this will not work on an already signed image since we change
> > the release board then. (x86-mario may become x86-mario-pvtkeys etc.)
> >
> 
> Fixed. It meant that cut | tr got replaced with sed but I added a comment to
> mitigate any cryptic-ness that brought on.
> 
> 
> 
> >
> >
> >
>
http://codereview.chromium.org/6253014/diff/1/scripts/image_signing/ensure_se...
> > scripts/image_signing/ensure_secure_kernelparams.sh:60:
> > kparams="$(dump_kernel_config "$kernelblob")"
> > nit: i think you probably don't need the extra quotes around $(). There
> > is an unofficial chrome os sh style guide which talks about avoid
> > excessive quoting. Can't seem to find it now.
> >
> 
> Good feedback, I cleaned up several cases of this throughout the script.
> 
> 
> >
> >
> >
>
http://codereview.chromium.org/6253014/diff/1/scripts/image_signing/ensure_se...
> > scripts/image_signing/ensure_secure_kernelparams.sh:73: for param in
> > ${required_kparams[@]}; do :
> > probably not a very big deal - but how will this handle changes in the
> > order of individual params, or repetitions. I am not sure is there are
> > kernel options like that - where order matters.
> >
> 
> Yeah I had the same thought and the same conclusion that I don't think it
> will come up.
> 
> The closest thing I can see (order matters inside the dm="..." values) is
> covered by it being special cased.
> 
> 
> 
> >
> >
> >
>
http://codereview.chromium.org/6253014/diff/1/scripts/image_signing/ensure_se...
> > scripts/image_signing/ensure_secure_kernelparams.sh:96: if $testpass;
> > then
> > instead of testpass, you could just use testfail=0 in the beginning, and
> > set it to 1 when a failure occurs.
> >
> > then here, simply exit $testfail
> 
> 
> Done - thanks!
> 
> 
> >
> >
> > http://codereview.chromium.org/6253014/
> >

Powered by Google App Engine
This is Rietveld 408576698