raspbian kernel


56 posts   Page 2 of 3   1, 2, 3
by Lorian » Tue Jun 19, 2012 6:43 am
For the foundation's build they seem to maintain two .config's:

# find . -name *bcmrpi*config -print
./arch/arm/configs/bcmrpi_emergency_defconfig
./arch/arm/configs/bcmrpi_defconfig
./arch/arm/configs/bcmrpi_cutdown_defconfig

The cut-down one builds to about 4Mb and the default one builds to about 6Mb on disk.
Posts: 112
Joined: Sun Mar 11, 2012 10:09 am
by chrisw2 » Tue Jun 19, 2012 12:55 pm
SirLagz wrote:Why not just roll your own kernel with the features you need if you already know how to do it ?
...

I suppose because I thought one of the stated aims of Raspbian was to as much like an official debian distribution as possible and all the debian distributions I've had experience of (i386 & armel) have included a packaged default kernel that handles most configurations "out the box". I can see why the foundation would like a small quick loading kernel as their default but not why Raspbian would.

Lorian wrote:For the foundation's build they seem to maintain two .config's:

# find . -name *bcmrpi*config -print
./arch/arm/configs/bcmrpi_emergency_defconfig
./arch/arm/configs/bcmrpi_defconfig
./arch/arm/configs/bcmrpi_cutdown_defconfig

The cut-down one builds to about 4Mb and the default one builds to about 6Mb on disk.


Thanks, I guess I'll be investigating that some time soon...
Posts: 106
Joined: Sat Apr 07, 2012 11:22 am
Location: Manchester, UK
by mpthompson » Tue Jun 19, 2012 4:36 pm
chrisw2 wrote:I suppose because I thought one of the stated aims of Raspbian was to as much like an official debian distribution as possible and all the debian distributions I've had experience of (i386 & armel) have included a packaged default kernel that handles most configurations "out the box". I can see why the foundation would like a small quick loading kernel as their default but not why Raspbian would.


This is the intention with the Raspbian kernel. To track the Debian kernel features as close as possible. However, as the kernel package is developed, this will very likely be an iterative process. First, get something working with the changes from the Foundation layered over Debian kernel source. Then refine the configuration to towards alignment with Debian kernel features.
User avatar
Forum Moderator
Forum Moderator
Posts: 620
Joined: Fri Feb 03, 2012 7:18 pm
Location: San Carlos, CA
by plugwash » Tue Jun 19, 2012 5:41 pm
chrisw2 wrote:I have no expertise in kernel compilation (although I have done it in the past) but my reasoning was that a stock debian armel kernel from the official debian repositry installed, for instance, on an NSLU2 seems to include a lot of the things asked for in this thread (eg: iptables. NFS kernel server). I, perhaps foolishly, thought it would be easier to add the Raspberry Pi specific stuff to that, than to start with the cut down foundation kernel and add stuff to it as people gradually discover exactly what is missing over a period of time.

Some kernel options are specific to the board in question

Some kernel options are for stuff needed during boot and since initrd support seems poor on the Pi we really want these built-in (unlike debian who are in the habbit of building everything as modules).

Some kernel options are for hardware that can't possiblly be connected to a Pi so we don't really want to build those.

The ideal would be for someone to go through bootc's kernel configuration and the debian kernel configuration from another board, compare them and based on that propose a config that is as debian like as possible but meeting our other constraints. I get the impression that will be a lot of work though.
Forum Moderator
Forum Moderator
Posts: 2325
Joined: Wed Dec 28, 2011 11:45 pm
by chrisw2 » Tue Jun 19, 2012 6:14 pm
Mike & Plugwash - thanks for answers

plugwash wrote:...

The ideal would be for someone to go through bootc's kernel configuration and the debian kernel configuration from another board, compare them and based on that propose a config that is as debian like as possible but meeting our other constraints. I get the impression that will be a lot of work though.

Okay, I'll bite... can I be of use to create the proposed config? I might need some guidance on occasions though. Please let me know.

I'd never heard of Chris Boot until today but presumably he is considered "the man" for producing Pi kernels?
Posts: 106
Joined: Sat Apr 07, 2012 11:22 am
Location: Manchester, UK
by plugwash » Tue Jun 19, 2012 7:10 pm
AIUI bootc is the guy who forward ported the foundations kernel work to 3.2.x and also wrote some drivers for the SPI I2C etc. I'm using his work in the modified version of the debian kernel packaging i'm preparing.

I've posted two kernel configurations. One is the configuration i'm currently building with (based on what bootc used with some tweaks), the other is the configuration debian uses to build it's mx5 kernel.

http://plugwash.raspbian.org/

Unfortunately things are more complicated than I thought, it seems debian builds it's kernel configurations out of multiple files. It would appear the config.mx5 is not a complete kernel config and has to be combined with other files to make one.
Forum Moderator
Forum Moderator
Posts: 2325
Joined: Wed Dec 28, 2011 11:45 pm
by uberscubajim » Thu Jun 21, 2012 12:31 pm
Hi guys,

I've quite a bit of experience in building kernels but for x86 not for the Pi.

What I'd like to do is be able to build a kernel, ideally the supported 3.2 one (3.2.20 has just been released and bootc has it for the armel Pis). I want to add in some specific modules of my own and give it a blast.

However, bootc's kernel is for armel not armhf so if you try and install the .deb it gets a little annoyed :D

My other concern is that I'm very interested in the hardware acceleration for H.264 video and upgrading the kernel shouldn't stop that from working.

So, I was wondering how the armhf kernel for Raspbian was built. Can I reproduce it? Does it use the standard one? If so that kind of implies that Raspbian is a complete rebuild of everything except
Code: Select all
/boot
which is standard.

Many thanks,

Jim.
Posts: 71
Joined: Thu Jun 21, 2012 12:22 pm
Location: Ipswich, Suffolk. UK.
by plugwash » Thu Jun 21, 2012 1:59 pm
The kernel interface is the same for armel and armhf. I beleive most raspbian images so-far have used a foundation-supplied kernel.

As I said at the beggining of this thread I plan to get our own kernel in raspbian but there are some things I need to sort out before releasing it.
Forum Moderator
Forum Moderator
Posts: 2325
Joined: Wed Dec 28, 2011 11:45 pm
by uberscubajim » Thu Jun 21, 2012 4:32 pm
Hi plugwash, thanks for that.

For reference I've tried out bootc's new 3.2.20 kernel and it works fine except if you use omxplayer in which case a kernel panic occurs about 2 seconds in to watching any video. This is slightly annoying as otherwise it's a much better kernel than the foundation's one (it's not EOLed, doesn't have the known security flaws and has a bucket load of extra modules compiled for it).
Posts: 71
Joined: Thu Jun 21, 2012 12:22 pm
Location: Ipswich, Suffolk. UK.
by chrisw2 » Thu Jun 21, 2012 11:25 pm
plugwash wrote:When asking for features can you please tell me the exact options you want setting in the kernel configuration.

Thanks

Is the format below okay?

Requested changes to kernel config (in terms of "menuconfig" options) for any future raspbian kernel package

1) Add support for NFS kernel server:
File Systems --->
Network File Systems --->
<M> NFS Server Support
<M> NFS Server Support for NFS version 3
<M> NFS Server Support for NFS version 3 ACL protocol extension
<M> NFS Server Support for NFS version 4

2) Add support for SCSI Tape devices:
Device Drivers --->
SCSI Device Support --->
<M> SCSI Tape Support

3) Add support for iptables:
Networking Support --->
Networking Options --->
Network Packet Filtering Framework (netfilter) --->
IP: Netfilter Configuration --->
<M> IP Tables Support

Testing done:
Using the foundation kernel source: raspberry-linux-cc5758b and a config based on bcmrpi_defconfig from
within that source I've made the above changes, compiled and installed the kernel and modules and these
features work with no observed problems to the rest of the system.
Posts: 106
Joined: Sat Apr 07, 2012 11:22 am
Location: Manchester, UK
by jerry.tk » Fri Jun 22, 2012 7:22 am
Regarding kernel packaging vs. FAT fs: seems there is some progress in porting U-Boot to RasPi. It already loads kernel from tftp and maybe after a few more iterations it will be able to boot kernel from SD card ext3 partition. I think it would solve some problems with kernel packaging and also installer would profit from that. Not mentioning that we could move to more sane partitioning scheme.
What do you guys think?
Posts: 63
Joined: Sat Apr 07, 2012 6:26 am
Location: CZ
by chrisw2 » Fri Jun 22, 2012 11:29 am
Jerry,

To a non-expert like me that sounds great news. A bootloader will hopefully eventually enable raspbian to be as debian like as is possible.
Posts: 106
Joined: Sat Apr 07, 2012 11:22 am
Location: Manchester, UK
by mpthompson » Fri Jun 22, 2012 3:53 pm
jerry.tk wrote:Regarding kernel packaging vs. FAT fs: seems there is some progress in porting U-Boot to RasPi. It already loads kernel from tftp and maybe after a few more iterations it will be able to boot kernel from SD card ext3 partition. I think it would solve some problems with kernel packaging and also installer would profit from that. Not mentioning that we could move to more sane partitioning scheme.
What do you guys think?


I've wondered about u-boot. It's pretty much the standard way almost all other ARM devices boot. I'll have to think some more about it as I'm not really sure what it offers. If it included USB storage drivers it could also facilitate booting an installing from USB media -- although I think u-boot itself will always have to reside on an SD card.
User avatar
Forum Moderator
Forum Moderator
Posts: 620
Joined: Fri Feb 03, 2012 7:18 pm
Location: San Carlos, CA
by plugwash » Sun Jun 24, 2012 12:28 am
chrisw2 wrote:Is the format below okay?

What I actually want are actual setting names in the kernel config file

1) Add support for NFS kernel server:
File Systems --->
Network File Systems --->
<M> NFS Server Support
<M> NFS Server Support for NFS version 3
<M> NFS Server Support for NFS version 3 ACL protocol extension
<M> NFS Server Support for NFS version 4

Currently I have set
CONFIG_NETWORK_FILESYSTEMS=y
CONFIG_NFS_FS=m
CONFIG_NFS_V3=y
CONFIG_NFS_V3_ACL=y
CONFIG_NFS_V4=y
CONFIG_NFS_V4_1=y
CONFIG_PNFS_FILE_LAYOUT=m
CONFIG_PNFS_BLOCK=m
CONFIG_NFS_FSCACHE=y
# CONFIG_NFS_USE_LEGACY_DNS is not set
CONFIG_NFS_USE_KERNEL_DNS=y
# CONFIG_NFS_USE_NEW_IDMAPPER is not set
CONFIG_NFSD=m
CONFIG_NFSD_V2_ACL=y
CONFIG_NFSD_V3=y
CONFIG_NFSD_V3_ACL=y
CONFIG_NFSD_V4=y

2) Add support for SCSI Tape devices:
Device Drivers --->
SCSI Device Support --->
<M> SCSI Tape Support

Curently I have set

CONFIG_CHR_DEV_ST=m

3) Add support for iptables:
Networking Support --->
Networking Options --->
Network Packet Filtering Framework (netfilter) --->
IP: Netfilter Configuration --->
<M> IP Tables Support


currently I have set

#
# IP: Netfilter Configuration
#
CONFIG_NF_DEFRAG_IPV4=m
CONFIG_NF_CONNTRACK_IPV4=m
CONFIG_NF_CONNTRACK_PROC_COMPAT=y
CONFIG_IP_NF_QUEUE=m
CONFIG_IP_NF_IPTABLES=m
CONFIG_IP_NF_MATCH_AH=m
CONFIG_IP_NF_MATCH_ECN=m
CONFIG_IP_NF_MATCH_TTL=m
CONFIG_IP_NF_FILTER=m
CONFIG_IP_NF_TARGET_REJECT=m
CONFIG_IP_NF_TARGET_LOG=m
CONFIG_IP_NF_TARGET_ULOG=m
CONFIG_NF_NAT=m
CONFIG_NF_NAT_NEEDED=y
CONFIG_IP_NF_TARGET_MASQUERADE=m
CONFIG_IP_NF_TARGET_NETMAP=m
CONFIG_IP_NF_TARGET_REDIRECT=m
CONFIG_NF_NAT_SNMP_BASIC=m
CONFIG_NF_NAT_PROTO_DCCP=m
CONFIG_NF_NAT_PROTO_GRE=m
CONFIG_NF_NAT_PROTO_UDPLITE=m
CONFIG_NF_NAT_PROTO_SCTP=m
CONFIG_NF_NAT_FTP=m
CONFIG_NF_NAT_IRC=m
CONFIG_NF_NAT_TFTP=m
CONFIG_NF_NAT_AMANDA=m
CONFIG_NF_NAT_PPTP=m
CONFIG_NF_NAT_H323=m
CONFIG_NF_NAT_SIP=m
CONFIG_IP_NF_MANGLE=m
CONFIG_IP_NF_TARGET_CLUSTERIP=m
CONFIG_IP_NF_TARGET_ECN=m
CONFIG_IP_NF_TARGET_TTL=m
CONFIG_IP_NF_RAW=m
CONFIG_IP_NF_ARPTABLES=m
CONFIG_IP_NF_ARPFILTER=m
CONFIG_IP_NF_ARP_MANGLE=m

I think this covers what you have asked for.
Forum Moderator
Forum Moderator
Posts: 2325
Joined: Wed Dec 28, 2011 11:45 pm
by plugwash » Sun Jun 24, 2012 1:23 am
BTW i'm now building what I hope will be the first kernel to be uploaded to raspbian.
Forum Moderator
Forum Moderator
Posts: 2325
Joined: Wed Dec 28, 2011 11:45 pm
by jui-feng » Sun Jun 24, 2012 10:02 am
plugwash wrote:BTW i'm now building what I hope will be the first kernel to be uploaded to raspbian.

That is great news! Chapeau!

Though I'm wondering, will it conflict with rpi-update? I assume that packaged firmware is not hitting the repository at the same time as a packaged kernel, so we'd still need rpi-update.. So should we comment out the kernel/modules updating in rpi-update when we see apt-get wants to install a kernel package?
Posts: 57
Joined: Sun Mar 04, 2012 11:02 am
by plugwash » Sun Jun 24, 2012 12:14 pm
Firstly apt will not "want to install a kernel package" since there is nothing already installed that will depend on one. If you want this packaged kernel you will have to install it yourself.

Secondly for the time being using this kernel package will require manually copying the kernel to boot.img, the next step after the kernel package itself is ported will be to work on "flash-kernel" so it does what we want.

Running rpi-update will as you say reset the kernel to what the foundation is shipping.
Forum Moderator
Forum Moderator
Posts: 2325
Joined: Wed Dec 28, 2011 11:45 pm
by plugwash » Sun Jun 24, 2012 1:37 pm
Unfortunately I have some bad news

Firstly the latest Pi fimware will no longer boot compressed images, so i'm having to try and adjust the debian packaging to produce an uncompressed kernel.

Secondly my kernel seems far more prone to lockup under load than the foundation one. With the foundation kernel and an appropriate min_free_kbytes setting I can succesfully run midori and browse to the raspberry pi forum. With my kernel attempting to do that hangs the Pi. I have not tried bootc's kernel to see if it has the same issue or not.
Forum Moderator
Forum Moderator
Posts: 2325
Joined: Wed Dec 28, 2011 11:45 pm
by chrisw2 » Sun Jun 24, 2012 5:37 pm
plugwash wrote:...

