Jump to content

A lot of questions - the hard way to compile a kernel


itsy

Recommended Posts

 

Hello,

 

I'm new in this forum with my Banana Pro I got on christmas. Before I used a Raspberry so I gained a little experience with Linux.

 

For Raspberry nearly every question is asked and answers you could find a lot in internet. But the BananaPi is quite new and so sometimes it is hard to find answers.

 

First I tried to get my Terratec H5 to work and after a lot of research I found out that I need an other driver. Unfortunately the driver "em2884" (still do not know if it works) could not found within Armbian an the odyssey began because I have to compile a kernel.

 

I red a lot of sites to understand what compilin a kernel means, about modules and config. Unfortunately I could not find an complete instuction for Armbian and most times I found answers of questions during compilation but no instructions.

 

For example the Post "Minimum steps to build a kernel module for latest Armbian release" I thought it was a full instruction but only a question. 

Also the post "Build additional DVB kernel module" (with the module I need) began with a little instuction an still I do not know if the answer means that the driver will be in the next release or will only solve the descibed problem. 

 

But enough with examples!

 

I also had a look at the documentation http://www.armbian.com/github/. And first you can read "x86 machine running any OS, 4G ram, SSD, quad core (recommended)". Except on my Banana I do not have  Linux installed. So is it possible to compile the kernel on BananaPro? Or will it take some days to finish?

 

In an Instruction I red that you can use the kernel-config-File from the current system that you do not have to answer all questions about the used hardware. But in the documentation I cant find anything of this file. I'm afraid of doing the wrong configuration and have to reinstall the system (ok I can make a backup before).

 

Looking for the answer of the question where to find the driver to install I red that that it will be in the source code of the big distributions. So do I have to use the source code of Ubuntu or of Armbian? Then I red a post from Igor that there is no sourcecode but headers ...

 

So, where can I find a complete step by step instruction (maybe with explanation)  for compiling a kernel with a new module for (and with?) Armbian?

 

Thanks a lot

Thorsten

 

Link to comment
Share on other sites

First I have to thank you for trying our build script. There was a lot of work to bring the script to this more or less stable state but unfortunately the proper documentation was never done and I have no idea when I'll find time to do it. I do this project as a hobby. It will be once, because people start to ask for it more and more.

 

What you are asking is running a script with changing one single switch:

 

(read this quick info below)

https://github.com/igorpecovnik/lib

KERNEL_CONFIGURE="yes"

Than run the script and choose a board - kernel and distribution

bash compile

It should be possible to compile everything on Banana too.

When you are done and if those changes are working for you, post here what you have enabled that we can put into default config.

Link to comment
Share on other sites

Hello Igor,

 

thank you for your kind reply!

 

I red everything you wrote on your site as documentation but I'am not sure if I understand everything.

 

So if I use youre script and choose KERNEL_CONFIGURE="yes", choose the BananaPro, Jessie and Vanilla-Kernel 4.3.3 and start the compilation, I do not have to choose anything else and at the end I will get the same kernel with same features I could download with your image on your site ?

 

Because on your site http://www.armbian.com/using-armbian-tools/there are so many options and tools I do not understand now ;-)

 

Ok if this is the compilation of kernel, how can I add the driver to the kernel if there are no other questions? And how to get the module em28xx? I red that this would be in the kernel of e.g. Ubuntu. Do I have to extract and copy them anywhere before compiling?

And after that I will get a file? I guess it is named vmlinuz-4.3.3--sunxi ?! And I only have to copy it to /boot and restart my Pi?

Sorry for my questions but I'am a newby but I'am willing to learn so next time I can do it by myself ;-)

Thanks a lot!

 

Link to comment
Share on other sites

ok, for my test I choosed "next" and after that I got a lot of error-messages and problems with unmet dependencies and I'am not able to resolve it - the package could not be found.

I tried to compile on BananaPro

 

Here ist the Log:

 

