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

@@ -63,6 +63,18 @@ int WriteKernelImage(const char* input_file,
const KernelImage* image,
int is_only_vblock);
/* Create a kernel_data blob from its components and fill
* its length into blob_len, plus some information about the bootloader.
*
* Caller owns the returned pointer and must Free() it.
*/
uint8_t* GenerateKernelBlob(const char* vmlinuz_file,
const char* config_file,
const char* bootloader_file,
uint64_t* blob_len,
uint64_t* bootloader_offset,
uint64_t* bootloader_size);
/* Pretty print the contents of [image]. Only headers and metadata information
* is printed.
*/