### Enable -proposed pocket via CLI (Mantic Minotaur 23.10 and older) Source: https://github.com/canonical/kernel-docs/blob/main/docs/how-to/testing-verification/test-kernel-in-proposed.md Add the -proposed suite to the \/etc\/apt\/sources.list file for package installation. This example shows the line for non-x86 architectures. ```text deb http://ports.ubuntu.com/ubuntu-ports -proposed restricted main multiverse universe ``` -------------------------------- ### Install Development Dependencies Source: https://github.com/canonical/kernel-docs/blob/main/docs/how-to/contribute.md Installs necessary packages for building the Kernel documentation locally. Ensure you have Python and make installed. ```bash sudo apt install make sudo apt install python3 sudo apt install python3.12-venv ``` -------------------------------- ### Install snapcraft Source: https://github.com/canonical/kernel-docs/blob/main/docs/how-to/develop-customise/build-kernel-snap.md Install the snapcraft snap for building kernel snaps. Ensure any existing debian package is removed first. ```shell sudo apt-get update sudo apt-get -y upgrade sudo apt purge -y snapcraft sudo snap install snapcraft --classic ``` -------------------------------- ### Configure Ubuntu 24.04+ sources Source: https://github.com/canonical/kernel-docs/blob/main/docs/how-to/develop-customise/build-kernel-snap.md Example configuration for `/etc/apt/sources.list.d/ubuntu.sources` on a x86-64 host running Ubuntu 24.04 (Noble). ```text Types: deb deb-src URIs: http://archive.ubuntu.com/ubuntu Suites: noble noble-updates noble-backports Components: main universe restricted multiverse Architectures: amd64 ``` -------------------------------- ### Install Git Package Source: https://github.com/canonical/kernel-docs/blob/main/docs/how-to/source-code/obtain-kernel-source-git.md Ensure the git package is installed on your system before proceeding. This is a prerequisite for using Git commands. ```shell sudo apt-get install git ``` -------------------------------- ### Provenance Example with Cherry-pick Source: https://github.com/canonical/kernel-docs/blob/main/docs/reference/stable-patch-format.md An example demonstrating the provenance section for a cherry-picked patch, including Signed-off-by lines and the cherry-pick information. ```none Signed-off-by: Adam Jackson Signed-off-by: Eric Anholt Signed-off-by: Greg Kroah-Hartman (cherry picked from commit d4e0018e3e4dd685af25d300fd26a0d5a984482e linux-2.6.34.y) Signed-off-by: Manoj Iyer ``` -------------------------------- ### Install kernel snap on target device Source: https://github.com/canonical/kernel-docs/blob/main/docs/how-to/develop-customise/build-kernel-snap.md Copy the built kernel snap file to your target device and install it using the 'snap install' command with dangerous and devmode flags. This is typically followed by a reboot to verify changes. ```shell snap install --dangerous --devmode __.snap ``` -------------------------------- ### Configure Ubuntu 23.10 and older sources Source: https://github.com/canonical/kernel-docs/blob/main/docs/how-to/develop-customise/build-kernel-snap.md Example configuration for `/etc/apt/sources.list` on a x86-64 host running Ubuntu 22.04 (Jammy). ```text deb [arch=amd64] http://archive.ubuntu.com/ubuntu focal main restricted ``` -------------------------------- ### Install ckt_workflow Tool Source: https://github.com/canonical/kernel-docs/blob/main/docs/reuse/kernel-workflow-playbook-tooling.txt Use this command to install the ckt_workflow tool from its Git repository. The repository location may change. ```shell pipx install ckt_workflow@git+https://git.launchpad.net/~apw/+git/ckt_workflow@latest ``` -------------------------------- ### Install HWE Kernel and Xorg for Ubuntu 16.04 LTS Desktop Source: https://github.com/canonical/kernel-docs/blob/main/docs/reference/hwe-kernels.md Installs the HWE kernel and Xorg for Ubuntu 16.04 LTS (Xenial Xerus) Desktop installations. ```shell sudo apt-get install --install-recommends linux-generic-hwe-16.04 xserver-xorg-hwe-16.04 ``` -------------------------------- ### Run Documentation Locally Source: https://github.com/canonical/kernel-docs/blob/main/docs/how-to/contribute.md Builds and serves the documentation locally to preview changes before submission. This command requires the development dependencies to be installed. ```bash make run ``` -------------------------------- ### Example: Jammy Jellyfish Kernel Source URL Source: https://github.com/canonical/kernel-docs/blob/main/docs/explanation/ubuntu-linux-kernel-sources.md This is the specific Launchpad Git URL for the generic kernel source of Ubuntu 22.04 LTS (Jammy Jellyfish). ```text https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/jammy ``` -------------------------------- ### Kernel Version Warning Example Source: https://github.com/canonical/kernel-docs/blob/main/docs/reference/kernel-workflow-playbook/kernel-rollback.md Example output from kernel tooling indicating a warning about a repinned version not being in the specified spin. Manual updates may be required in such cases. ```shell # jammy:linux-azure: spin=s2025.10.13-2 full_versions={'lrm': '5.15.0-1102.111+1', 'main': '5.15.0-1102.111', 'meta': '5.15.0.1102.100', 'signed': '5.15.0-1102.111'} [...] # WARNING: linux-restricted-modules-azure looks to have a repin not in the spin (5.15.0-1102.111+1) ``` -------------------------------- ### Enable -proposed pocket via CLI (Noble Numbat 24.04+) Source: https://github.com/canonical/kernel-docs/blob/main/docs/how-to/testing-verification/test-kernel-in-proposed.md Modify the \/etc\/apt\/sources.list.d\/ubuntu.sources file to include the -proposed suite for package installation. ```text Types: deb URIs: http://archive.ubuntu.com/ubuntu Suites: noble noble-updates noble-backports -proposed Components: main universe restricted multiverse Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg ``` -------------------------------- ### Install an OEM Kernel Source: https://github.com/canonical/kernel-docs/blob/main/docs/reference/oem-kernels.md Use apt to install a specific OEM kernel version by its meta-package name. Ensure you use the correct package name as listed in the OEM kernel life cycle table. ```bash apt install linux-oem-24.04a ``` -------------------------------- ### Install HWE Kernel for Ubuntu 16.04 LTS Server Source: https://github.com/canonical/kernel-docs/blob/main/docs/reference/hwe-kernels.md Installs the HWE kernel for Ubuntu 16.04 LTS (Xenial Xerus) Server installations. ```shell sudo apt-get install --install-recommends linux-generic-hwe-16.04 ``` -------------------------------- ### Install HWE Kernel and Xorg for Ubuntu 14.04 LTS Desktop Source: https://github.com/canonical/kernel-docs/blob/main/docs/reference/hwe-kernels.md Installs the HWE kernel and Xorg components for Ubuntu 14.04 LTS (Trusty Tahr) Desktop installations. ```shell sudo apt-get install --install-recommends linux-generic-lts-xenial xserver-xorg-core-lts-xenial xserver-xorg-lts-xenial xserver-xorg-video-all-lts-xenial xserver-xorg-input-all-lts-xenial libwayland-egl1-mesa-lts-xenial ``` -------------------------------- ### Install kernel via ABI-named image Source: https://github.com/canonical/kernel-docs/blob/main/docs/how-to/testing-verification/test-kernel-in-proposed.md Installs a specific kernel image version without being tied to the kernel series metapackage. Use this for precise version control. ```bash sudo apt install linux-image-- ``` -------------------------------- ### Install kernel via metapackage Source: https://github.com/canonical/kernel-docs/blob/main/docs/how-to/testing-verification/test-kernel-in-proposed.md Installs the latest kernel version available in the -proposed pocket. Use this if you want automatic updates for the kernel series. ```bash sudo apt install linux- ``` -------------------------------- ### Install HWE Kernel for Ubuntu 22.04 LTS Source: https://github.com/canonical/kernel-docs/blob/main/docs/reference/hwe-kernels.md Installs the HWE kernel for Ubuntu 22.04 LTS (Jammy Jellyfish). Use this for both Desktop and Server installations. ```shell sudo apt-get install --install-recommends linux-generic-hwe-22.04 ``` -------------------------------- ### Install HWE Kernel and Xorg for Ubuntu 18.04 LTS Desktop Source: https://github.com/canonical/kernel-docs/blob/main/docs/reference/hwe-kernels.md Installs the HWE kernel and Xorg for Ubuntu 18.04 LTS (Bionic Beaver) Desktop installations. ```shell sudo apt-get install --install-recommends linux-generic-hwe-18.04 xserver-xorg-hwe-18.04 ``` -------------------------------- ### Example Patch with Signed-off-by and Cherry Pick Source: https://github.com/canonical/kernel-docs/blob/main/docs/reference/patch-acceptance-criteria.md Demonstrates the correct placement of Signed-off-by lines and the cherry-picked commit information in a patch email. ```email Subject: [PATCH] ufs: ufs_sb_private_info: remove unused s_{2,3}apb fields BugLink: https://bugs.launchpad.net/ubuntu/oracular/+source/linux/+bug/2087853 These two fields are populated and stored as a "frequently used value" in ufs_fill_super, but are not used afterwards in the driver. Moreover, one of the shifts triggers UBSAN: shift-out-of-bounds when apbshift is 12 because 12 * 3 = 36 and 1 << 36 does not fit in the 32 bit integer used to store the value. Closes: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2087853 Signed-off-by: Agathe Porte Signed-off-by: Al Viro (cherry picked from commit 6cfe56fbad32c8c5b50e82d9109413566d691569 linux-next) Signed-off-by: Agathe Porte ``` -------------------------------- ### Install HWE Kernel for Ubuntu 24.04 LTS Source: https://github.com/canonical/kernel-docs/blob/main/docs/reference/hwe-kernels.md Installs the HWE kernel for Ubuntu 24.04 LTS (Noble Numbat). Use this for both Desktop and Server installations. ```shell sudo apt-get install --install-recommends linux-generic-hwe-24.04 ``` -------------------------------- ### Install HWE Kernel for Ubuntu 14.04 LTS Server Source: https://github.com/canonical/kernel-docs/blob/main/docs/reference/hwe-kernels.md Installs the HWE kernel for Ubuntu 14.04 LTS (Trusty Tahr) Server installations. ```shell sudo apt-get install --install-recommends linux-generic-lts-xenial ``` -------------------------------- ### Patch Example (PATCH 1/1) Source: https://github.com/canonical/kernel-docs/blob/main/docs/reference/stable-patch-format.md Example of a single patch within a patch series. It includes commit details, bug link, a brief description of the change, and standard commit tags like Signed-off-by and Reviewed-by. Ensure the commit message adheres to the specified format. ```none Subject: [SRU][F][PATCH 1/1] s390/cpum_cf: Add new extended counters for IBM z15 From: frank.heimes@canonical.com Date: 24.06.20, 22:11 To: kernel-team@lists.ubuntu.com From: Thomas Richter BugLink: https://bugs.launchpad.net/bugs/1881096 Add CPU measurement counter facility event description for IBM z15. Signed-off-by: Thomas Richter Reviewed-by: Sumanth Korikkar Signed-off-by: Vasily Gorbik (cherry picked from commit d68d5d51dc898895b4e15bea52e5668ca9e76180) Signed-off-by: Frank Heimes [...] ``` -------------------------------- ### Clone Kernel Docs Repository Source: https://github.com/canonical/kernel-docs/blob/main/README.md Clone the kernel-docs repository to start working with the documentation. ```bash git clone https://github.com/canonical/kernel-docs.git cd kernel-docs/docs ``` -------------------------------- ### Example: Noble Numbat AWS Kernel Source URL Source: https://github.com/canonical/kernel-docs/blob/main/docs/explanation/ubuntu-linux-kernel-sources.md This is the specific Launchpad Git URL for the AWS kernel variant source of Ubuntu 24.04 LTS (Noble Numbat). ```text https://git.launchpad.net/~canonical-kernel/ubuntu/+source/linux-aws/+git/noble ``` -------------------------------- ### SAUCE Patch Prefix Example Source: https://github.com/canonical/kernel-docs/blob/main/docs/reference/patch-acceptance-criteria.md Shows the required 'UBUNTU: SAUCE:' prefix in the subject line for SAUCE patches. ```email Subject: UBUNTU: SAUCE: wifi: ath11k: avoid deadlock during regulatory update in ath11k_regd_update() BugLink: https://bugs.launchpad.net/bugs/1995041 ... Signed-off-by: Aaron Ma ``` -------------------------------- ### Install HWE Kernel for Ubuntu 20.04 LTS Source: https://github.com/canonical/kernel-docs/blob/main/docs/reference/hwe-kernels.md Installs the HWE kernel for Ubuntu 20.04 LTS (Focal Fossa). Use this for both Desktop and Server installations. ```shell sudo apt-get install --install-recommends linux-generic-hwe-20.04 ``` -------------------------------- ### Install Kernel Debian Packages Source: https://github.com/canonical/kernel-docs/blob/main/docs/how-to/develop-customise/build-kernel.md Install the generated kernel .deb packages using dpkg. Ensure you are in the directory above the kernel source working directory. Replace placeholders with your actual kernel version and derivative. ```shell cd /../ sudo dpkg -i linux-headers-*_all.deb sudo dpkg -i linux-headers--*.deb sudo dpkg -i linux-image-unsigned--*.deb sudo dpkg -i linux-modules--*.deb sudo reboot ``` -------------------------------- ### Cover Letter Example (PATCH 0/1) Source: https://github.com/canonical/kernel-docs/blob/main/docs/reference/stable-patch-format.md Example of a cover letter for a patch series submission, including SRU justification, impact, fix, test plan, and other relevant information. Ensure the 'BugLink' and 'SRU Justification' are correctly formatted. ```none Subject: [SRU][F][PATCH 0/1] s390/cpum_cf: Add new extended counters for IBM z15 (LP: 1881096) From: frank.heimes@canonical.com Date: 24.06.20, 22:11 To: kernel-team@lists.ubuntu.com BugLink: https://bugs.launchpad.net/bugs/1881096 SRU Justification: [Impact] With perf from Ubuntu 20.04 on IBM z15 hardware, some counters reported with lscpumf are not usable with 'perf stat -e'. [...] [Fix] Cherry-pick upstream commit: d68d5d51dc89 ("s390/cpum_cf: Add new extended counters for IBM z15") [Test Plan] Requires the fix/patch of the perf tool, as mentioned in the bug, too. [...] [Where problems could occur] The regression can be considered as low, since: [...] [Other Info] This requires a patch to be included into the perf itself, too - please see bug description for more details. [...] ``` -------------------------------- ### Install Kernel Build Dependencies Source: https://github.com/canonical/kernel-docs/blob/main/docs/how-to/develop-customise/build-kernel.md Installs necessary packages for building the Linux kernel, including build dependencies for the current kernel version. ```shell sudo apt update && \ sudo apt build-dep -y linux linux-image-unsigned-$(uname -r) && \ sudo apt install -y fakeroot llvm libncurses-dev dwarves ``` -------------------------------- ### Globally update sources for older Ubuntu versions Source: https://github.com/canonical/kernel-docs/blob/main/docs/how-to/develop-customise/build-kernel-snap.md Perform a global update of all sources in `/etc/apt/sources.list` for default Ubuntu installations. ```shell sudo sed -ie 's/deb http/deb [arch=amd64] http/g' /etc/apt/sources.list ``` -------------------------------- ### Install specific kernel metapackage version Source: https://github.com/canonical/kernel-docs/blob/main/docs/how-to/testing-verification/test-kernel-in-proposed.md Installs a specific, potentially older, version of a kernel metapackage. Useful for testing specific releases. ```bash sudo apt install linux-= ``` -------------------------------- ### SRU Justification Example Source: https://github.com/canonical/kernel-docs/blob/main/docs/explanation/post-release-updates.md When submitting a patch for a post-release kernel update, the bug report description must include a SRU justification section with details on impact, fix, and testcase. ```text SRU Justification: Impact: Fix: Testcase: ``` -------------------------------- ### Install Edge HWE Kernel for Ubuntu 24.04 LTS Source: https://github.com/canonical/kernel-docs/blob/main/docs/reference/hwe-kernels.md Installs the edge variant of the HWE kernel for Ubuntu 24.04 LTS. Edge kernels are for development and not recommended for production. ```shell sudo apt-get install --install-recommends linux-generic-hwe-24.04-edge ``` -------------------------------- ### Clone kernel snap recipe Source: https://github.com/canonical/kernel-docs/blob/main/docs/how-to/develop-customise/build-kernel-snap.md Clone the Ubuntu Linux kernel snap recipe repository to start building your custom kernel snap. ```shell git clone ``` -------------------------------- ### SRU BugLink Format Example Source: https://github.com/canonical/kernel-docs/blob/main/docs/reference/patch-acceptance-criteria.md Use the short form 'https://bugs.launchpad.net/bugs/XXXXXX' for the BugLink in patch descriptions. Avoid the long form. ```email Subject: [SRU][O/N][PATCH v2 0/1] ALSA: hda/realtek: fix mute/micmute LEDs for a HP EliteBook 645 G10 BugLink: https://bugs.launchpad.net/bugs/2087983 ... ``` -------------------------------- ### Clone Jammy Kernel Source with Git Source: https://github.com/canonical/kernel-docs/blob/main/docs/how-to/source-code/obtain-kernel-source-git.md Obtain a local copy of the Jammy kernel source tree using `git clone`. Examples show cloning via git, git+ssh, and https protocols. ```shell git clone git://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/jammy ``` ```shell git clone git+ssh://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/jammy ``` ```shell git clone https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source/linux/+git/jammy ``` -------------------------------- ### CVE Patch with Provenance and CVE Number Source: https://github.com/canonical/kernel-docs/blob/main/docs/reference/stable-patch-format.md Example of a CVE patch including Signed-off-by, Acked-by, provenance, the CVE number, and a final Signed-off-by line. ```none [... commit message body ...] Signed-off-by: Lion Ackermann Acked-by: Toke Høiland-Jørgensen Signed-off-by: David S. Miller (cherry picked from commit 5eb7de8cd58e73851cd37ff8d0666517d9926948) CVE-2024-53164 Signed-off-by: Ian Whitfield ``` -------------------------------- ### Obtain Kernel Source for Installed Version Source: https://github.com/canonical/kernel-docs/blob/main/docs/how-to/develop-customise/build-kernel.md Downloads and unpacks the source code for the currently running Ubuntu Linux kernel version into the working directory. ```shell apt source linux-image-unsigned-$(uname -r) ``` -------------------------------- ### Build Documentation Source: https://github.com/canonical/kernel-docs/blob/main/README.md Build the documentation site locally using the make html command. ```bash make html ``` -------------------------------- ### Prepare kernel release command Source: https://github.com/canonical/kernel-docs/blob/main/docs/reference/kernel-workflow-playbook/kernel-release.md Use this command to initiate the kernel promotion process. Replace `` with the relevant Launchpad bug ID. ```shell ./copy-package-kernel --from-route proposed --to-route updates --tracker ``` -------------------------------- ### Install HWE Kernel for Ubuntu 18.04 LTS Server Source: https://github.com/canonical/kernel-docs/blob/main/docs/reference/hwe-kernels.md Installs the HWE kernel for Ubuntu 18.04 LTS (Bionic Beaver) Server installations. ```shell sudo apt-get install --install-recommends linux-generic-hwe-18.04 ``` -------------------------------- ### Common Kernel Docs Commands Source: https://github.com/canonical/kernel-docs/blob/main/README.md A collection of common make commands for building, serving, cleaning, and checking the kernel documentation. Run these from the docs/ directory. ```bash make html # Build docs make run # Build, watch, and serve make serve # Serve existing build make clean-doc # Remove built docs output make spelling # Spell check make linkcheck # Validate links make lint-md # Markdown/MyST lint checks make vale # Style checks make woke # Inclusive language checks make pa11y # Accessibility checks ``` -------------------------------- ### Simulated copy-package commands for kernel promotion Source: https://github.com/canonical/kernel-docs/blob/main/docs/reference/kernel-workflow-playbook/kernel-release.md This output shows the simulated `copy-package` commands that would be executed during a kernel promotion. It details the source and destination repositories, versions, and includes the dry-run flag. ```text copy-tracker: 2127318 (focal:linux-iot) proposed updates Versions: -final- -was- main 5.4.0-1056.59 5.4.0-1055.58 meta 5.4.0.1056.54 5.4.0.1055.53 signed 5.4.0-1056.59 5.4.0-1055.58 Copies: linux-iot 5.4.0-1056.59 ppa:canonical-kernel-esm/ubuntu/proposed:Release -> ppa:ubuntu-esm/ubuntu/esm-infra-security:Release ... dry-run copy-package -n --include-binaries --auto-approve \ --from ppa:canonical-kernel-esm/ubuntu/proposed --from-suite focal \ --to ppa:ubuntu-esm/ubuntu/esm-infra-security --to-suite focal \ --version 5.4.0-1056.59 linux-iot linux-meta-iot 5.4.0.1056.54 ppa:canonical-kernel-esm/ubuntu/proposed:Release -> ppa:ubuntu-esm/ubuntu/esm-infra-security:Release ... dry-run copy-package -n --include-binaries --auto-approve \ --from ppa:canonical-kernel-esm/ubuntu/proposed --from-suite focal \ --to ppa:ubuntu-esm/ubuntu/esm-infra-security --to-suite focal \ --version 5.4.0.1056.54 linux-meta-iot linux-signed-iot 5.4.0-1056.59 ppa:canonical-kernel-esm/ubuntu/proposed:Release -> ppa:ubuntu-esm/ubuntu/esm-infra-security:Release ... dry-run copy-package -n --include-binaries --auto-approve \ --from ppa:canonical-kernel-esm/ubuntu/proposed --from-suite focal \ --to ppa:ubuntu-esm/ubuntu/esm-infra-security --to-suite focal \ --version 5.4.0-1056.59 linux-signed-iot ``` -------------------------------- ### Build, Serve, and Auto-reload Docs Source: https://github.com/canonical/kernel-docs/blob/main/README.md Build, serve, and automatically reload documentation changes locally. Accessible at http://127.0.0.1:8000. ```bash make run ``` -------------------------------- ### Create snapcraft.yaml alias Source: https://github.com/canonical/kernel-docs/blob/main/docs/how-to/develop-customise/build-kernel-snap.md Create a symbolic link for the snapcraft.yaml file. This is necessary when multiple YAML configuration files exist in the snap/local/ directory. ```shell ln -s snap/local/.yaml snapcraft.yaml ``` -------------------------------- ### Configure SSH for Launchpad Source: https://github.com/canonical/kernel-docs/blob/main/docs/how-to/develop-customise/build-kernel-snap.md Enable SSH access to git.launchpad.net for your Launchpad account. This is necessary when building from a private Launchpad repository. ```text Host git.launchpad.net User ``` -------------------------------- ### Suggest Improvements with Copilot CLI Source: https://github.com/canonical/kernel-docs/blob/main/README.md Use the GitHub CLI with Copilot to suggest improvements for documentation files, referencing repository instructions. ```bash gh copilot suggest "Follow .github/copilot-instructions.md and suggest improvements for docs/how-to/contribute.md" ``` -------------------------------- ### Invalid SRU BugLink Format Example Source: https://github.com/canonical/kernel-docs/blob/main/docs/reference/patch-acceptance-criteria.md The long form 'https://bugs.launchpad.net/ubuntu/+source/linux/+bug/XXXXXX' is not the preferred format for the BugLink. ```email Subject: [SRU][O/N][PATCH v2 0/1] ALSA: hda/realtek: fix mute/micmute LEDs for a HP EliteBook 645 G10 BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/2087983 ... ``` -------------------------------- ### Configure Kconfig for module signing Source: https://github.com/canonical/kernel-docs/blob/main/docs/how-to/develop-customise/build-kernel-snap.md Modify the snapcraft.yaml to set Kconfig values, specifically CONFIG_MODULE_SIG_ALL, for different architectures. This is useful for local testing and development to allow unverified modules. ```yaml [...] parts: kernel: override-build: | [...] # override configs sed -i "s/^\(CONFIG_MODULE_SIG_FORCE\).*/\1 policy<{'arm64': 'n', 'armhf': 'n'}>/" ${DEBIAN}/config/annotations sed -i "s/^\(CONFIG_MODULE_SIG_ALL.*)\'arm64\': 'y'\(.*)/\1'arm64': 'n'\2/" ${DEBIAN}/config/annotations [...] ``` -------------------------------- ### Prepare Kernel Source Directory Source: https://github.com/canonical/kernel-docs/blob/main/docs/how-to/develop-customise/build-kernel.md Ensures a clean build environment by cleaning previous build artifacts and granting execute permissions to necessary scripts within the kernel source directory. ```shell cd chmod a+x debian/scripts/* && \ chmod a+x debian/scripts/misc/* && \ fakeroot debian/rules clean ``` -------------------------------- ### Build kernel snap for UC20 Source: https://github.com/canonical/kernel-docs/blob/main/docs/how-to/develop-customise/build-kernel-snap.md Build the kernel snap package for Ubuntu Core 20, specifying the target architecture and enabling experimental target architecture and destructive mode. ```shell sudo snapcraft --target-arch=arm64 --destructive-mode --enable-experimental-target-arch ``` -------------------------------- ### Report bug using ubuntu-bug tool Source: https://github.com/canonical/kernel-docs/blob/main/docs/how-to/testing-verification/test-kernel-in-proposed.md Launches the interactive ubuntu-bug tool to help file a bug report on Launchpad. This is the recommended method for reporting regressions found during kernel testing. ```bash ubuntu-bug ``` -------------------------------- ### Navigate to kernel source repository Source: https://github.com/canonical/kernel-docs/blob/main/docs/how-to/develop-customise/build-kernel-snap.md Change the current directory to the root of your cloned kernel source repository. ```shell cd ``` -------------------------------- ### Enable deb-src for Mantic Minotaur 23.10 and older Source: https://github.com/canonical/kernel-docs/blob/main/docs/how-to/source-code/enable-source-repositories.md Add or uncomment `deb-src` lines in `/etc/apt/sources.list` for older Ubuntu releases. ```shell deb-src http://archive.ubuntu.com/ubuntu jammy main deb-src http://archive.ubuntu.com/ubuntu jammy-updates main ``` -------------------------------- ### Historical SRU Patch Subject Line Styles Source: https://github.com/canonical/kernel-docs/blob/main/docs/reference/stable-patch-format.md These are historical examples of subject line styles that may be found in the mailing list archive. The preferred style is `[B/F]`. ```none [SRU][B,F][PATCH 1/1] KVM: fix overflow of zero page refcount with ksm running ``` ```none [SRU][B][F][PATCH 1/1] KVM: fix overflow of zero page refcount with ksm running ``` ```none [SRU][Bionic,Focal][PATCH 1/1] KVM: fix overflow of zero page refcount with ksm running ``` ```none [SRU][Bionic/Focal][PATCH 1/1] KVM: fix overflow of zero page refcount with ksm running ``` ```none [SRU][Bionic][Focal][PATCH 1/1] KVM: fix overflow of zero page refcount with ksm running ``` -------------------------------- ### Build the Ubuntu Kernel Source: https://github.com/canonical/kernel-docs/blob/main/docs/how-to/develop-customise/build-kernel.md Compiles the customized Ubuntu Linux kernel. This command first cleans the build environment and then initiates the binary package creation. ```shell cd fakeroot debian/rules clean && \ fakeroot debian/rules binary ``` -------------------------------- ### Verify loaded kernel Source: https://github.com/canonical/kernel-docs/blob/main/docs/how-to/testing-verification/test-kernel-in-proposed.md After rebooting into the new kernel, use this command to confirm that the correct kernel version is currently running. ```bash uname -r ``` -------------------------------- ### SRU Cover Letter Example Source: https://github.com/canonical/kernel-docs/blob/main/docs/reference/patch-acceptance-criteria.md A cover letter for an SRU patch should include the subject, BugLink, SRU Justification (Impact, Test Plan, Where problems could occur), and the patch details. ```email Subject: [SRU][O/N][PATCH v2 0/1] ALSA: hda/realtek: fix mute/micmute LEDs for a HP EliteBook 645 G10 BugLink: https://bugs.launchpad.net/bugs/2087983 SRU Justification: [ Impact ] Mute/mic LEDs don't function on HP EliteBook 645 G10. [ Test Plan ] Test mute and mic LEDs with proposed kernel once patched. [ Where problems could occur ] Unknown regressions in the sound subsystem. Kernel Engineer (1): ALSA: hda/realtek: fix mute/micmute LEDs for a HP EliteBook 645 G10 sound/pci/hda/patch_realtek.c | 1 + 1 file changed, 1 insertion(+) ``` -------------------------------- ### Confirm foreign architecture support Source: https://github.com/canonical/kernel-docs/blob/main/docs/how-to/develop-customise/build-kernel-snap.md Verify that support for the target architecture has been successfully added by checking the output of `dpkg --print-foreign-architectures`. ```text arm64 ``` -------------------------------- ### Build kernel snap for UC24 and UC22 Source: https://github.com/canonical/kernel-docs/blob/main/docs/how-to/develop-customise/build-kernel-snap.md Build the kernel snap package for Ubuntu Core 24 and 22, specifying the target architecture and enabling destructive mode. ```shell sudo snapcraft --build-for=arm64 --destructive-mode ``` -------------------------------- ### Dry-run kernel promotion with verbose output Source: https://github.com/canonical/kernel-docs/blob/main/docs/reference/kernel-workflow-playbook/kernel-release.md Execute the `copy-package-kernel` command with `-n` for a dry run and `--verbose` to see the equivalent `copy-package` commands for validation. This helps confirm the intended actions before actual execution. ```shell /copy-package-kernel --from-route proposed --to-route updates --tracker 2127318 -n --verbose ``` -------------------------------- ### Enable deb-src for Noble Numbat 24.04+ Source: https://github.com/canonical/kernel-docs/blob/main/docs/how-to/source-code/enable-source-repositories.md Add `deb-src` to the `Types:` line in `/etc/apt/sources.list.d/ubuntu.sources` for newer Ubuntu releases. ```shell Types: deb deb-src URIs: http://archive.ubuntu.com/ubuntu Suites: noble noble-updates noble-backports Components: main universe restricted multiverse Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg ``` -------------------------------- ### Ubuntu Kernel Source Git URL Structure Source: https://github.com/canonical/kernel-docs/blob/main/docs/explanation/ubuntu-linux-kernel-sources.md These are the general formats for Launchpad Git repository URLs for Ubuntu Linux kernel sources. Use these to construct URLs for specific sources and series. ```text https://git.launchpad.net/~ubuntu-kernel/ubuntu/+source//+git/ https://git.launchpad.net/~canonical-kernel/ubuntu/+source//+git/ ``` -------------------------------- ### Cloning Ubuntu Kernel Sources via Git Protocol Source: https://github.com/canonical/kernel-docs/blob/main/docs/explanation/ubuntu-linux-kernel-sources.md Use the Git protocol for public repositories requiring read-only access. Replace with the actual repository URL. ```bash git clone git:// ``` -------------------------------- ### Cloning Ubuntu Kernel Sources via HTTPS Protocol Source: https://github.com/canonical/kernel-docs/blob/main/docs/explanation/ubuntu-linux-kernel-sources.md Use the HTTPS protocol for both public and private repositories, offering easier access. Authentication is required for private repositories. Replace with the actual repository URL. ```bash git clone https:// ``` -------------------------------- ### Run kernel selftests Source: https://github.com/canonical/kernel-docs/blob/main/docs/how-to/testing-verification/test-kernel-in-proposed.md Compiles and runs the built-in Linux selftests to test kernel functionality. Requires downloading kernel source and navigating to the working directory. ```bash apt source linux-image-unsigned-$(uname -r) cd sudo make -C tools/testing/selftests run_tests ``` -------------------------------- ### Update Package List Source: https://github.com/canonical/kernel-docs/blob/main/docs/how-to/source-code/enable-source-repositories.md Run this command after modifying your APT sources to apply the changes. ```shell sudo apt update ``` -------------------------------- ### Cloning Ubuntu Kernel Sources via SSH Protocol Source: https://github.com/canonical/kernel-docs/blob/main/docs/explanation/ubuntu-linux-kernel-sources.md Use the SSH protocol for private repositories requiring write access. Authentication is handled via SSH keys. Replace with the actual repository URL. ```bash git clone git+ssh:// ``` -------------------------------- ### Set Sphinx Host for Remote/VM Development Source: https://github.com/canonical/kernel-docs/blob/main/README.md Export the SPHINX_HOST environment variable to 0.0.0.0 for remote or VM development environments. ```bash export SPHINX_HOST=0.0.0.0 ``` -------------------------------- ### Backported Patch Provenance (Clean) Source: https://github.com/canonical/kernel-docs/blob/main/docs/reference/stable-patch-format.md For patches that are simple cherry-picks from an upstream repository and apply cleanly, indicate this using the specified format. ```none (cherry picked from commit ) ``` -------------------------------- ### Run Automatic Documentation Checks Locally Source: https://github.com/canonical/kernel-docs/blob/main/docs/how-to/contribute.md Executes local checks for spelling, link validation, and inclusive language before committing changes. These checks mirror those run by GitHub. ```bash make spelling make linkcheck make woke ``` -------------------------------- ### Add support for cross-compilation architecture Source: https://github.com/canonical/kernel-docs/blob/main/docs/how-to/develop-customise/build-kernel-snap.md Add the target architecture, e.g., 'arm64', to supported architectures for cross-compilation. This is required when the build machine architecture differs from the target device. ```shell sudo dpkg --add-architecture arm64 sudo apt update ```