root@mediacloud:/downloads/kernel# git clone --depth 1 https://github.com/igorpecovnik/lib
Cloning into 'lib'...
remote: Counting objects: 339, done.
remote: Compressing objects: 100% (300/300), done.
remote: Total 339 (delta 59), reused 254 (delta 32), pack-reused 0
Receiving objects: 100% (339/339), 35.18 MiB | 1.00 MiB/s, done.
Resolving deltas: 100% (59/59), done.
Checking connectivity... done.
Checking out files: 100% (359/359), done.
root@mediacloud:/downloads/kernel# cp lib/compile.sh .
root@mediacloud:/downloads/kernel# ./compile.sh
Already up-to-date.
Already on 'master'
Your branch is up-to-date with 'origin/master'.
/downloads/kernel/lib/general.sh: line 107: /downloads/kernel/output/debug/install.log: No such file or directory
[ o.k. ] Preparing [ host ]
/downloads/kernel/lib/general.sh: line 107: /downloads/kernel/output/debug/install.log: No such file or directory
[ o.k. ] Installing package [ dialog ]
/downloads/kernel/lib/general.sh: line 107: /downloads/kernel/output/debug/install.log: No such file or directory
[ o.k. ] Adding repository for jessie [ cross-tools ]
--2016-01-06 21:10:33--  http://emdebian.org/tools/debian/emdebian-toolchain-archive.key
Resolving emdebian.org (emdebian.org)... 212.129.30.188
Connecting to emdebian.org (emdebian.org)|212.129.30.188|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 2398 (2,3K) [application/pgp-keys]
Saving to: ‘STDOUT’

-                                 100%[============================================================>]   2,34K  --.-KB/s   in 0s

