KW-BUILD(1)
π NAME π
kw-build β Build kernel() πΈ
okay so bestie, this is the manual for kw-build, aka the bit of kw that makes your kernel. and yes the official title really is kw-build - Build kernel(), parentheses and all, we don't make the rules π
β¨ SYNOPSIS β¨
kw (b | build) [(-i | --info)] [--alert=(s | v | (sv | vs) | n)]
kw (b | build) [(-n | --menu)] [--alert=(s | v | (sv | vs) | n)]
kw (b | build) [(-d | --doc)] [--alert=(s | v | (sv | vs) | n)]
kw (b | build) [--ccache] [--alert=(s | v | (sv | vs) | n)]
kw (b | build) [(-S | --cpu-scaling)] <percentage> [--alert=(s | v | (sv | vs) | n)]
kw (b | build) [(-w | --warnings)] [warning-levels] [--alert=(s | v | (sv | vs) | n)]
kw (b | build) [(-s | --save-log-to)] <path> [--alert=(s | v | (sv | vs) | n)]
kw (b | build) [--llvm] [--alert=(s | v | (sv | vs) | n)]
kw (b | build) [(-c | --clean)] [--alert=(s | v | (sv | vs) | n)]
kw (b | build) [(-f | --full-cleanup)] [--alert=(s | v | (sv | vs) | n)]
kw (b | build) [--cflags]
kw (b | build) [--from-sha <SHA>]
kw (b | build) [--verbose]
π¦ DESCRIPTION π¦
So if you invoke this option with zero parameters, kw goes and peeks at the local Makefile and, based on what it sees there, just starts building the project for you. no cap. and it's lowkey showing off your hardware too, because it uses the -j option with the appropriate parameter to squeeze out all those cores. slay. π
You can also use this command in conjunction with :ref:deploy<deploy-doc>`` by invoking kw bd.
System Message: ERROR/3 (<stdin>:, line 30) Unknown interpreted text role "ref". Note: This command must be run inside of a kernel tree.
(β¨ we are keeping that system message exactly as it appeared, bestie, the docs said what they said. also yes, you genuinely have to be inside a kernel tree, that part is not a drill π«Ά)
π OPTIONS π
-i,--infoβ the info option, and what it does is make the build information show up. we're talking stuff like the kernel release name and the total number of modules that got compiled. receipts on screen π-n,--menuβ the menu option invokes the kernelmenuconfig. heads up though: the default menu config can be changed in thebuild.configfile by setting a different option inmenu_config. and if you're working in a cross-compile environment, it is recommended to use this option so you don't go messing with the config file manually like some kind of gremlin π-d,--docβ the doc option gives you a mechanism for building thekernel-doc; by default it will buildhtmldocs. you can change the default documentation output by changing the parameterdoc_typein thebuild.configfile. customize your lil doc moment π-S,--cpu-scalingβ the cpu-scaling option lets you set whichever CPU usage you want from your CPU, basically setting the-jflag accordingly. you're the main character, you decide how much brain your machine gives π--ccacheβ this option lets you enableccacheusage during compilation tasks, which should improve compile times in subsequent compilations. and if you want, you can just set this option in thebuild.configfile and never think about it again. set it and forget it, iconic behavior β¨-w,--warnings(1 | 2 | 3 | 12 | 13 | 23 | 123)β this can be used to enable compilation warnings accordingly. you can set the default log level via thebuild.configfile under the optionwarning_level. please check the kernel'smake helpfor more info. (yes, go read it, it's giving homework but it's important π)-s,--save-log-topathβ this option will save the full compilation log with the enabled warnings to the specified path. you can set the default log path in thebuild.configfile via thelog_pathoption. no more scrolling, we ball π--llvmβ this option can be set to enable the usage of the LLVM toolchain during compilation/linking tasks. you can enable it by default via theuse_llvmoption in thebuild.configfile. LLVM girlies rise π-c,--cleanβ the clean option removes files generated by the kernel build system, but keeps the kernel configuration. also, this option considers whether the user is using or notkw env. so fresh, so clean π§Ό-f,--full-cleanupβ under the hood, this command runsmake distclean, which resets the built environment to its initial/default state. in other words, it will remove files generated by the build process, including configuration files and script output. this option also considers whether or not the user is usingkw env. this one is giving scorched earth, so know what you're doing π--verboseβ verbose mode is an option that causes thekwprogram to display debug messages so you can track its progress. this functionality is very useful during the debugging process, letting you identify possible errors more easily. detective mode activated π--cflagsβ this function provides a flexible way to passCFLAGSwhen compiling a custom kernel, letting you customize and tune the build process to your specific needs. this is especially useful for optimizing performance and controlling generated kernel behavior. your kernel, your flags, your rules π--alert=(s | v | (sv | vs) | n)β defines the alert behaviour upon the command completion.senables sound notification. πvenables visual notification. πsvorvsenables both. πn(or any other option) disables notifications β and this is the default. shhh π€«
--from-shaβ build every commit after<SHA>to branch head. useful for testing if all patches in a patchset compile. bisect-era energy, we love to see it π₯
πΈ EXAMPLES πΈ
for these examples, we assume that the relevant fields in your configuration files (located by default in .kw/) have already been setup. we recommend the use of kw config for managing your local and global configurations. (do your setup bestie, future you says thank you π«Ά)
for building and installing a new module version based on the current kernel version, you can use:
cd <kernel-path>
kw bd
if you want that kw become more verbose about the compilation warning, you can use:
kw build --warnings=1
let's say that you are doing something else and don't want that your CPU cores to be super busy during the compilation; you can tell kw how much of the CPU utilization you are willing to give for the kernel compilation:
kw b --cpu-scaling=50
if you like to use ccache to build your kernel, you can use:
kw b --ccache
if you want to ensure that your change does not add any relevant warning, you can use:
kw b --warnings
if you want to see other warning levels, you can change the log level by using:
kw b --warnings 2
sometimes we have a lot of error message that does not fit in the terminal buffer; in these cases it is helpful to save all logs in a file:
kw b --warnings 123 --save-log-to ALL_WARNINGS.log
if you want to use llvm:
kw b --llvm
if you want to clean your kernel:
kw b --clean
if you want to reset the kernel tree to its default, all config and script output will be removed:
kw b --full-cleanup
if you want to use cflags:
kw b --cflags "-O3 -pipe -march=native"
if you want to build every commit after HEAD~2 to HEAD:
kw b --from-sha HEAD~2
if you want to build every commit after ee3b5 to HEAD:
kw b --from-sha ee3b5
okay that's literally the whole page π and at the very bottom of the page there's just the same stamp again β kw-build - Build kernel() β no separate version or date line came along with it, so that's all we've got. go build something iconic, bestie πβ¨
π¦ where this page comes from
- ubuntu stonking: kworkflow 1:0.10-3 Β· GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms