Modifying the kernel_utility tool to create our magic blob.

For the --generate operation, the --in <file> option is gone and there are
three new required options:

  --vmlinuz <file>         Embedded kernel image
  --config <file>          Embedded kernel command-line parameters
  --bootloader <file>      Embedded bootloader stub

This takes the specified kernel, extracts the 32-bit component, and combines
that with the configuration file (essentially just the kernel cmdline
string) and the bootstub image . The resulting blob is signed and ready to
put in a kernel partition.

There's also an optional --padding parameter, to specify how much extra
(unsigned) space to leave between the signature header and the kernel blob.
The default is 0x4000, which is about four times as much needed when using
the largest signature size we currently support.

Review URL: http://codereview.chromium.org/2283005
This commit is contained in:
Bill Richardson
2010-05-27 11:15:14 -07:00
parent 3003c1dd50
commit f5db4b86fa
8 changed files with 423 additions and 69 deletions

View File

@@ -58,6 +58,9 @@ class KernelUtility {
std::string firmware_key_pub_file_;
std::string kernel_key_file_; // Private key for signing the kernel.
std::string kernel_key_pub_file_;
std::string config_file_; // File containing kernel commandline parameters
std::string bootloader_file_; // Embedded bootloader code
std::string vmlinuz_file_; // Input vmlinuz to be embedded in signed blob.
// Fields of a KernelImage. (read from the command line).
int header_version_;
@@ -65,6 +68,7 @@ class KernelUtility {
int kernel_sign_algorithm_;
int kernel_key_version_;
int kernel_version_;
int padding_;
uint64_t kernel_len_;
uint8_t* kernel_config_;