LAB 3: Building the SoC FPGA Linux Kernel

I tried to do the RocketBoards Workshop
"LAB 3: Building the SoC FPGA Linux Kernel"
Internetlink: https://rocketboards.org/foswiki/view/Documentation/WS2LinuxKernelIntroductionForAlteraSoCDevicesLab4SoCFPGALinuxKernel
Everything worked, except the last two commands:

$ make ARCH=arm menuconfig
produces Errors:
HOSTCC scripts/kconfig/mconf.o
In file included from scripts/kconfig/mconf.c:23:0:
scripts/kconfig/lxdialog/dialog.h:38:20: fatal error: curses.h: No such file or directory
#include CURSES_LOC
^
compilation terminated.
make[1]: *** [scripts/kconfig/mconf.o] Error 1
make: *** [menuconfig] Error 2

$ make ARCH=arm LOCALVERSION= zImage
produces Errors:
CHK include/config/kernel.release
CHK include/generated/uapi/linux/version.h
CHK include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h’ is up to date.
CC kernel/bounds.s
gcc: error: unrecognized argument in option ‘-mabi=aapcs-linux’
gcc: note: valid arguments to ‘-mabi=’ are: ms sysv
gcc: error: unrecognized command line option ‘-mlittle-endian’
gcc: error: unrecognized command line option ‘-mapcs’
gcc: error: unrecognized command line option ‘-mno-sched-prolog’
gcc: error: unrecognized command line option ‘-mno-thumb-interwork’
gcc: error: unrecognized command line option ‘-mfpu=vfp’
make[1]: *** [kernel/bounds.s] Error 1
make: *** [prepare0] Error 2

Question:

  1. Does anybody know a solution for the problem?
  2. I tried a hint ‘make oldconfig’ but it doesn’t worked either.
  3. What I understand is that a .config File is produced, which I neeed to produce the zImage.
    Is it possible to get the .config File direct for DE1-SoC Board (Cyclone V) ?

Kind Regards

1 Like

Hi gerhard227,

Your first error shows that your environment is not correctly set for Linux kernel compilation. Packages such as ncurses or ncurses-dev are required here and you don’t have them on your build system.

Try to install: ncurses-devel and ncurses (or libncurses5 and libncurses5-dev) packages from your Linux distribution package manager (yum, apt-get…).

Your second error is about the same problem, your environment is not set. Which cross-compiler is installed on your build system ?

I will recommend to check some tutorials about Linux kernel cross-compilation (setup and steps), before going any further.

Regards,
Gilles.

1 Like

Thank you very much for your answer.
The first hint helps.
After installing libncurses5 and libncurses5-dev "make ARCH=arm menuconfig " works.
Second error is still there.
I have cross-compiler “gcc-linaro-5.2-2015.11-2-x86_64_arm-linux-gnueabihf”.
(used also in Rocketboards Tutorial LAB2: U-Boot)
Kind regards
Gerhard

How is set your cross-compiler in your environment ? Did you update your PATH environment variable ?

Because looking at your command line above, you are not using the CROSS_COMPILE=<path/to/compiler>/, e.g:

$ make ARCH=arm CROSS_COMPILE=/home/ciele/workstation/compilers/arm/gcc-linaro-arm-linux-gnueabihf-4.9-2014.06_linux/bin/arm-linux-gnueabihf-

Have a look at: ARCH, CROSS_COMPILE, O and -jN swtiches usage for Linux kernel compilation maybe useful in your case.

Now I have a zImage produced with the following command line:
sudo make -j8 ARCH=arm CROSS_COMPILE=$PWD/gcc-linaro-5.2-2015.11-2-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- zImage

Here are the last messages from console-window:
AS arch/arm/boot/compressed/piggy.gzip.o
LD arch/arm/boot/compressed/vmlinux
OBJCOPY arch/arm/boot/zImage
Kernel: arch/arm/boot/zImage is ready

Now I have to test, if zImage is working.
Thank you very much for your hints.
Kind regards
Gerhard

Hi…as per my knowledge packages such as ncurses or ncurses-dev are required here and you don’t have them on your build system.Use this ncurses-devel and ncurses (or libncurses5 and libncurses5-dev) packages from your Linux distribution package manager.

turn key pcb

Thank you very much for your response.
Meanwhile I had success creating an zImage.
Two things are very important:

  1. Installing “libncurses5 and libncurses5-dev)” as you mentioned.
  2. buildroot as descriped in Tutorial: "https://rocketboards.org/foswiki/view/Documentation/BuildrootForSoCFPGA"
    to have an correct .config-File that is compartible to Compiler "gcc-linaro-arm-linux-gnueabihf-4.9-2014.09_linux.tar.xz"
    Kind regards
    Gerhard
1 Like