Supported commands: ls, cd ${PATH}

Linux Kernel Dev Env Configuration

Sep. 2, 2021

Host

sudo apt install snapd

# https://multipass.run/docs/installing-on-linux
sudo snap install multipass

# https://multipass.run/docs/using-libvirt
sudo apt install libvirt-daemon-system

sudo snap connect multipass:libvirt

sudo multipass stop --all

sudo multipass set local.driver=libvirt

# https://multipass.run/docs/launch-command
sudo multipass launch -n mp

# Check libvirt
virsh console mp

Guest

vi /etc/default/grub

GRUB_DEFAULT=3
GRUB_TIMEOUT_STYLE=menu
GRUB_TIMEOUT=3

update-grub2
# https://kernelnewbies.org/KernelBuild
sudo apt-get install libncurses5-dev gcc make git exuberant-ctags bc libssl-dev flex bison libelf-dev

git clone https://kernel.googlesource.com/pub/scm/linux/kernel/git/netdev/net-next.git

cd net-next

cp /boot/config-`uname -r`* .config
make menuconfig

- Networking support
    Networking options: enable all

- Kernel hacking
    printk and dmesg options: enable all
    Memory Debugging: enable all
    Lock Debugging: enable all, disable torture tests for locking

# scripts/config --set-str SYSTEM_TRUSTED_KEYS ""
# scripts/config --set-str SYSTEM_REVOCATION_KEYS ""
make -j$(nproc) # C=1 W=1

make modules

make modules_install install

update-grub2

reboot

net-next/

# Do patch
# vi ${FILE}

./scripts/checkpatch.pl ${FILE}

# git commit
ipv6: Change return type from int to void for mld_process_v2

The mld_process_v2 only returned 0.
So, the return type is changed to void.

Signed-off-by: First Last <${EMAIL}@gmail.com>

# git format-patch
git format-patch -o patches/ --subject-prefix="PATCH" ${SHA}^

# Check patch
./scripts/checkpatch.pl patches/${PATCH}

# git config
git config --global sendemail.smtpuser "${EMAIL}@gmail.com"
git config --global sendemail.smtpserver smtp.gmail.com
git config --global sendemail.smtpserverport 465
git config --global sendemail.smtpencryption ssl

./scripts/get_maintainer.pl patches/${PATCH}

git send-email --to="" --cc="" patches/${PATCH}

# https://staticthinking.wordpress.com/2022/07/27/how-to-send-a-v2-patch/

Results

https://git.kernel.org/pub/scm/linux/kernel/git/netdev/net.git/commit/?id=3f22bb137eb03ab27eaaa8b40d3e072eb541444e