Tiny Core Linux

Tiny Core Base => Other architectures => Topic started by: nxtv2.0 on November 18, 2016, 11:27:40 AM

Title: Compile Mainline Kernel.
Post by: nxtv2.0 on November 18, 2016, 11:27:40 AM
How do i compile Mainline kernel for Orange Pi Plus 2E ?
I got the repository http://linux-sunxi.org/Mainline_Kernel_Howto#Kernel_source (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?
Title: Re: Compile Mainline Kernel.
Post by: jgrulich on November 20, 2016, 09:18:14 AM
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.
Title: Re: Compile Mainline Kernel.
Post by: nxtv2.0 on November 20, 2016, 04: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
Title: Re: Compile Mainline Kernel.
Post by: jgrulich on November 23, 2016, 12:20:27 PM
Have you found the Gigabit Ethernet Driver for the mainline kernel?
Title: Re: Compile Mainline Kernel.
Post by: nxtv2.0 on November 24, 2016, 06:44:50 AM
No, i thought it was included.
How do i get it?
I will try your method now.
Title: Re: Compile Mainline Kernel.
Post by: nxtv2.0 on November 24, 2016, 09:11:04 AM
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.
Title: Re: Compile Mainline Kernel.
Post by: jgrulich on November 24, 2016, 11:27:24 PM
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.
Title: Re: Compile Mainline Kernel.
Post by: nxtv2.0 on November 27, 2016, 09:56:03 AM
How do i find the missing driver and compile kernel with it.
Title: Re: Compile Mainline Kernel.
Post by: nxtv2.0 on November 27, 2016, 10:13:59 AM
I found this linkhttp://moinejf.free.fr/opi2/ (http://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/ (https://forum.armbian.com/index.php/topic/1906-mainline-kernel-and-dvfs-throttling-thermal-settings/)
Title: Re: Compile Mainline Kernel.
Post by: jgrulich on November 28, 2016, 11:06:42 PM
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.
Title: Re: Compile Mainline Kernel.
Post by: nxtv2.0 on December 07, 2016, 11:29:20 AM
I tried every kernel source for the h3 including the ones you have mentioned,All give the same error.
Title: Re: Compile Mainline Kernel.
Post by: jgrulich on December 08, 2016, 12: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?
Title: Re: Compile Mainline Kernel.
Post by: nxtv2.0 on December 09, 2016, 04:40:14 AM
I got it to work.
The library missing was curses
Title: Re: Compile Mainline Kernel.
Post by: jgrulich on December 09, 2016, 01:43:27 PM
Understand that you have the menuconfig working. And what about the GBit Ethernet?
Is it working too? Which source?
Title: Re: Compile Mainline Kernel.
Post by: nxtv2.0 on December 10, 2016, 01: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/ (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.
Title: Re: Compile Mainline Kernel.
Post by: jgrulich on December 13, 2016, 01:20:53 PM
Great, let's share with others and include the simple how-to and kernel config.
Title: Re: Compile Mainline Kernel.
Post by: nxtv2.0 on December 14, 2016, 06:32:39 AM
The post i mentioned has a precompiled kernel.
For the multicore issue, i was using the SVC version of uboot.
after switching to hyp it worked flawlessly.
Title: Re: Compile Mainline Kernel.
Post by: jgrulich on December 15, 2016, 01:20:50 AM
OK, but this kernel doesn't support zswap therefor not fully optimized for piCore.
Title: Re: Compile Mainline Kernel.
Post by: nxtv2.0 on December 18, 2016, 01:34:59 PM
How do i enable zswap in compile.
And what does it do?
Title: Re: Compile Mainline Kernel.
Post by: bmarkus on December 18, 2016, 01:47:30 PM
How do i enable zswap in compile.
And what does it do?

Check piCore kernel config