WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Compile Mainline Kernel.  (Read 15993 times)

Offline nxtv2.0

  • Newbie
  • *
  • Posts: 42
Compile Mainline Kernel.
« on: November 18, 2016, 02:27:40 PM »
How do i compile Mainline kernel for Orange Pi Plus 2E ?
I got the repository http://linux-sunxi.org/Mainline_Kernel_Howto#Kernel_source
and
Code: [Select]
make ARCH=arm zImage dtbs
but it returned

Code: [Select]
CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  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 ‘-mno-thumb-interwork’
gcc: error: unrecognized command line option ‘-mfpu=vfp’
Kbuild:45: recipe for target 'kernel/bounds.s' failed
make[1]: *** [kernel/bounds.s] Error 1
Makefile:1027: recipe for target 'prepare0' failed
make: *** [prepare0] Error 2
What am i doing wrong?

Offline jgrulich

  • Sr. Member
  • ****
  • Posts: 341
    • GRULICH DESIGN - R&D Lab.
Re: Compile Mainline Kernel.
« Reply #1 on: November 20, 2016, 12:18:14 PM »
It's really useful to follow the proven tutorial at the link I've sent to you:
https://linux-sunxi.org/Mainline_Kernel_Howto
It's 100% working, I've tested and used it with the Armbian distro at OrangePi PC.

Offline nxtv2.0

  • Newbie
  • *
  • Posts: 42
Re: Compile Mainline Kernel.
« Reply #2 on: November 20, 2016, 07:12:01 PM »
I was running it on ubuntu on x86, i will try it on armbian.
How do i port over the kernel from armbian repository:linux-image-dev-sunxi_5.23_armhf.
I got the vmlinuz and renamed it to zImage, then got the dtb file for Orange-pi-plus-2e and modified boot.scr to boot the kernel like it was descriped in the tutorial.
It boots but ethernet doesn't work.
The serial says:
Code: [Select]
tar: ./run/udev/control: socket ignored
tar: ./dev/log: socket ignored
ifconfig: SIOCGIFFLAGS: No such device
ifconfig: SIOCSIFADDR: No such device
route: SIOCADDRT: Network is unreachable

Offline jgrulich

  • Sr. Member
  • ****
  • Posts: 341
    • GRULICH DESIGN - R&D Lab.
Re: Compile Mainline Kernel.
« Reply #3 on: November 23, 2016, 03:20:27 PM »
Have you found the Gigabit Ethernet Driver for the mainline kernel?

Offline nxtv2.0

  • Newbie
  • *
  • Posts: 42
Re: Compile Mainline Kernel.
« Reply #4 on: November 24, 2016, 09:44:50 AM »
No, i thought it was included.
How do i get it?
I will try your method now.

Offline nxtv2.0

  • Newbie
  • *
  • Posts: 42
Re: Compile Mainline Kernel.
« Reply #5 on: November 24, 2016, 12:11:04 PM »
So the compile worked but ethernet isn't working
Code: [Select]
ifconfig: SIOCGIFFLAGS: No such device
ifconfig: SIOCSIFADDR: No such device
route: SIOCADDRT: Network is unreachable
How do i get the ethernet driver and include in image?
The menu config doesn't work and gives errors.
Code: [Select]
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- menuconfig
The default config works thought.
« Last Edit: November 24, 2016, 12:13:11 PM by nxtv2.0 »

Offline jgrulich

  • Sr. Member
  • ****
  • Posts: 341
    • GRULICH DESIGN - R&D Lab.
Re: Compile Mainline Kernel.
« Reply #6 on: November 25, 2016, 02:27:24 AM »
The Gigabit Ethernet driver is NOT included in the present mainline for sure.
You need to look around and try to find some patch, or wip version with the driver included.
The menuconfig reports error due to missing library, it's mentioned in the compilation tutorial what need to be installed.

Offline nxtv2.0

  • Newbie
  • *
  • Posts: 42
Re: Compile Mainline Kernel.
« Reply #7 on: November 27, 2016, 12:56:03 PM »
How do i find the missing driver and compile kernel with it.

Offline nxtv2.0

  • Newbie
  • *
  • Posts: 42
Re: Compile Mainline Kernel.
« Reply #8 on: November 27, 2016, 01:13:59 PM »
I found this linkhttp://moinejf.free.fr/opi2/ which contains patchs for mainline how do i use them.
It seems that armbian also has ethernet driver for this board as there are some members on there forums reporting ethernet speeds on 4.8 kernel.https://forum.armbian.com/index.php/topic/1906-mainline-kernel-and-dvfs-throttling-thermal-settings/

Offline jgrulich

  • Sr. Member
  • ****
  • Posts: 341
    • GRULICH DESIGN - R&D Lab.
Re: Compile Mainline Kernel.
« Reply #9 on: November 29, 2016, 02:06:42 AM »
Have you tried the official OPi board manufacturer source?
https://github.com/orangepi-xunlong/orangepi_h3_linux

or test this source:
https://github.com/megous/linux

Both of them seems to be well maintained and working.

Offline nxtv2.0

  • Newbie
  • *
  • Posts: 42
Re: Compile Mainline Kernel.
« Reply #10 on: December 07, 2016, 02:29:20 PM »
I tried every kernel source for the h3 including the ones you have mentioned,All give the same error.

Offline jgrulich

  • Sr. Member
  • ****
  • Posts: 341
    • GRULICH DESIGN - R&D Lab.
Re: Compile Mainline Kernel.
« Reply #11 on: December 08, 2016, 03:12:00 PM »
The GBit Ethernet is not enabled by default in the defconfig, you have to enable it first.
Do you have the menuconfig already working, or you have the reported error still there?

Offline nxtv2.0

  • Newbie
  • *
  • Posts: 42
Re: Compile Mainline Kernel.
« Reply #12 on: December 09, 2016, 07:40:14 AM »
I got it to work.
The library missing was curses

Offline jgrulich

  • Sr. Member
  • ****
  • Posts: 341
    • GRULICH DESIGN - R&D Lab.
Re: Compile Mainline Kernel.
« Reply #13 on: December 09, 2016, 04:43:27 PM »
Understand that you have the menuconfig working. And what about the GBit Ethernet?
Is it working too? Which source?

Offline nxtv2.0

  • Newbie
  • *
  • Posts: 42
Re: Compile Mainline Kernel.
« Reply #14 on: December 10, 2016, 04:00:53 AM »
I got the gigabit ethernet to work finally from this kernel + dtb and lib/modules from this source:
https://forum.armbian.com/index.php/topic/3029-mainline-ethernet-driver-h3/
Post no. 11#
But there is a weird issue , top only shows 1 cpu core.