I think this covers what you have asked for.

Thank you for this (and all your other work!).

I've never looked in the actual .config file much beyond the comment at the top:
# Automatically generated file; DO NOT EDIT.
which quickly convinced me to stick to using menuconfig and not mess with with things I didn't understand. For any future requests I guess the best way will be to compare & extract the differences between the .config before running menuconfig and .config afterwards.
Posts: 106
Joined: Sat Apr 07, 2012 11:22 am
Location: Manchester, UK
by williamhbell » Sun Jun 24, 2012 5:44 pm
plugwash wrote:Firstly the latest Pi fimware will no longer boot compressed images, so i'm having to try and adjust the debian packaging to produce an uncompressed kernel.


This sounds like a bug. Perhaps we can ask them to reverse this firmware change?
User avatar
Posts: 260
Joined: Mon Dec 26, 2011 5:13 pm
by plugwash » Sun Jun 24, 2012 9:44 pm
sorry false alarm, the cause of my boot failure was actually SD card corruption.
Forum Moderator
Forum Moderator
Posts: 2325
Joined: Wed Dec 28, 2011 11:45 pm
by mpthompson » Sun Jun 24, 2012 11:23 pm
plugwash, was the false alarm the inability to boot a compressed kernel image, stability, or both?
User avatar
Forum Moderator
Forum Moderator
Posts: 620
Joined: Fri Feb 03, 2012 7:18 pm
Location: San Carlos, CA
by plugwash » Sun Jun 24, 2012 11:50 pm
The false alarm was the inability to boot a compressed kernel, I haven't figured out the stability problem yet. I'm currently trying a build without all the patches debian applies in case one of them is interacting badly with the Pi stuff.
Forum Moderator
Forum Moderator
Posts: 2325
Joined: Wed Dec 28, 2011 11:45 pm
by Luke Wilkinson » Mon Jun 25, 2012 11:39 am
Hi All. This is my first post in these forums.

Firstly, although I'm sure you people get bored og hearing this kind of thing, I just want to register my vast repsect for what you are doing here.

Normally, I am a avid adherent to debian linux and prefer to stick with pure debian where possible. My Pi arrived (was a gift actually) on Friday and I've devoted the weekend to fiddling with a debian armel "sid" installation I put together using a modified version of the method described by this very helpful blog:

http://blog.kmp.or.at/2012/05/build-you ... -pi-image/

In between doing this I've been all over this forum, and eventually understood what you're trying to achieve with Raspbian and why. Actually an R-Pi is something I personally "need" (i.e. really really want)

May I say I strongly support this enveavour and I will gladly assist where possible. I wont be much use at the "assembler" level but I must be at least in the 90%th percentile in terms of debian/linux knowledge generally. I will be watching to see where I can help.

So I have a couple of questions:

Is the stock foundation kernel significantly slowing things down by being built with softpf?

has anyone solved the issue of the closed source firmware being softfp, and will it play nicely with raspbian?

Keep up the good work ;p
Posts: 4
Joined: Mon Jun 25, 2012 10:23 am
by plugwash » Mon Jun 25, 2012 12:11 pm
Luke Wilkinson wrote:Is the stock foundation kernel significantly slowing things down by being built with softpf?

I doubt it, afaict the kernel basically doesn't contain any floating point code

The reasons we want our own properly packaged kernel are completeness and the ability to port the installer properly. Also the foundation kernel is currently based on 3.1 which is unsupported from a security perspective.

has anyone solved the issue of the closed source firmware being softfp, and will it play nicely with raspbian?

The firmware itself doesn't care about what floating point abi the linux userlandnis using. The closed-source userland libaries for interfacing with the firmware do need seperate builds for hardfloat distros, fortunately the foundation are now providing those.
Forum Moderator
Forum Moderator
Posts: 2325
Joined: Wed Dec 28, 2011 11:45 pm