WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Build a new version based on raspberry kernel 4  (Read 6829 times)

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Build a new version based on raspberry kernel 4
« on: July 19, 2015, 01:32:33 AM »
Hi

I'm trying to build a new version build on the now default kernel from raspberry (at the moment 4.0.8). I will report my findings and the problems I have so far:

At first it would not allow the use of zram. Therefore piCore froze during boot. This could be overcome by inclusion of the bootcode "nozswap".
However, by adding this to the .config file before building the kernel also fixed the problem:
CONFIG_ZSMALLOC=y
CONFIG_ZCACHE=y
CONFIG_ZRAM=y

Next, I now have a problem with mounting the loop devices.
I have enabled it in menuconfig. If I test it with:
ls -l /dev/loop*

I get
crw--------    1 root    root     10    237   jan 1  1970     /dev/loop-control
brw-rw------ 1 root    staff     7,        0   jul  19 08:03   /dev/loop0
brw-rw------ 1 root    staff     7,        1   jan 1  1970     /dev/loop1
brw-rw------ 1 root    staff     7,        2   jan 1  1970     /dev/loop2
brw-rw------ 1 root    staff     7,        3   jan 1  1970     /dev/loop3
brw-rw------ 1 root    staff     7,        4   jan 1  1970     /dev/loop4
brw-rw------ 1 root    staff     7,        5   jan 1  1970     /dev/loop5
brw-rw------ 1 root    staff     7,        6   jan 1  1970     /dev/loop6
brw-rw------ 1 root    staff     7,        7   jan 1  1970     /dev/loop7

However during boot it will not mount the loop devices so I get the following errors:
mount: mounting /dev/loop0 on /tmp/tcloop/dropbear failed: no such device
mount: mounting /dev/loop0 on /tmp/tcloop/busybox-htpd failed: no such device
mount: mounting /dev/loop0 on /tmp/tcloop/libfaad failed: no such device


So if anyone have a good idea on how to overcome this problem with mounting of the loop devices - please help.

Otherwise it seems to boot fine, I can use the "tce" command, and it can get the wanted tcz packages, but it still cant mount the loop devices

Regards
Steen

I can provide the .config file and the kernel and initrd if anyone want to have a look.





Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Build a new version based on raspberry kernel 4
« Reply #1 on: July 19, 2015, 01:44:15 AM »
Steen

I'm using piCore 7.0 alpha on my RPi2 with kernel 4.0.8, GLIBC-2.21, GCC-5.2.0, .... I'm planning to release for public testing in 1-2 weeks.

Regards... Béla
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Re: Build a new version based on raspberry kernel 4
« Reply #2 on: July 19, 2015, 01:48:25 AM »
Hi Belá

This is good news.

For my own education - do you have an idea what is wrong since I have this problem with mounting of the loop devices?
Where should I look?

Steen

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Re: Build a new version based on raspberry kernel 4
« Reply #3 on: July 19, 2015, 01:58:52 AM »
Further info.

If I manually try to mount dropbear like:

sudo mount /dev/loop0 /tmp/tcloop/dropbear

The result is:
mount: mounting /dev/loop0 on /tmp/tcloop/dropbear failed: Input/output error

Steen

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10969
Re: Build a new version based on raspberry kernel 4
« Reply #4 on: July 19, 2015, 02:09:05 AM »
Please start from a known working config, trying to enable things one by one from the rpi default config will take you long.
The only barriers that can stop you are the ones you create yourself.

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Re: Build a new version based on raspberry kernel 4
« Reply #5 on: July 19, 2015, 03:03:03 AM »
Please start from a known working config, trying to enable things one by one from the rpi default config will take you long.

Thanks. I agree and that is what I have been doing before.
Usually I extracted a .config from a piCore that Belá produced. However, I think the jump from 3.18.y to 4.0.y is too large for that to work.
At least this time I couldn't build a working version on 4.0 from a config from a 3.18 piCore.

I therefore think it would be a benefit for us all if we could define the piCore needed options so that they could be added to the config that is used for building the raspberry images from the Raspberry foundation.
The bcm2709_defconfig is used for that purpose (on a RPI2) and if we could figure out which options we need to add to this we would be able to benefit from the rapid development of the raspberry kernel in the piCore community as well.

Thus, For the moment I have these options added to the end of the bcm2709_defconfig file:

#START PICORE SPECIFIC SETTINGS:
CONFIG_CROSS_COMPILE="/cross/tools-master/arm-bcm2708/arm-bcm2708hardfp-linux-gnueabi/bin/arm-bcm2708hardfp-linux-gnueabi-"
CONFIG_LOCALVERSION="-piCore-v7"
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_RD_GZIP=y
CONFIG_HAVE_KERNEL_LZMA=y
CONFIG_HAVE_KERNEL_XZ=y
CONFIG_HAVE_KERNEL_LZO=y
CONFIG_KERNEL_GZIP=y
CONFIG_ZSMALLOC=y
CONFIG_ZCACHE=y
CONFIG_ZRAM=y
CONFIG_BLK_DEV_LOOP_MIN_COUNT=8
CONFIG_BLK_DEV_RAM_COUNT=16
CONFIG_BLK_DEV_RAM_SIZE=4096
#STOP PICORE SPECIFIC SETTINGS:

