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 -c 12 -d 128G -m 32G -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

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

# TUI(text-based user interfaces)
- Networking support
    Networking options: enable all

- Kernel hacking
    printk and dmesg options: enable all
    Memory Debugging: enable KASAN
    Lock Debugging: enable Lock debugging, disable torture tests for locking
make -j$(nproc)

make modules

make modules_install install

update-grub2

reboot

net/


# 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 net-next" ${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 --from="" --to="" --cc="" patches/${PATCH}

Results

https://patchwork.kernel.org/project/netdevbpf/patch/20210901153449.26067-1-jiwonaid0@gmail.com/

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