-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add cpio binary and help with silent and parallel builds #20
Conversation
cpio is needed by kernel/gen_kheaders.sh to build kernel/kheaders_data.tar.bz2. Hence include it as part of Dockerfile. python3 make_linux.py -a x86_64 -s ~/linux -o ~/linux/out -c clang-17 -k ~/linux/out/.config [+] Going to build the Linux kernel for x86_64 [+] Using "/home/srikar/linux/out/.config" as kernel config [+] Using "/home/srikar/linux" as Linux kernel sources directory [+] Using "/home/srikar/linux/out" as build output directory [+] Going to build with: clang-17 === Building with clang-17 === Output subdirectory for this build: /home/srikar/linux/out/.config__x86_64__clang-17 Output subdirectory already exists, use it (no cleaning!) kconfig files "/home/srikar/linux/out/.config" and "/home/srikar/linux/out/.config__x86_64__clang-17/.config" are identical, proceed Going to save build log to "build_log.txt" in output subdirectory Compiling with clang requires 'CC=clang' Run the container: bash ./start_container.sh clang-17 /home/srikar/linux /home/srikar/linux/out/.config__x86_64__clang-17 -n -- make O=../out/ CC=clang 2>&1 Hey, we gonna use sudo for running docker Run docker in NON-interactive mode Starting "kernel-build-container:clang-17" Mount source code directory "/home/srikar/linux" at "/home/srikar/src" Mount build output directory "/home/srikar/linux/out/.config__x86_64__clang-17" at "/home/srikar/out" Gonna run command "make O=../out/ CC=clang 2>&1" make[1]: Entering directory '/home/srikar/out' SYNC include/config/auto.conf.cmd GEN Makefile GEN Makefile UPD include/generated/compile.h CALL /home/srikar/src/scripts/checksyscalls.sh CC init/version.o AR init/built-in.a make[4]: *** [/home/srikar/src/kernel/Makefile:158: kernel/kheaders_data.tar.xz] Error 127 make[3]: *** [/home/srikar/src/scripts/Makefile.build:480: kernel] Error 2 make[2]: *** [/home/srikar/src/Makefile:2032: .] Error 2 make[1]: *** [/home/srikar/src/Makefile:234: __sub-make] Error 2 make[1]: Leaving directory '/home/srikar/out' make: *** [Makefile:234: __sub-make] Error 2 The container returned 2 Finish building the kernel Only remove the container id file: Hey, we gonna use sudo for running docker Search "container.id" file in build output directory "/home/srikar/linux/out/.config__x86_64__clang-17" OK, "container.id" file exists, removing it OK, container 460138d7243910b6ab58ba8da6d28ac10022c4b551b968004af848dfb5f3291f doesn't run The finish_container.sh script returned 0 See the build log: /home/srikar/linux/out/.config__x86_64__clang-17/build_log.txt [+] Done, see the results Signed-off-by: Srikar Dronamraju <[email protected]>
Linux kernel build supports silent build and parallel build. By default build, its easy to miss the warnings and errors in the compile log, especially when in interactive mode. Similarly parallel build will help to get the build the kernel faster. Signed-off-by: Srikar Dronamraju <[email protected]>
Hello @srikard, Thanks a lot for your pull request! I like the idea. I agree that parallel build should become default. And I think that verbose kernel build should stay default. Would you like to work on it? |
* Alexander Popov ***@***.***> [2024-09-04 08:02:35]:
Hello @srikard,
Thanks a lot for your pull request! I like the idea.
I agree that parallel build should become default.
But we should provide a parameter for `make_linux.py` for disabling it and having a single-thread build (there are cases when it's useful).
Could you please implement a `-t` (single Tread build) parameter for `make_linux.py`?
And I think that verbose kernel build should stay default.
Could you please add a `-q` (quiet) parameter for `make_linux.py` for silent build?
Would you like to work on it?
Okay, will do, However may not be immediately though.
Also I think its better to keep the options compatible with kernel makefile
where possible.
something like -s for silent
and -j for parallel build.
… --
Reply to this email directly or view it on GitHub:
#20 (comment)
You are receiving this because you were mentioned.
Message ID: ***@***.***>
--
Thanks and Regards
Srikar Dronamraju
|
The The |
Hello @srikard, I've finished the implementation and merged this branch: c9a015c. Finally, the feature looks like this:
Does it work for you? |
* Alexander Popov ***@***.***> [2024-09-18 17:42:36]:
Hello @srikard,
I've finished the implementation and merged this branch.
Does it work for you?
Tested it out, and it works well.
Thanks for adding this
… --
Reply to this email directly or view it on GitHub:
#20 (comment)
You are receiving this because you were mentioned.
Message ID: ***@***.***>
--
Thanks and Regards
Srikar Dronamraju
|
Sometimes kernel build fails due to non availability of cpio archive in the container.
the kernel/gen_kheaders.sh file needs cpio archive to build kernel/kheaders_data.tar.xz
Similarly silent and parallel builds will help to build faster and show only relevant warnings or error messages.