2016-01-06 21:10:34 (23,6 MB/s) - written to stdout [2398/2398]
 Armbian building script, http://www.armbian.com | Author: Igor Pecovnik
 qqqqqqqqqqqqqqqqqqqqqqqqlqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqkqqqqqqqqqqqqqqqqqqqqqqqqqqq
                         x Installing 19 host dependencies...                                           x
                         xqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqx
                         x Hit http://httpredir.debian.org jessie/main armhf Packages                   x
                         x Hit http://httpredir.debian.org jessie/main Translation-en                   x
                         x Fetched 736 kB in 25s (28,4 kB/s)                                            x
                         x Reading package lists...                                                     x
                         x Reading package lists...                                                     x
                         x Building dependency tree...                                                  x
                         x Reading state information...                                                 x
                         x Some packages could not be installed. This may mean that you have            x
                         x requested an impossible situation or if you are using the unstable           x
                         x distribution that some required packages have not yet been created           x
                         x or been moved out of Incoming.                                               x
                         x The following information may help to resolve the situation:                 x
                         x                                                                              x
                         x The following packages have unmet dependencies:                              x
                         x  crossbuild-essential-armhf : Depends: g++-arm-linux-gnueabihf (>= 4.9.1-1)  x
                         x  gcc-arm-linux-gnueabihf : Depends: gcc-4.9-arm-linux-gnueabihf (>= 4.9.2-10E: Unable to correct problems,                                you have held broken packages.qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj


/downloads/kernel/lib/general.sh: line 352: update-binfmts: command not found
[ o.k. ] Starting Armbian build script [ @host ]
[ o.k. ] Compiling kernel [ bananapipro ]
[ o.k. ] Syncing clock [ host ]
/downloads/kernel/lib/main.sh: line 229: ntpdate: command not found
[ o.k. ] source downloading [ @host ]
[ o.k. ] ... creating a shallow clone [ u-boot v2015.10 ]
Cloning into '/downloads/kernel/sources/u-boot/v2015.10'...
remote: Counting objects: 11795, done.
remote: Compressing objects: 100% (10616/10616), done.
remote: Total 11795 (delta 2066), reused 4379 (delta 952)
Receiving objects: 100% (11795/11795), 14.67 MiB | 184.00 KiB/s, done.
Resolving deltas: 100% (2066/2066), done.
Checking connectivity... done.
[ o.k. ] ... creating a shallow clone [ linux-vanilla v4.3.3 ]
Cloning into '/downloads/kernel/sources/linux-vanilla/v4.3.3'...
remote: Counting objects: 54688, done.
remote: Compressing objects: 100% (51902/51902), done.
remote: Total 54688 (delta 4324), reused 19391 (delta 2012)
Receiving objects: 100% (54688/54688), 146.24 MiB | 757.00 KiB/s, done.
Resolving deltas: 100% (4324/4324), done.
Checking connectivity... done.
[ o.k. ] ... creating a shallow clone [ sunxi-tools ]
Cloning into '/downloads/kernel/sources/sunxi-tools'...
remote: Counting objects: 53, done.
remote: Compressing objects: 100% (47/47), done.
remote: Total 53 (delta 15), reused 31 (delta 5), pack-reused 0
Unpacking objects: 100% (53/53), done.
Checking connectivity... done.
[ o.k. ] ... creating a shallow clone [ rt8192cu ]
Cloning into '/downloads/kernel/sources/rt8192cu'...
remote: Counting objects: 201, done.
remote: Compressing objects: 100% (177/177), done.
remote: Total 201 (delta 42), reused 126 (delta 21), pack-reused 0
Receiving objects: 100% (201/201), 1.17 MiB | 982.00 KiB/s, done.
Resolving deltas: 100% (42/42), done.
Checking connectivity... done.
[ o.k. ] ... creating a shallow clone [ sunxi-display-changer ]
Cloning into '/downloads/kernel/sources/sunxi-display-changer'...
remote: Counting objects: 9, done.
remote: Compressing objects: 100% (8/8), done.
remote: Total 9 (delta 0), reused 7 (delta 0), pack-reused 0
Unpacking objects: 100% (9/9), done.
Checking connectivity... done.
[ o.k. ] Compiling sunxi tools [ @host & target ]
cp: cannot stat ‘fex2bin’: No such file or directory
cp: cannot stat ‘bin2fex’: No such file or directory
[ o.k. ] Cleaning [ /downloads/kernel/sources/u-boot/v2015.10 ]
[ o.k. ] Cleaning [ /downloads/kernel/sources/linux-vanilla/v4.3.3 ]
[ o.k. ] Started patching process for [ kernel sunxi-next 4.3.3 ]
[ o.k. ] Looking for user patches in [ userpatches/kernel/sunxi-next ]
[ o.k. ] ... 0010-bananapi_m1_plus_dts.patch [ succeeded ]
[ o.k. ] ... 0011-bananapi_m2_dts.patch [ succeeded ]
[ o.k. ] ... 0012-bananapi_r1_dts.patch [ succeeded ]
[ o.k. ] ... 0013-lamobo_r1_dts.patch [ succeeded ]
[ o.k. ] ... Sinoviop-bananas-M2-R1-M1-fixes.patch [ succeeded ]
[ o.k. ] ... allwinner-a10-a20-can-v8.patch [ succeeded ]
[ o.k. ] ... bananapi-r1-switch-driver.patch [ succeeded ]
[ o.k. ] ... brcmfmac_ap_banana_ct.patch [ succeeded ]
[ o.k. ] ... headers-packing.patch [ succeeded ]
[ o.k. ] ... packaging-next.patch [ succeeded ]
[ o.k. ] ... spi_allow_transfer_larger.patch [ succeeded ]
[ o.k. ] ... support_for_second_mmc_cubieboard2.patch [ succeeded ]
[ o.k. ] Started patching process for [ u-boot u-boot-next 2015.10 ]
[ o.k. ] Looking for user patches in [ userpatches/u-boot/u-boot-next ]
[ o.k. ] ... add-awsom-uboot.patch [ succeeded ]
[ o.k. ] ... add-cubieboard4.patch [ succeeded ]
[ o.k. ] ... add-lamobo-r1-uboot.patch [ succeeded ]
[ o.k. ] ... sunxi-boot-splash.patch [ succeeded ]
[ o.k. ] Compiling uboot. Please wait. [ 2015.10 ]
 Armbian building script, http://www.armbian.com | Author: Igor Pecovnik
 qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq







                                         lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
                                         x Compiling u-boot...                                                          x
                                         xqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqx
                                         x   CHK     include/config.h                                                   x
                                         x   UPD     include/config.h                                                   x
                                         x   GEN     include/autoconf.mk                                                x
                                         x /bin/sh: 1: ccache: not found                                                x
                                         x   GEN     include/autoconf.mk.dep                                            x
                                         x /bin/sh: 1: ccache: not found                                                x
                                         x scripts/Makefile.autoconf:72: recipe for target 'include/autoconf.mk' failed x
                                         x make[1]: *** [include/autoconf.mk] Error 1                                   x
                                         x make[1]: *** Waiting for unfinished jobs....                                 x
                                         x scripts/Makefile.autoconf:47: recipe for target 'include/autoconf.mk.dep' fa x
                                         x make[1]: *** [include/autoconf.mk.dep] Error 1                               x
                                         x   GEN     spl/include/autoconf.mk                                            x
                                         x /bin/sh: 1: ccache: not found                                                x
                                         x scripts/Makefile.autoconf:75: recipe for target 'spl/include/autoconf.mk' fa x
                                         x make[1]: *** [spl/include/autoconf.mk] Error 1                               x
                                         x make: *** No rule to make target 'include/config/auto.conf', needed by 'incl x
                                         mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj









[ o.k. ] Target directory [ /downloads/kernel/output/debs/ ]
[ o.k. ] Building deb [ linux-u-boot-next-bananapipro_4.82_armhf.deb ]
[ error ] Building failed, check configuration. [ linux-u-boot-next-bananapipro_4.82_armhf.deb deleted ]
root@mediacloud:/downloads/kernel# cd /lib/Firmware && ls
Link to comment
Share on other sites

You made some progress. The main problem is that you don't use Ubuntu Trusty. There are several reasons why this is mandatory. If you have anything else, you might need to fix few things ... if you don't know how, you need to stick to manual -> Ubuntu Trusty, preferable virtual machine on the desktop.

 

Since you don't have it, you need to run Ubuntu on your Banana. Than, you need to start everything again and if you run into troubles, paste also the log which you will find in output/debug

 

For switches, add also KERNEL_ONLY="yes" if you seek kernel only. The result are .deb files which you install standard way: dpkg -i packaga_name + reboot. If everything goes O.K. it's more simple than you think ;)

 

You will waste some time on this, but the good point is that you will learn something. If you want, I can add what you need to next kernel build and you don't need to do this ...

Link to comment
Share on other sites

@itsy

What kernel version do you have now (output of "uname -r")?

 

Latest mainline (vanilla) kernel should have em28xx driver

#
# Webcam, TV (analog/digital) USB devices
#
CONFIG_VIDEO_EM28XX=m
CONFIG_VIDEO_EM28XX_V4L2=m
CONFIG_VIDEO_EM28XX_ALSA=m
CONFIG_VIDEO_EM28XX_DVB=m
CONFIG_VIDEO_EM28XX_RC=m

Did you try loading em28xx module manually?

Link to comment
Share on other sites

@Igor
Thank you for your kind offer to support this driver officially. But if you would spend the time to advice me, I would like to lern how it works :-)
Now I understand what you mean with hostsystem and Ubuntu. So I setup a VirtualBox with Ubuntu 14.4.3 and will try it the next minutes again.



