KW-DEPLOY(1)

πŸ“¦ version 0.10, in ubuntu stonking

πŸ’– kw-deploy β€” Deploy kernel πŸ’–

okay bestie, welcome to kw-deploy(1), the part of the kw family where stuff actually gets installed on machines. it's giving "last step of the kernel pipeline" energy and honestly? iconic.


✨ SYNOPSIS ✨

kw (d | deploy) [--remote <remote>:<port> | --local]
       [--setup] [-r | --reboot] [--no-reboot] [-m | --modules] [-s |
       --ls-line] [-l | --list] [-a | --list-all] [(-u | --uninstall)
       [<kernel-name>[,...]]] [-f --force] [--alert=(s | v | (sv | vs) |
       n)] [-p | --create-package] [(-F | --from-package)
       <kw-package-path>]

like, look at all those flags. main character behavior fr fr. 🫢


🌸 DESCRIPTION 🌸

Sooo if you're chillin' inside a kernel directory, this command will try to install the current kernel version in your target machine β€” remote, host, or VM, pick your fighter. πŸ’…

If you wanna install a kernel version on a remote machine, here's the whole glow-up sequence that runs:

  1. Prepare a local directory with all the required files;
  2. Send all the files to the target machine; and
  3. Execute the operations that will update the target machine.

You can specify the deploy target right from the command line with --remote <remote>:<port> (e.g. --remote 172.16.254.1:22). But ngl, if you're deploying to the same remote over and over, you're gonna want the kw remote feature β€” it saves the SSH info in a config file that kw reads. like:

kw remote --add origin root@172.16.254.1

want the deets? check kw remote --help. πŸ¦‹

Now, if you wanna install a new kernel version on your own host machine, use --local β€” and yeah, you're gonna need your root password, no way around it bestie.

Another super typical thing when you're deploying a fresh kernel to a test machine is rebooting after the update. You can slap --reboot on a command to explicitly make kw reboot the machine afterwards, or you can make it always happen by tweaking the reboot_after_deploy flag in deploy.config like this:

kw config deploy.reboot_after_deploy yes

This can be used in conjunction with the :ref:build<build-doc>`` command by invoking kw bd.

System Message: ERROR/3 (<stdin>:, line 52) Unknown interpreted text role "ref".

(yeah that's just sitting there in the original. it's not me, it's the docs. πŸ™ˆ)


πŸ‘‘ OPTIONS πŸ‘‘

  • --remote <remote>:<port> β€” Deploy the Kernel image and modules to a machine in the network.
  • --local β€” Deploy the Kernel image and modules in the host machine, you will need root access. kw deploy --local should not be executed with sudo or root.
  • -r, --reboot β€” Reboot machine after deploy.
  • --no-reboot β€” Do not reboot machine after deploy.
  • --setup β€” This command runs a basic setup in the target machine, including installing packages and preparing the distro for the deploy.
  • -m, --modules β€” Only install/update modules.
  • -l, --list β€” List available kernels in a single column the target.
  • -a, --list-all β€” List all available kernels, including the ones not installed by kw.
  • -s, --ls-line β€” List available kernels separated by comma.
  • -u (<kernel-name> | regex:<pattern>)[,...], --uninstall [(<kernel-name> | regex:<pattern>)[,...]] β€” Remove a single kernel or multiple kernels; for removing multiple kernels it is necessary to separate them with comma. A regex pattern can also be passed as input, prefixed with 'regex:'. If no kernel name is provided, remove the first kernel managed by kw it encounters.
  • -f, --force β€” Remove kernels even if they were not installed by kw (only valid with --uninstall or -u). Trying to remove a kernel not directly managed by kw can lead to system failures, and it is not recommended; only use it if you are sure about what you are doing.
  • -p, --create-package β€” It is possible to create a kw package that can be shared with other users and deployed with kw. This option instructs kw to just generate the package without deploying it; notice that the package will be available in the current folder.
  • -F, --from-package β€” You can use this option to deploy a custom kernel from kw package.
  • --alert=(s | v | (sv | vs) | n) β€”

Defines the alert behaviour upon the command completion.

  • s enables sound notification.
  • v enables visual notification.
  • sv or vs enables both.
  • n (or any other option) disables notifications (this is the default).
Note: Only run commands related to VM after you turn it off. Under the hood, it executes the mount operation, followed by make modules_install with a specific target, and finally umounts the QEMU image.

🌈 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.

First, if you are working in a specific kernel module, and if you want to install your recent changes in your local machine you can use:

cd <kernel-path>
kw d --local --modules

For building and installing a new module version based on the current kernel version, you can use:

cd <kernel-path>
kw bd

Now, let's say that you set up your configuration file to deploy your new kernel to a machine reachable via ssh. You can run the following command in order to prepare your target machine to receive your new kernel via kw d:

kw deploy --setup

Alternatively, you can just run kw d directly; the standard behavior will automatically run the setup operation in your first deploy. slay. ✨

Suppose that you want to share a specific kernel with someone else for validation; you can generate a kw package with:

kw deploy --create-package

The above command will create a *.kw.tar package file that can be shared with any other kw user. If you want to install a custom kernel from this package, you can use:

kw deploy --from-package 5.19.0-THIS-IS-AN-EXAMPLE+.kw.tar

Below are examples of how to use kw deploy --uninstall:

  1. Full kernel name argument
kw deploy --uninstall 'kernel1'
  1. Regular expression argument
kw deploy --uninstall 'regex:kernel.*'
  1. Comma-separated list of full kernel names and regular expressions
kw deploy --uninstall 'regex:kernel[1-3],kernel4,regex:kernel[5-6]'
  1. Removes the first kernel managed by kw:
kw deploy --uninstall

and that's the whole page bestie, no cap, every single flag accounted for. πŸ’– this was kw-deploy β€” Deploy kernel() β€” from the kw-deploy - Deploy kernel() manual, and yeah, the header and footer are literally the same string, which is lowkey a vibe. anyway, happy deploying, go be the main character of your kernel tree. πŸ‘‘πŸŽ€πŸ¦‹βœ¨

πŸ“¦ where this page comes from