kw offers several subcommands catering to different audiences and targeting different functionality
groups. Most subcommands have sane defaults.
COMMANDSFORUSINGQEMU
Projects that use a QEMU VM in the development cycle to host the development environment usually require
that developers use some specific commands to manage this VM. In this section, you can find all commands
available in kw to manage many daily tasks related to QEMU VM operation. Notice that some rules are
specific for the Linux Kernel project.
mo,mount
Mount the QEMU image in a specific directory, based on the data available in the kworkflow.config. Notice
that the configuration file has the information about the source image and destiny mount point.
NOTE:OnlyrunthiscommandafteryouturnoffyourVM.
um,umount
Umount the previously mounted QEMU image.
u,up
Start the QEMU VM based on parameters in the kworkflow.config file.
s,ssh[--script|-s="PATH"]|[--command|-c="COMMAND"]
Ssh into the QEMU VM. The --script parameter expects a bash script as a parameter to evaluate it in the
VM. The --command parameter expects a command to be executed inside the QEMU VM.
i,install
Installs or updates the Linux kernel modules on the QEMU VM. Under the hood, it executes the mount
operation, followed by makemodules_install with a specific target, and finally umounts the QEMU image.
NOTE:OnlyrunthiscommandafteryouturnoffyourVM.
p,prepare(EXPERIMENTAL) Starting from a generic image, prepare sets up the necessary packages, files, etc. inside
the QEMU image so that it is ready for development work. For this to work, you have to:
1. Add your public key in the VM in the authorized_keys file.
2. Remove the requirement for password in the VM to become root.
This command (currently) uses Ansible playbooks.
COMMANDSFORWORKINGWITHCODE
Projects that have a similar workflow to the Linux Kernel usually have a set of tools that simplify part
of the tasks related with the code. This section describes some of the key features supported by kw to
help with code.
b,build
This command calls make on a local Makefile to build the project. It tries to take advantage of your
hardware by using the -j option with the appropriate parameter.
c,codestyle[DIRECTORY|FILE]
The checkpatch tool is one of the most fabulous scripts provided by the Linux Kernel to help developers
follow the code style adopted by the project. This command is a wrapper for checkpatch, with the goal of
simplifying the use of this tool; notice that you can specify a single file or an entire directory.
e,explore[log][EXPRESSION][-p][DIRECTORY|FILE]
The explore command is based on git grep. It can search for string matches in either the git repository
contents or in the git log messages. For example, you can use kwefunctionName to find functionName in
the source directory. You can also search the git log history by using log after the e; for instance, kwelogSTRING_MATCH. Additionally, you can use -p to see the diff in the search.
m,maintainers[-a|--authors][DIRECTORY|FILE]
Based on the Linux Kernel get_maintainers script, this command shows the maintainers of a given Kernel
module (a given file or directory). The [-a|--authors] option will also print the authors of the
top-level target files (non-recursively). Files with more than one author will have their names separated
by ",". This output should not be used by scripts because some authors include "," in their names (e.g.
"Company X, Inc.").
OTHERCOMMANDS
This section describes a tool available in kw to help developers keep track of configuration files and
other features provided by kw that do not fit in the previous sections.
g,configm[--saveNAME[-dDESCRIPTION][-f]]|[--ls]|[--getNAME[-f]]|[--rmNAME[-f]]
The 'configm' command manages different versions of the project's '.config' file. It provides the save,
load, remove, and list operations of such files.
1. --save NAME [-d DESCRIPTION] [-f]: The save option searches the current directory for a '.config'
file to be kept under the management of kw. The save option expects a name to identify this version of
the file. Additionally, users can add a description by using -d flag. Finally, if the user tries to add
the same name twice, kw will issue a warning; the '-f' will suppress this message.
2. --ls lists all the .config file versions available.
3. --get NAME [-f]: Get a config file based on the NAME and paste it in the current directory. It pop-up
a warning message because this operation override the current .config file. The user can suppress this
warning by using -f flag.
4. --rm NAME [-f]: Remove config labeled with NAME. It pop-up a warning message because it will remove
the config file from kw management. The user can suppress this warning by using -f.
v,vars
Shows configurations being used by kw in the current working directory. To do that, it examines both
global and local kworkflow.config files.
bi
Build and install a new module version. It is a combination of the build and install commands.
alert=[vs|sv,v,s,n]
Some commands take considerable time to execute. kw gives you an option to be notified when they finish.
The commands prepare, build, install, mount, umount, new and bi offer this feature.
1. v enables visual notification.
2. s enables sound notification.
3. vs or sv enables both.
4. n (or any other option) disables notifications (this is the default).
h,help
Show basic help.