A minor installation improvement that I've found is to rearrange the Linux kernel command line to be last segment in the payload. This allows me to tweak boot time parameters without having to re-write the entire kernel and initrd in the flash.
Is there a current or historical reason for the ordering?
diff --git a/util/cbfstool/cbfs-payload-linux.c b/util/cbfstool/cbfs-payload-linux.c index 6b4bf27..ccbcb33 100644 --- a/util/cbfstool/cbfs-payload-linux.c +++ b/util/cbfstool/cbfs-payload-linux.c @@ -312,14 +312,14 @@ int parse_bzImage_to_payload(const struct buffer *input, bzp_output_segment(&bzp, &bzp.trampoline, PAYLOAD_SEGMENT_CODE, TRAMPOLINE_ENTRY_LOC);
- /* cmdline */ - bzp_output_segment(&bzp, &bzp.cmdline, - PAYLOAD_SEGMENT_DATA, COMMAND_LINE_LOC); - /* initrd */ bzp_output_segment(&bzp, &bzp.initrd, PAYLOAD_SEGMENT_DATA, initrd_base);
+ /* cmdline */ + bzp_output_segment(&bzp, &bzp.cmdline, + PAYLOAD_SEGMENT_DATA, COMMAND_LINE_LOC); + /* Terminating entry segment. */ bzp_output_segment(&bzp, NULL, PAYLOAD_SEGMENT_ENTRY, TRAMPOLINE_ENTRY_LOC);
Trammell Hudson wrote:
Is there a current or historical reason for the ordering?
My best guess: They are stored in CBFS in the order that they appear in RAM at run time. If so, no problem changing the order in CBFS.
//Peter
2017-09-07 0:09 GMT+02:00 Trammell Hudson hudson@trmm.net:
Is there a current or historical reason for the ordering?
The reason for this order is that there had to be _some_ order. So go ahead and push the change for review, it looks reasonable.
Thanks, Patrick