Kernel Update 2.6.24 and beyond
SNAKE OS firmware for wlxkj652, ns-k330 and NAS based on str8132 SoC
Brought to you by:
dgazineu
Originally created by: tuxbox.g... (code.google.com)@gmail.com
Hi,
I have a 2.6.24 kernel for the str8100/9100 devices and would like to test a new kernel. Unfortunately using uBoot tftp loader hangs my home lan (starts a Flood and my network switches kill the port)
Any hints on booting this zImage ?
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: irah.... (code.google.com)@gmail.com
Hi. Could you give a link to the kernel source or patch? I would like to test it and see if something could be done.
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: patrick.... (code.google.com)@gmail.com
Have you got kernel source or patches for this version
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: patrick.... (code.google.com)@gmail.com
ftp://ftp.embeddedarm.com/ts-arm-sbc/ts-7500-linux/sources/linux-2.6.24-cavium_source_aug052010.tar.gz
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: tuxbox.g... (code.google.com)@gmail.com
This is the patch I made based on the above link... This applied to Vanilla Kernel 2.6.24.4
No idea if it even works... but patch applies :D
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: emap... (code.google.com)@gmail.com
someone managed to get a working firmware with kernel 2.6.24?
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: stefansc...@googlemail.com
tftp works fine here.. I'm connecting the device directly to a computer though.
I played a bit with the embeddedarm kernels and threw together some patches to make them work. Some things still have me puzzled, so I can't guarantee that they will work correctly.
ftp://ftp.embeddedarm.com/ts-arm-sbc/ts-7500-linux/sources/linux-2.6.24-cavium_source_jun082011.tar.gz + linux-2.6.24-cavium-to-snake.diff
Boots and everything seems to work.. at least what I tried.
Image size is about 1030k. So it probably wouldn't fit into the kernel partition anymore. No idea if that can be changed or if the 980k are a hard limit.
ftp://ftp.embeddedarm.com/ts-arm-sbc/ts-7500-linux/sources/linux-2.6.36-ts7552.tar.bz2 + inux-2.6.36-ts7552-to-snake.diff
Also boots and most things seem to work, except that pushing the reset button with the button driver loader panics the kernel. Haven't looked into that yet.
Due to better compression the image size is about 930k. So it would fit nicely into the flash.
The attached configs are pretty close to the one used by snake. Not sure if they are optimal.
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: stefansc...@googlemail.com
ok .this patch seems to fix the reset button
I moved INIT_WORK() out of the irq handler, which runs a couple of times when the button is pressed. According to what I read INIT_WORK() shouldn't be used when a task is already scheduled.
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: tuxbox.g... (code.google.com)@gmail.com
Maybe I will un-retire my NAS and give it a try :D
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: stefansc...@googlemail.com
Have fun!
This is how I load the image..
On the tftp server:
Set ip of the network device to 192.168.0.100
Drop zImage into the tftp dir
At the uboot prompt enter:
tftpboot 0x1000000 zImage
go 0x1000000
There were some autogenerated files in the last 2.6.36 patch. Not sure how they ended up in there. They are probably harmless but I removed them anyway in this one.
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: qui... (code.google.com)@gmail.com
Does this kernel help solving any of the memory swap problems that it's predecessor had? Like transmission crashing due to out of memory?
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: stefansc...@googlemail.com
Probably not.
One interesting thing to try with a newer kernel would be compcache (https://code.google.com/p/compcache/), which could slightly increase the amount of available memory before hitting the swap disk. Not sure if the cpu is fast enough for that though.
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: qui... (code.google.com)@gmail.com
I read somewhere here that Douglas was working on a kernel fix for all these swap problems... Do you know if he had any luck? Is he still working on this project?
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: stefansc...@googlemail.com
He hasn't been all that actiuve for a while. I think the fix was to let apps allocate as much memory as they want and to kill them if they actually use more than what is available, but that only helped to some degree.
The real problem is that transmission is a memory hog (for such weak devices).
If you want to autorestart transmission when it crashes try this:
https://code.google.com/p/snake-os/issues/detail?id=243#c5
It also helps somewhat to limit the number of connections and max speed.
Related
Tickets: #243
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: qui... (code.google.com)@gmail.com
I'm having problems with torrents with only 3 connections each...
... correct if I'm wrong, but shouldn't all this memory problem be transparent to the applications? And the kernel should allocate as much as the App wants and do the virtual memory paging if it requires more than what is physically available?
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: stefansc...@googlemail.com
That's the idea.
So it even crashes with swap?
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: qui... (code.google.com)@gmail.com
Yes, I acti0vate the swap and it crashes every hour or so. I've set it to restart but I still don't understand what is wrong with the swapping...
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: stefansc...@googlemail.com
oh ..ok
Well the new kernel seems to improve at least one thing:
http://www.archlinux.org/iso/2011.08.19/archlinux-2011.08.19-core-x86_64.iso.torrent
Previously this torrent would lock up the device as soon as I started it. Judging by the kernel messeges the kernel runs out of memory, even with swap. Not sure why. The new kernel behaves better. By default it still occasionally complains about low kernel memory but manages to keep going.
After doing:
echo 1024 > /proc/sys/vm/min_free_kbytes
I haven't had any issues yet, other than that it was swapping heavily.
Increasing the free memory limit doesn't help with the old kernel.
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: qui... (code.google.com)@gmail.com
That's interesting, I'm willing to try it out.
...I probably know the answer but I will ask it anyway... Can I use the NAS to compile it or it will run out of memory and seg fault?
And 2, If I screw up replacing the Kernel, how do I recover? Does tftp work or will I need a serial interface installed?
Thanks a lot
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: stefansc...@googlemail.com
1. No ..you'd need to get a compiler that runs on the device.. cross compiling is easier.
To do so download snake from svn and run this in the kernel directory:
PATH=<path to sdk>/tools/arm-uclibc-3.4.6/bin/:$PATH ARCH=arm CROSS_COMPILE=arm-linux- make [xconfig, menuconfig ..] zImage
It's not enough to replace the kernel btw. some drivers are compiled as modules and sit on the rootfs, so to get something fully functional, you would have to replace that too.
2. You will need a serial interface. There's no automatic tftp download, but you can do it manually from the bootloader prompt.
Attached is a snake build with 2.6.36. Use at your own risk. I ran it through some tests but.. yeah..
You may want to throw the min_free_kbytes thing into one of the startup scripts. I guess I could make 1024 the default.
Build config is attached too.
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: patrick.... (code.google.com)@gmail.com
Good job !!
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: websysc... (code.google.com)@gmail.com
but if I'm not wrong the flash memory is just 3M, so, is it possible upload that kernel into the nas?
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: stefansc...@googlemail.com
The flash is 4mb. It's a full snake os image that is installable from the web interface.
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: websysc... (code.google.com)@gmail.com
oh I see.
why don't you do a wiki of how to build a full snake os image?
that'd be nice
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: stefansc...@googlemail.com
There's an entry on the FAQ page about that. https://code.google.com/p/snake-os/wiki/FAQ
It pretty much amounts to checking out the svn trunk then running "sh mk_snakeos_image.sh". If you are lucky you will end up with a usable image afterwards.
To build an image with the new kernel do:
checkout svn
extract kernel package into the kernels/ directory and symlink the resulting directory to kernels/linux
cd kernels
tar -xf linux-2.6.36-ts7552.tar.bz2
ln -nsf linux-2.6.36 linux
apply patch:
cd kernels/
cat linux-2.6.36-ts7552-to-snake-4.diff | patch -p0
overwrite str8132_defconfig_jffs2 and str8132_defconfig_ramimage with the config file
cp config-2.6.36 configs/str8132_defconfig_jffs2
cp config-2.6.36 configs/str8132_defconfig_ramimage
run "sh mk_snakeos_image.sh"
The kernel makefile needs to a small change to work with the snake build script. It's included in the attached patch.
View and moderate all "tickets Discussion" comments posted by this user
Mark all as spam, and block user from posting to "Tickets"
Originally posted by: qui... (code.google.com)@gmail.com
Thanks a lot Stefan! Lets cross our fingers and hope for a more stable NAS :D