04-21-2020 07:00 PM
Hey Linux RT Community,
I'm trying to add SCTP support to the latest RT PXI image 2019 Q4 according to NI Package Manger.
To do this I'm trying to rebuild the kernel and add the SCTP support but I'm having trouble getting the make to work properly. I have a hunch that I'm not setting my target up specifically but I can't figure out how I would change the current .config, or Makefile file to do so.
Generally these are the commands that I'm running.
opkg update
opkg install packagegroup-core-sdk-dev
git clone https://github.com/ni/linux.git
cd linux
git checkout nilrt/19.0/4.14
export ARCH=x86_64
make nati_x86_64_defconfig
make -j6 ni-pkg
Here is the only thing I'm changing in the config file using the GUI "make menuconfig"
Below is a direct output from my terminal.
admin@NI-sub6-gNB-LVQ42019:~# mkdir update-kernel
admin@NI-sub6-gNB-LVQ42019:~# ls
update-kernel/
admin@NI-sub6-gNB-LVQ42019:~# ls
update-kernel/
admin@NI-sub6-gNB-LVQ42019:~# cd update-kernel/
admin@NI-sub6-gNB-LVQ42019:~/update-kernel# git clone https://github.com/ni/linux.git
Cloning into 'linux'...
remote: Enumerating objects: 21, done.
remote: Counting objects: 100% (21/21), done.
remote: Compressing objects: 100% (20/20), done.
remote: Total 5843245 (delta 2), reused 4 (delta 1), pack-reused 5843224
Receiving objects: 100% (5843245/5843245), 1.22 GiB | 23.23 MiB/s, done.
Resolving deltas: 100% (4933474/4933474), done.
admin@NI-sub6-gNB-LVQ42019:~/update-kernel# cd linux
admin@NI-sub6-gNB-LVQ42019:~/update-kernel/linux# git checkout nilrt/19.0/4.14
Checking out files: 100% (61419/61419), done.
Branch 'nilrt/19.0/4.14' set up to track remote branch 'nilrt/19.0/4.14' from 'origin'.
Switched to a new branch 'nilrt/19.0/4.14'
admin@NI-sub6-gNB-LVQ42019:~/update-kernel/linux# export CROSS_COMPILE=/usr/bin/
admin@NI-sub6-gNB-LVQ42019:~/update-kernel/linux# export ARCH=x86_64
admin@NI-sub6-gNB-LVQ42019:~/update-kernel/linux# make menuconfig
scripts/Makefile.host:102: warning: overriding recipe for target 'scripts/basic/fixdep'
scripts/basic/Makefile:22: warning: ignoring old recipe for target 'scripts/basic/fixdep'
HOSTCC scripts/basic/fixdep
HOSTCC scripts/kconfig/mconf.o
SHIPPED scripts/kconfig/zconf.tab.c
SHIPPED scripts/kconfig/zconf.lex.c
HOSTCC scripts/kconfig/zconf.tab.o
HOSTCC scripts/kconfig/lxdialog/checklist.o
HOSTCC scripts/kconfig/lxdialog/util.o
HOSTCC scripts/kconfig/lxdialog/inputbox.o
HOSTCC scripts/kconfig/lxdialog/textbox.o
HOSTCC scripts/kconfig/lxdialog/yesno.o
HOSTCC scripts/kconfig/lxdialog/menubox.o
HOSTLD scripts/kconfig/mconf
scripts/kconfig/mconf Kconfig
#
# using defaults found in arch/x86/configs/x86_64_defconfig
#
*** End of the configuration.
*** Execute 'make' to start the build or try 'make help'.
admin@NI-sub6-gNB-LVQ42019:~/update-kernel/linux# make nati_x86_64_defconfig
scripts/Makefile.host:102: warning: overriding recipe for target 'scripts/basic/fixdep'
scripts/basic/Makefile:22: warning: ignoring old recipe for target 'scripts/basic/fixdep'
HOSTCC scripts/kconfig/conf.o
HOSTLD scripts/kconfig/conf
#
# configuration written to .config
#
admin@NI-sub6-gNB-LVQ42019:~/update-kernel/linux# make -j6 ni-pkg
scripts/Makefile.host:102: warning: overriding recipe for target 'scripts/basic/fixdep'
scripts/basic/Makefile:22: warning: ignoring old recipe for target 'scripts/basic/fixdep'
scripts/kconfig/conf --silentoldconfig Kconfig
CHK include/config/kernel.release
UPD include/config/kernel.release
make all
scripts/Makefile.host:102: warning: overriding recipe for target 'scripts/basic/fixdep'
scripts/basic/Makefile:22: warning: ignoring old recipe for target 'scripts/basic/fixdep'
SYSTBL arch/x86/include/generated/asm/syscalls_32.h
SYSHDR arch/x86/include/generated/asm/unistd_32_ia32.h
SYSHDR arch/x86/include/generated/asm/unistd_64_x32.h
SYSTBL arch/x86/include/generated/asm/syscalls_64.h
HOSTCC scripts/basic/bin2c
CHK include/config/kernel.release
SYSHDR arch/x86/include/generated/uapi/asm/unistd_32.h
SYSHDR arch/x86/include/generated/uapi/asm/unistd_64.h
CHK include/generated/uapi/linux/version.h
UPD include/generated/uapi/linux/version.h
SYSHDR arch/x86/include/generated/uapi/asm/unistd_x32.h
DESCEND objtool
HOSTCC /home/admin/update-kernel/linux/tools/objtool/fixdep.o
HOSTLD /home/admin/update-kernel/linux/tools/objtool/fixdep-in.o
LINK /home/admin/update-kernel/linux/tools/objtool/fixdep
CC /home/admin/update-kernel/linux/tools/objtool/exec-cmd.o
CC /home/admin/update-kernel/linux/tools/objtool/help.o
CC /home/admin/update-kernel/linux/tools/objtool/pager.o
GEN /home/admin/update-kernel/linux/tools/objtool/arch/x86/lib/inat-tables.c
CC /home/admin/update-kernel/linux/tools/objtool/arch/x86/decode.o
LD /home/admin/update-kernel/linux/tools/objtool/arch/x86/objtool-in.o
CC /home/admin/update-kernel/linux/tools/objtool/builtin-check.o
CC /home/admin/update-kernel/linux/tools/objtool/builtin-orc.o
CC /home/admin/update-kernel/linux/tools/objtool/parse-options.o
CC /home/admin/update-kernel/linux/tools/objtool/check.o
CC /home/admin/update-kernel/linux/tools/objtool/run-command.o
CC /home/admin/update-kernel/linux/tools/objtool/orc_gen.o
CC /home/admin/update-kernel/linux/tools/objtool/sigchain.o
CC /home/admin/update-kernel/linux/tools/objtool/orc_dump.o
CC /home/admin/update-kernel/linux/tools/objtool/subcmd-config.o
CC /home/admin/update-kernel/linux/tools/objtool/elf.o
CC /home/admin/update-kernel/linux/tools/objtool/special.o
LD /home/admin/update-kernel/linux/tools/objtool/libsubcmd-in.o
CC /home/admin/update-kernel/linux/tools/objtool/objtool.o
AR /home/admin/update-kernel/linux/tools/objtool/libsubcmd.a
CC /home/admin/update-kernel/linux/tools/objtool/libstring.o
CC /home/admin/update-kernel/linux/tools/objtool/str_error_r.o
HOSTCC arch/x86/tools/relocs_32.o
WRAP arch/x86/include/generated/asm/clkdev.h
WRAP arch/x86/include/generated/asm/dma-contiguous.h
WRAP arch/x86/include/generated/asm/early_ioremap.h
WRAP arch/x86/include/generated/asm/mcs_spinlock.h
WRAP arch/x86/include/generated/asm/mm-arch-hooks.h
HOSTCC arch/x86/tools/relocs_64.o
HOSTCC arch/x86/tools/relocs_common.o
scripts/Makefile.host:102: warning: overriding recipe for target 'scripts/recordmcount'
scripts/Makefile:37: warning: ignoring old recipe for target 'scripts/recordmcount'
scripts/Makefile.host:111: warning: overriding recipe for target 'scripts/genksyms/genksyms'
scripts/genksyms/Makefile:31: warning: ignoring old recipe for target 'scripts/genksyms/genksyms'
scripts/Makefile.host:119: warning: overriding recipe for target 'scripts/genksyms/genksyms.o'
scripts/genksyms/Makefile:25: warning: ignoring old recipe for target 'scripts/genksyms/genksyms.o'
scripts/Makefile.host:119: warning: overriding recipe for target 'scripts/genksyms/lex.lex.o'
scripts/genksyms/Makefile:28: warning: ignoring old recipe for target 'scripts/genksyms/lex.lex.o'
scripts/Makefile.host:119: warning: overriding recipe for target 'scripts/genksyms/parse.tab.o'
scripts/genksyms/Makefile:28: warning: ignoring old recipe for target 'scripts/genksyms/parse.tab.o'
LD /home/admin/update-kernel/linux/tools/objtool/objtool-in.o
HOSTCC scripts/genksyms/genksyms.o
LINK /home/admin/update-kernel/linux/tools/objtool/objtool
SHIPPED scripts/genksyms/parse.tab.c
SHIPPED scripts/genksyms/lex.lex.c
scripts/Makefile.host:111: warning: overriding recipe for target 'scripts/mod/modpost'
scripts/mod/Makefile:43: warning: ignoring old recipe for target 'scripts/mod/modpost'
scripts/Makefile.host:119: warning: overriding recipe for target 'scripts/mod/file2alias.o'
scripts/mod/Makefile:39: warning: ignoring old recipe for target 'scripts/mod/file2alias.o'
scripts/Makefile.host:119: warning: overriding recipe for target 'scripts/mod/modpost.o'
scripts/mod/Makefile:39: warning: ignoring old recipe for target 'scripts/mod/modpost.o'
scripts/Makefile.host:119: warning: overriding recipe for target 'scripts/mod/sumversion.o'
scripts/mod/Makefile:39: warning: ignoring old recipe for target 'scripts/mod/sumversion.o'
make[4]: *** No rule to make target '/home/admin/update-kernel/linux/scripts/mod/elfconfig.h', needed by 'scripts/mod/modpost.o'. Stop.
make[4]: *** Waiting for unfinished jobs....
make[3]: *** [scripts/Makefile.build:585: scripts/mod] Error 2
make[3]: *** Waiting for unfinished jobs....
SHIPPED scripts/genksyms/parse.tab.h
HOSTCC scripts/genksyms/parse.tab.o
HOSTCC scripts/genksyms/lex.lex.o
HOSTLD arch/x86/tools/relocs
HOSTLD scripts/genksyms/genksyms
make[2]: *** [Makefile:572: scripts] Error 2
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [scripts/package/Makefile:106: ni-pkg] Error 2
make: *** [Makefile:1371: ni-pkg] Error 2
04-30-2020 05:46 PM
After a lot of debugging I tried these steps out and was able to build the new kernel with SCTP.
#installing packages
opkg update
opkg install packagegroup-core-sdk-dev
opkg update
opkg install gcc gcc-symlinks
opkg install cpp cpp-symlinks
opkg install g++ g++-symlinks
opkg install bzip2
opkg install bzip2-dev
opkg install libbz2-dev
opkg install libc6
opkg install libgcc-s-dev
opkg install binutils
opkg install binutils-symlinks
opkg install git
opkg install libstdc++-dev
opkg install make
opkg install wget
#getting the repo
git clone https://github.com/ni/linux.git
cd linux
git checkout nilrt/19.1/4.14
export CROSS_COMPILE=/usr/bin/
export ARCH=x86_64
#configure the .config file using the GUI
make menuconfig
#add to the config file (note sometimes this undoes the SCTP check so go back in the GUI load the .config and recheck SCTP)
make nati_x86_64_defconfig
#if you can get the elfconfig.h
cd ~/linux/scripts/mod/
cp x86_64-nilrt-linux-elfconfig.h elfconfig.h
#If you get argument list too long (https://unix.stackexchange.com/questions/45583/argument-list-too-long-how-do-i-deal-with-it-without-...)
ulimit -s 65536
vi ./scripts/package/export-kernel-headers.sh
#define MAX_ARG_PAGES 32
#install squash
git clone https://github.com/plougher/squashfs-tools.git
cd squashfs-tools/squashfs-tools
make
make install
#Once all that is done I was able to get the make to run!
make -j6 ni-pkg
10-03-2021 04:00 AM
Was very helpful. I ran into similar issue and without this I couldn't solve it. Just want to add another thread about squashfs file that gets added at the end and the instruction is bit different for newer kernels (I was using 21.0). Please follow this https://github.com/ni/nilrt/issues/63