@zador.blood.stained
The output of uname -r is 4.3.3-sunxi

Then I tried modprobe em28xx

FATAL: Module em28xx not found

 

Link to comment
Share on other sites

Ok, after 45 Minutes the compilation has finished without any errors :-) Great!

 

Now my next questions ;-)

1. If I would install the new kernel now, there is no change to my actual system? Or do I have to change or reconfigure something after installing?
2. When I start the configuration of the script which brunch do I have to choose?
3. With my test I only compiled the standard-kernel without any changes, right? So how to include the new driver now?
4. The directory output/debs now contains 5 files. Which file do I have to install now?

5. When a new update is available, is it with my new installed kernel still possible to upgrade?

Thanks a lot
Thorsten

Link to comment
Share on other sites

1. Just install it, since kernel family and version didn't change (you selected "next" branch, right?).

2, 3 You already compiled it with updated configuration, em28xx module should be present.

4. linux-image one, again, since kernel version didn't change. Otherwise you would need to install matching dtb package as well.

5. It should upgrade fine

Link to comment
Share on other sites

1. jep, I choosed "next"

2. Why I did compiled it with updated configuration? Because the source code I downloaded was updated and so the new kernel has this updates? I did no update ;-)
3. So I will only install the deb named linux-image-next-sunxi_4.82_armhf.deb? New new kernel number is 4.82 instead of 4.3.3 ?
4. What are the other files for and when do I have to install them?
5. If this driver would not be automatically updated - what do I have to do to update or integrate the driver?

Link to comment
Share on other sites

2. Contents of "lib" directory updates each time build process is launched (unless there are changes preventing the update)

3. 4.82 is current Armbian version

4. You don't need to install them, they are already present in the image and will be updated automatically with new Armbian release

5. This driver is part of the kernel, if it works for you now, it should work in the future

Link to comment
Share on other sites

Today I installed the new kernel with the new drivers and it works :-)
The Stick is now available and I can look TV via TVHeadend!!

Thanks a lot!

But what do I have to do if the driver is not automatically included that I only have to compile?

Link to comment
Share on other sites

But what do I have to do if the driver is not automatically included that I only have to compile?

 

Option A: Ask here and it will be included in the next release

 

Option B: Read updated documentation for build script and compile kernel yourself with needed options.

 

For determining what options exactly do you need, there is no simple answer, Google is your best friend for this. Just a hint - for USB devices output of "lsusb" command is very useful to get VID and PID of your device, which should help pionting your search in the right direction.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines