Current version of genkernel (commit: 82754773), and previous as well, run kernel compilation in the source tree, saving any output there. There is no way to pass an option to the kernel build system so all output is saved outside of the /usr/src/linux (technically the way to pass the option exists but it is not enough). The kernel build system provides "O" option which enables saving compilation output outside of the source tree. The attached patch introduces --kernel-outputdir option with which one can choose the directory to save the compilation output. My rationale for it is twofold: 1. Expose the "O" option of the kernel build system as genkernel option and enable genkernel for those who use the option. 2. Kernel building process is quite I/O intensive process. As SSD, which are not as durable as traditional HDDs, become more popular an option to avoid excesive number of writing operation during kernel compilation might be of some value. Especially when the kernel is the only part of Gentoo which compilation happens below /usr (which in case han has got got both SSD and HDD is most probably on the former while /var{,/tmp} on the latter). Reproducible: Always Steps to Reproduce: 1. Run genkernel to build Linux kernel. Actual Results: Object files are saved below /usr/src/linux/ Expected Results: Object files beeing saved in an arbitrary directory.
Created attachment 324010 [details, diff] Add --kernel-outputdir to save files outside the source tree. The patch introduces --kernel-outputdir option which can be used to point the directory where kernel compilation output should be saved. E.g. genkernel --kernel-outputdir=/var/tmp/genkernel-kernel will make kernel build system save all its output in/and below /var/tmp/genkernel-kernel instead of /usr/src/linux.
merged in commit 79d7fa1