Then I rename this file to .config , use "make ARCH=arm menuconfig" save the .config and start building the kernel and modules.

But obviously I still need to enable a few important options in the config file before a working version of piCore can be build. I don't think I'm missing much as all other things seems to work if only the loop devices could be mounted.

Steen

My proposal for defining piCore specific options in the config file is well in line with this proposal in the github https://github.com/raspberrypi/linux/issues/1065 and especially if you look at this post here where specific options for making a working Gentoo kernel is discussed: https://github.com/gtgt/gt-overlay/blob/master/patches/sys-kernel/pf-sources/3.11.1-4567_distro-Gentoo-Kconfig.patch

 

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1089
Re: Build a new version based on raspberry kernel 4
« Reply #6 on: July 19, 2015, 05:58:08 AM »
Have you tried the 3.18 config,   And run "make oldconfig"

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Build a new version based on raspberry kernel 4
« Reply #7 on: July 19, 2015, 10:05:25 AM »
My experience is that after defconfig it requires lot of changes in config to get it working and trial and failure cycles, better to forget.

Using .config from a different main kernel version is also problematic, I had many head aches in the past.

The best way is to take a Raspbian kernel config as bases for the same kernel version and make changes on it. For sure it work and can be trusted for common stuff like SD card, USB, Ethernet, etc. What piCore (TC) need is the squashf fs module mandatory to mount TCZ's and optionally zram/zswap for compressed RAM blocks and compressed swap. Good point with Raspbian 4.0.8 is except zswap all necessary moduels enabled, you must enable only zswap to get it working on TC way.

There are smaller issues, that various new hw modules (RTC, USB devices, etc.) are not enabled in the Raspbian config, but it is easy to fix. Also, you may move some modules to the kernel, but all of these are not necessary to have it working.
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline sbp

  • Sr. Member
  • ****
  • Posts: 429
    • piCorePlayer homepage
Re: Build a new version based on raspberry kernel 4
« Reply #8 on: July 19, 2015, 11:07:32 AM »
Thanks

So no easy path!

I'm a little confused about the development at raspberry, there seems to be a move from using spi-bcm2708 towards spi-bcm2835.
This has the consequence that different config files are used.

So what do you build piCore on the 2708 path or have you moved to 2835?

Regards
Steen

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Build a new version based on raspberry kernel 4
« Reply #9 on: July 19, 2015, 02:36:21 PM »

So no easy path!


Why? It is easy to rebuild kernel based on Raspbian, only one setting must be changed. After updating firmware from GITHUB it works. I have done it for armv6 and it was working at first.

There is only one more easier way, to use piCore's boot :)
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1089
Re: Build a new version based on raspberry kernel 4
« Reply #10 on: July 19, 2015, 05:17:52 PM »
Getting it working is normally fast... Working the way you want it.....lol.    Hard to count how many times I had to compile when making major rev changes.

On the odroid,  all I had to add was.

Squashfs
Zram

Offline jgrulich

  • Sr. Member
  • ****
  • Posts: 341
    • GRULICH DESIGN - R&D Lab.
Re: Build a new version based on raspberry kernel 4
« Reply #11 on: August 19, 2015, 12:04:51 AM »
Please share the working config for 4.1.x. kernel build. I need to make the kernel modules and I'm not lucky yet.
I've tried the Raspbian config, but it's not working for TC.

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: Build a new version based on raspberry kernel 4
« Reply #12 on: August 19, 2015, 01:22:25 AM »
Just use

zcat /proc/config.gz

On 4.x it is in a kernel module, you need

sudo modprobe configs

before.


Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline jgrulich

  • Sr. Member
  • ****
  • Posts: 341
    • GRULICH DESIGN - R&D Lab.
Re: Build a new version based on raspberry kernel 4
« Reply #13 on: August 19, 2015, 05:24:09 AM »
That was the issue, the config is in the kernel module. Therefor I was not ale to find it.
Now it moved a step and get error in the scripts/basic/fixdep: gcc: error trying to exec 'as' : execvp: No such a file of directory.

Online Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11256
Re: Build a new version based on raspberry kernel 4
« Reply #14 on: August 19, 2015, 07:24:25 AM »
Hi jgrulich
Quote
... gcc: error trying to exec 'as' : execvp: No such a file of directory.
That means it can't find the assembler which is in binutils.tcz. Is  compile-essentials.tcz  installed?