cos_kernel: Use patch command instead of git am When we build our kernel with portage, we apply patches with `eapply`. This internally uses the `patch` command, which allows some context fuzzing. This generally makes patches easier to maintain than if patches were applied with `git am`, which doesn't fuzz by default and has less safe fuzzing behavior if enabled. In order to make this tool better match the behavior of our ebuilds, we should use the patch tool instead of `git am`. This will result in all of the patches being applied in one big commit. This makes the code a bit more complex, but should reduce the toil of trying to make patches match exactly without fuzzing. Tested with the main-R121-cos-6.6 kernel by: 1. `cos-kernel build --patches=irdma` -> applied patches correctly and creates commit, leaving directory clean. 2. `cos-kernel build --patches=idpf` -> fails and cleans up directory (idpf patches depend on irdma). 3. Modify google/patches/idpf/0003 to corrupt it, then run `cos-kernel build --patches=irdma --patches=idpf` -> fails, leaves directory untouched, and outputs command which correctly cleans up directory when run. BUG=b/527927014 TEST=presubmit, see above Change-Id: Ib98050d97fcb4d08a4519040ed952d21a8d1e85a Reviewed-on: https://cos-review.googlesource.com/c/cos/tools/+/185286 Tested-by: Kevin Berry <kpberry@google.com> Reviewed-by: Derek Taylor <ddtaylor@google.com> Cloud-Build: 228075978874@cloudbuild.gserviceaccount.com <228075978874@cloudbuild.gserviceaccount.com>
This is a repository of various tools developed for Container-Optimized OS. Examples include cos-gpu-installer, cos-toolbox, etc.
See CONTRIBUTING.md for how to contribute.