Skip to content

Instantly share code, notes, and snippets.

@mr-sour
Last active June 18, 2018 19:20
Show Gist options
  • Save mr-sour/225092cb4ce6b2514bed726f367708ae to your computer and use it in GitHub Desktop.
Save mr-sour/225092cb4ce6b2514bed726f367708ae to your computer and use it in GitHub Desktop.

This guide is for fedora

clone j1939 linux kernel branch git clone git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git

cd linux-can-next

switch to j1939 branch

copy your current kernel config cp /boot/config-uname -r* .config

enable networking>can>SAE J1939 useing make menuconfig

save your configuration

Change the EXTRAVERSION line to add something on the end. For example, if it reads "EXTRAVERSION = -rc5" change it to "EXTRAVERSION = -rc5-dave" (what you choose is only relevant for the final part of this procedure)

$EDITOR Makefile

build and install kernel

$ make oldconfig

$ make bzImage

$ make modules

(become root)

make modules_install

make install

sudo rsync -a ./usr/include /usr/

should probally fix this with a command from here https://www.kernel.org/doc/Documentation/kbuild/headers_install.txt

You have now built and installed a kernel. It will show up in the grub menu next time you reboot. if it doesn't shot up as root for a efi boot system

sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

remove kernel

rm -f /boot/config-2.6.*dave* /boot/initrd-2.6.*dave* /boot/vmlinuz-*dave* /boot/System.map-*dave* rm -rf /lib/modules/2.6*dave* to remove the grub entry sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment