.\" Man page generated from reStructuredText. . . .nr rst2man-indent-level 0 . .de1 rstReportMargin \\$1 \\n[an-margin] level \\n[rst2man-indent-level] level margin: \\n[rst2man-indent\\n[rst2man-indent-level]] - \\n[rst2man-indent0] \\n[rst2man-indent1] \\n[rst2man-indent2] .. .de1 INDENT .\" .rstReportMargin pre: . RS \\$1 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin] . nr rst2man-indent-level +1 .\" .rstReportMargin post: .. .de UNINDENT . RE .\" indent \\n[an-margin] .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]] .nr rst2man-indent-level -1 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]] .in \\n[rst2man-indent\\n[rst2man-indent-level]]u .. .TH "KW" 1 "2018-05-18" "" "Kernel Workflow" .SH NAME kw \- Inglorious kernel developer workflow scripts .SH SYNOPSIS .sp \fBkw\fP \fICOMMAND\fP [\fIOPTION\fP ...] .SH DESCRIPTION .sp \fBkw\fP is a set of scripts that have a single mission: reduce the overhead related with infrastructure project setup in projects that have a similar workflow to the Linux Kernel. It can (and should) be customized by editing the \fIkworkflow.config\fP file, as discussed in section \(dqABOUT kworflow.config\(dq. .SH COMMANDS .sp \fBkw\fP offers several subcommands catering to different audiences and targeting different functionality groups. Most subcommands have sane defaults. .SS COMMANDS FOR USING QEMU .sp 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 \fBkw\fP to manage many daily tasks related to QEMU VM operation. Notice that some rules are specific for the Linux Kernel project. .SS mo, mount .sp Mount the QEMU image in a specific directory, based on the data available in the \fBkworkflow.config\fP\&. Notice that the configuration file has the information about the source image and destiny mount point. .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 \fBOnly run this command after you turn off your VM\fP\&. .UNINDENT .UNINDENT .SS um, umount .sp Umount the previously mounted QEMU image. .SS u, up .sp Start the QEMU VM based on parameters in the \fBkworkflow.config\fP file. .SS s, ssh [\-\-script|\-s=\(dqPATH\(dq]|[\-\-command|\-c=\(dqCOMMAND\(dq] .sp Ssh into the QEMU VM. The \fI\-\-script\fP parameter expects a bash script as a parameter to evaluate it in the VM. The \fI\-\-command\fP parameter expects a command to be executed inside the QEMU VM. .SS i, install .sp Installs or updates the Linux kernel modules on the QEMU VM. Under the hood, it executes the mount operation, followed by \fBmake modules_install\fP with a specific target, and finally umounts the QEMU image. .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 \fBOnly run this command after you turn off your VM\fP\&. .UNINDENT .UNINDENT .SS p, prepare .sp \fB(EXPERIMENTAL)\fP Starting from a generic image, \fIprepare\fP 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: .INDENT 0.0 .IP 1. 3 Add your public key in the VM in the authorized_keys file. .IP 2. 3 Remove the requirement for password in the VM to become root. .UNINDENT .sp This command (currently) uses Ansible playbooks. .SS COMMANDS FOR WORKING WITH CODE .sp 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 \fBkw\fP to help with code. .SS b, build .sp This command calls make on a local Makefile to build the project. It tries to take advantage of your hardware by using the \fI\-j\fP option with the appropriate parameter. .SS c, codestyle [\fIDIRECTORY|FILE\fP] .sp The \fBcheckpatch\fP 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 \fBcheckpatch\fP, with the goal of simplifying the use of this tool; notice that you can specify a single file or an entire directory. .SS e, explore [log] [\fIEXPRESSION\fP] [\-p] [\fIDIRECTORY|FILE\fP] .sp The \fIexplore\fP 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 \fBkw e functionName\fP to find \fIfunctionName\fP in the source directory. You can also search the git log history by using \fIlog\fP after the \fIe\fP; for instance, \fBkw e log STRING_MATCH\fP\&. Additionally, you can use \fI\-p\fP to see the diff in the search. .SS m, maintainers [\fI\-a|\-\-authors\fP] [\fIDIRECTORY|FILE\fP] .sp Based on the Linux Kernel get_maintainers script, this command shows the maintainers of a given Kernel module (a given file or directory). The \fI[\-a|\-\-authors]\fP 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 \(dq,\(dq. This output should not be used by scripts because some authors include \(dq,\(dq in their names (e.g. \(dqCompany X, Inc.\(dq). .SS OTHER COMMANDS .sp This section describes a tool available in \fBkw\fP to help developers keep track of configuration files and other features provided by \fBkw\fP that do not fit in the previous sections. .SS g, configm [\-\-save \fINAME\fP [\-d \fIDESCRIPTION\fP][\-f]]|[\-\-ls]|[\-\-get \fINAME\fP [\-f]]|[\-\-rm \fINAME\fP [\-f]] .sp The \(aqconfigm\(aq command manages different versions of the project\(aqs \(aq.config\(aq file. It provides the save, load, remove, and list operations of such files. .sp 1. \-\-save NAME [\-d DESCRIPTION] [\-f]: The save option searches the current directory for a \(aq.config\(aq 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 \fI\-d\fP flag. Finally, if the user tries to add the same name twice, \fBkw\fP will issue a warning; the \(aq\-f\(aq will suppress this message. .INDENT 0.0 .IP 2. 3 \-\-ls lists all the .config file versions available. .UNINDENT .sp 3. \-\-get \fINAME\fP [\-f]: Get a config file based on the \fINAME\fP 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. .sp 4. \-\-rm \fINAME\fP [\-f]: Remove config labeled with \fINAME\fP\&. 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. .SS v, vars .sp Shows configurations being used by \fBkw\fP in the current working directory. To do that, it examines both global and local \fIkworkflow.config\fP files. .SS bi .sp Build and install a new module version. It is a combination of the \fBbuild\fP and \fBinstall\fP commands. .SS alert=[\fIvs|sv,v,s,n\fP] .sp Some commands take considerable time to execute. \fBkw\fP gives you an option to be notified when they finish. The commands \fIprepare\fP, \fIbuild\fP, \fIinstall\fP, \fImount\fP, \fIumount\fP, new and \fIbi\fP offer this feature. .INDENT 0.0 .IP 1. 3 \fIv\fP enables visual notification. .IP 2. 3 \fIs\fP enables sound notification. .IP 3. 3 \fIvs\fP or \fIsv\fP enables both. .IP 4. 3 \fIn\fP (or any other option) disables notifications (this is the default). .UNINDENT .SS h, help .sp Show basic help. .SH ABOUT KWORFLOW.CONFIG .sp \fBkw\fP reads its configuration from two files: the global \fIPATH/etc/kworkflow.config\fP file and the local \fIkworkflow.config\fP file present at the current working directory. The global \fBkworkflow.config\fP is a part of the \fBkw\fP code and provides the overall behavior for \fBkw\fP\&. Local \fBkworkflow.config\fP settings override global ones; you may have one \fBkworkflow.config\fP per project. In this section, we describe the possible fields you can specify in the configuration files. .SS ssh_ip=IP .sp Sets the IP address to be used by ssh. By default \fBkw\fP uses \fBlocalhost\fP\&. .SS ssh_port=PORT .sp Sets the ssh port. By default \fBkw\fP uses 2222. .SS arch=ARCHITECTURE .sp Allows you to specify the default architecture used by \fBkw\fP\&. By default, \fBkw\fP uses x86_64. .SS virtualizer=VIRTUALIZER .sp Defines the virtualization tool that should be used by kw. Currently, we only support QEMU and, as a result, the default is \fBqemu\-system\-x86_64\fP .SS mount_point=PATH .sp Defines the kw mount point, which will be used by libguestfs during the mount/umount operation of a VM. By default, \fBkw\fP uses /home/$USER/p/mount. .SS qemu_hw_options=OPTIONS .sp Sets QEMU options. By default, \fBkw\fP uses \fB\-enable\-kvm \-daemonize \-smp 2 \-m 1024\fP .SS qemu_net_options=OPTIONS .sp Defines the network configuration. By default, \fBkw\fP uses \fB\-net nic \-net user,hostfwd=tcp::2222\-:22,smb=/home/USER\fP .SS qemu_path_image=PATH .sp Specify the VM image path. By default, \fBkw\fP uses \fB/home/USERKW/p/virty.qcow2\fP .SS alert=[vs|s|v|n] .sp Default alert options, you have: .INDENT 0.0 .IP 1. 3 v: enables visual notification. .IP 2. 3 s enables sound notification. .IP 3. 3 vs or sv enables both. .IP 4. 3 n (or any other option) disables notifications. .UNINDENT .SS sound_alert_command=COMMAND .sp Command to run for sound completion alert. By default, \fBkw\fP uses \fBpaplay INSTALLPATH/sounds/complete.wav &\fP .SS visual_alert_command=COMMAND .sp Command to run for visual completion alert. By default, \fBkw\fP uses notify\-send \-i checkbox \-t 10000 \(dqkw\(dq \(dqCommand: \e\(dq$COMMAND\e\(dq completed!\(dq (Note: You may use COMMAND, which will be replaced by the kw command whose conclusion the user wished to be alerted.) .SH EXAMPLE .sp For these examples, we suppose the fields in your \fIkworkflow.config\fP file is already configured. .sp First, if you are working in a specific kernel module, and if you want to install your recent changes in your VM you can use: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C cd /KERNEL/PATH kw i .ft P .fi .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 Turn off your VM before use the \fIintall\fP command. .UNINDENT .UNINDENT .sp For building and installing a new module version based on the current kernel version, you can use: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C cd /KERNEL/PATH kw bi .ft P .fi .UNINDENT .UNINDENT .sp For checking the code style: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C cd /KERNEL/PATH kw c drivers/iio/dummy/ kw c drivers/iio/dummy/iio_simple_dummy.c .ft P .fi .UNINDENT .UNINDENT .sp If you want to check the maintainers: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C cd /KERNEL/PATH kw m drivers/iio/dummy/iio_simple_dummy.c .ft P .fi .UNINDENT .UNINDENT .sp In case you want that kw saves your current .config file, you can use: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C cd /KERNEL/PATH kw g \-\-save my_current_config .ft P .fi .UNINDENT .UNINDENT .sp You can see the config\(aqs file maintained by kw with: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C kw g \-\-ls .ft P .fi .UNINDENT .UNINDENT .sp You can turn on your VM with: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C kw u .ft P .fi .UNINDENT .UNINDENT .sp After you start your VM you can ssh into it with: .INDENT 0.0 .INDENT 3.5 .sp .nf .ft C kw s \-c=\(dqdmesg \-wH\(dq kw s .ft P .fi .UNINDENT .UNINDENT .sp \fBNOTE:\fP .INDENT 0.0 .INDENT 3.5 You have to wait for the sshd become ready. .UNINDENT .UNINDENT .SH AUTHOR Rodrigo Siqueira , Matheus Tavares .SH COPYRIGHT GPLv2+ .\" Generated by docutils manpage writer. .