6ba03af70f05a197b7bdb55e704253f780bdf432
[AGL/documentation.git] / docs / 4_APIs_and_Services / 4.5_Message_Signaling / 2_AGL_Service_CAN_Low_Level / 3_Installation-J1939.md
1 ---
2 edit_link: ''
3 title: Installation Guide for J1939
4 origin_url: >-
5   https://git.automotivelinux.org/apps/agl-service-can-low-level/plain/docs/3-Installation-J1939.md?h=master
6 ---
7
8 <!-- WARNING: This file is generated by fetch_docs.js using /home/boron/Documents/AGL/docs-webtemplate/site/_data/tocs/apis_services/master/agl-service-can-low-level-developer-guides-api-services-book.yml -->
9
10 # Installation j1939 for AGL
11
12 #### Minimum kernel version : 4.19
13
14 ## Compilation of kernel j1939
15
16 ##### Clone linux-can-next repository on kernel.org
17
18 ```bash
19 git clone https://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git/
20 ```
21
22 ##### Checkout on j1939 branch
23
24 ```bash
25 git checkout j1939
26 ```
27
28 ##### Add the compilation of the j1939
29
30 ```bash
31 make menuconfig
32         - Networking Support
33                 - Can bus subsystem support
34                         - <M> SAE J1939
35                         - [*]   debug SAE J1939
36 ```
37
38 ##### Compile
39
40 ```bash
41 make
42 ```
43
44 ##### Install
45
46 ```bash
47 make modules_install
48 make install
49 ```
50
51 ##### Update grub
52
53 ###### CentOS/RHEL/Oracle/Scientific and Fedora Linux
54
55 ```bash
56 grub2-mkconfig -o /boot/grub2/grub.cfg
57 grubby --set-default /boot/vmlinuz-...
58 reboot
59 ```
60
61 ###### Debian/Ubuntu Linux
62
63 ```bash
64 update-grub
65 reboot
66 ```
67
68 ##### Check if the installation is correct
69
70 ```bash
71 modprobe can-j1939
72 ```
73
74 If no errors are generated you have successfully install a kernel with j1939 module.
75
76 You can have a problem with header file, to check that go in the file /usr/include/linux/can.h
77
78 ```bash
79 vi /usr/include/linux/can.h
80 ```
81
82 If in the struct sockaddr_can you don't see j1939, the header are not upgrade.
83
84 So you need to do this manually, go to you're linux-can-next repository and do the following command:
85
86 ```bash
87 cp include/uapi/linux/can.h /usr/include/linux/can.h
88 cp include/uapi/linux/can/j1939.h /usr/include/linux/can/
89 ```
90