Building a custom kernel
Instructions on how to build a custom kernel for the SheevaPlug.
This entry was posted
on Monday, May 18th, 2009 at 2:08 pm and is filed under Uncategorized.
You can follow any responses to this entry through the RSS 2.0 feed.
You can skip to the end and leave a response. Pinging is currently not allowed.
Please keep comments clean and constructive. Inappropriate comments will be removed. Thank you.
I cannot find the “linux-feroceon_4_2_7_KW.zip” file, where is it supposed to come from? I have extracted the SheevaPlug_LSP.tgz from both the development cd and downloaded from the marvel site. I have searched the downloads on the marvel site and am unable to find it there, either.
I’ve just downloaded the file “SheevaPlug_LSP.zip” from Marvell. It looks like they incorporated the feroceon patch already so you don’t need to merge the trees yourself. You can tell by looking at the /Sources/linux-2.6.22.18/arch/arm/ directory. You should see several directories with “feroceon” in it.
Hi. I built an Orion kernel because the default kernel would not connect to my 1 GigE switch. It would only connect to my Linksys router which has a 100M connection. I was hoping the Orion kernel would fix this problem for me, but it fails to mount the root file system.
It just hangs. I’m wondering if the Orion kernel corrupted the root flash file system? Any ideas? Thanks.
did you remember to
setenv arcNumber 2097
and
setenv mainlineLinux yes
in uboot?
Yes, I set the arcNumber and mainlineLinux environment. The problem was my JFFS2 was corrupted due to what I believe was caused by passing incorrect parameters for mtdparts. When my environment settings was reset to default, the mapping for the JFFS2 was different than what I had set. This corrupted the JFFS2 which seems like a bug. Anyway, I restored the file system and also updated with Development U-Boot and everything is working now.
Jim, what’s your bootargs env? Have you got “console=ttyS0,115200″?
This is a great tutorial. I spent hours figuring this out in order to get Debian installed and booting on an external USB drive (not using the internal flash at all). Wish it had been available at the time.
Keep up the great work!
Excellent guide and site, a huge help for us developers
now that the v.1 installer has come out, which seems to be based on the Orion, is it easier to add individual modules (e.g. drivers) by modifying that or by compiling a custom kernel?
Cheers
I haven’t tried the installer yet so I can’t really comment on it. However I’ve been using the mainline kernel (from kernel.org) and it seems to work fine. Personally I think that the mainline kernel will be kept more up to date than Orion so I plan to stick with the mainline kernel. YMMV.
Kenny,
Great work and a very useful site to supplement the Sheevaplug wiki.
I would also be interested if either you or another developer could come up with an update set of instructione to use your guide in conjunction with the v1.0 installer.
I think this combination would be a great resource for all newbies looking to compile their own kernels.
thanks again.
Unfortunately I don’t have plans to try out the installer unless my uboot gets corrupted because I only have 1 sheeva plug and it is running this website. It would be hard for me to take it down and mess with the installer for a week.
Kenny, nice work.
Jim, if you build the 2.6.22.18 kernel you should *NOT* set mainlineLinux (you can unset by typing
setenv mainlineLinux
in u-boot)
FM
The “Getting U-Boot’s mkimage” section can be updated to use the newer u-boot build as described at http://www.openplug.org/plugwiki/index.php/Das_U-boot_plug_support
Sorry a newbie to u-boot here.
Build a new uImage using mainline (2.6.31), and copied to /boot/ together with the modules.
Configured the uboot with the mainline settings.
but… what do I do to load it?
which bootargs / bootcmd is required to load a non-flashed kernel?
If you’re loading the kernel from somewhere else other than the flash, then you need to change the bootarg so that it loads from the new place. For example, nand is the flash, usb is a usb storage device. Take a look at the section of the wiki about booting from a usb device, that should get you started.
http://www.marvell.com/files/products/embedded_processors/developer/kirkwood/SheevaPlug_U-Boot.zip returns 404, looking for mirrors…
Try this …
wget ftp://ftp.slackware.org.uk/armedslack/armedslack-devtools/sheevaplug/SheevaPlug_U-Boot.zip
“The 2.6.30 is not yet released…”
Looking at kernel.org, this would seem to be out of date. Do you have any current reccommendations (looks like linux-2.6.34.tar.gz is there, thought my laptop is running 2.6.31 from the AMD64 repositories).
At some point, we should be able to have a new kernel from the repositories (apt-get upgrade), once 2.6.30 is in the ARM repos, right? (it looks like 2.6.28 is the latest there now.)
Yes, you can definitely use the newer kernels for your sheevaplug. I have not update because my sheevaplug is being use to serve this website and it has gotten to be a somewhat popular wiki for sheevaplug-heads. I’m looking to get a guruplug so that I can have another to do experiments. But every time I tried to order it I keep wanting to until until plug 2.0……
“Copy uImage to the boot directory or burn it into the flash.”
I’m not sure if this is a typo, as above, for cross-compiling, it reads “*and* burn” Also, I don’t see instructions anywhere for ‘burning.’ How do we go about this (or did I miss it somewhere on the site)?
“Copy uImage to the boot directory or burn it into the flash.”
I’m not sure if this is a typo, as above, for cross-compiling, it reads “*and* burn” Also, I don’t see instructions anywhere for ‘burning.’ How do we go about this (or did I miss it somewhere on the site)?
I’ve just compiled on the plug, but I need to do something with the kernel image, I think…
I think I have the same question as above, but I’m not sure I follow the answer:
Dennis Schafroth says:
>but… what do I do to load it?
>which bootargs / bootcmd is required to load a non-flashed kernel?
Kenny says:
>If you’re loading the kernel from somewhere else other than the flash,
For those of us just figuring out how to work with dedicated devices with different sorts of memory, we might be confusing terms. For instance, by “non-flashed kernel”, I presume Dennis means that it is in the /boot folder, but not flashed/burned (there? elsewhere?) Are we looking for a uboot command that will take the uImage file and put it in the nand permanently?
In any case, putting uImage in /boot, alone (in addition to changing the arcNumber and mainlineLinux, for a newer kernel) does not boot the new kernel.
Sorry if this has an obvious answer; it isn’t to me.
Sorry, a bit more research got me my answer. for my system, where
~$ cat /proc/mtd
dev: size erasesize name
mtd0: 00400000 00020000 “uImage”
mtd1: 1fb00000 00020000 “rootfs”
to flash new uImage to nand:
sudo flash_eraseall -j /dev/mtd0
sudo nandwrite -p /dev/mtd0 /boot/uImage
(Once uImage is in /boot)
It would, of course, be nice if the kernel image loaded OK, as I don’t think its as easy to go back…
I just found out my new 2.6.31 kernel doesn’t support ext4. Apparently “make kirkwood_defconfig” gives you a config without it. Any arguments against adding it in after running the defconfig, before the next make?
Sorry about all the postings today; this website is a great resource, and I hope it continues to provide this help figuring out plugs. I thought I should report that I have successfully built 2.6.31 from Kernel.org:
uname -a:
Linux rasplug.rasnet.lan 2.6.31 #2 PREEMPT Fri May 21 14:03:34 CAT 2010 armv5tel GNU/Linux
And after I realized that ext4 wasn’t in the config, and added it, a quick re-compile and re-flash, and I now have a flash disk formatted ext4 loading archives from my laptop.
Thanks!
Glad to hear you got the kernel working Kent, good work.
Kenny,
Thanks for the great page.
Do you happen to know if the .config that was used to build the as-shipped GuruPlug kernel is available anywhere? (would have been cool if globalscale had left it in /lib/modules//).
Thanks much,
/gw
Oops. Forgot about /proc/config.gz — sorry for the blip. /gw
Thank you for these excellent directions; this looks like it should work for me!
I was hoping to avoid the hassle of compiling my own kernel; I have a driver module I wanted to compile, but it’s looking for a /lib/modules/2.6.22.18/build directory that simply doesn’t exist. Looks like I’m missing the kernel headers from the build they did corresponding to the 2.6.22.18 feroceon kernel. Does anybody know of an archive of just those headers? Access to them would save me a lot of time.
Hi Mark,
this is the link to download kernel headers for 2.6.22.18
I assume you have already solved your issue but for others it will be useful.
http://buffalo.jp/php/los.php?to=gpl/storage/ls-xhl/120/linux-2.6.22.18.tar.xz
I’m currently compiling the 2.6.2.18 kernel on my SheevaPlug. So far so good. I made the following notes in the process:
(1) I had to edit the kernel Makefile for local compilation. I commented out the lines that specify the cross-compile “arm-none-eabi-” prefix and the “arm” architecture.
(2) I couldn’t find a “kirkwood_defconfig” file, I specified “make mv88f6281_defconfig” instead.