eniac111 / snake-os

Automatically exported from code.google.com/p/snake-os
2 stars 1 forks source link

Kernel Update 2.6.24 and beyond #101

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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 ?

Original issue reported on code.google.com by tuxbox.g...@gmail.com on 30 Nov 2010 at 12:28

GoogleCodeExporter commented 9 years ago
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.

Original comment by irah....@gmail.com on 13 Jan 2011 at 10:02

GoogleCodeExporter commented 9 years ago
Have you got kernel source or patches for this version

Original comment by patrick....@gmail.com on 16 Jan 2011 at 5:46

GoogleCodeExporter commented 9 years ago
ftp://ftp.embeddedarm.com/ts-arm-sbc/ts-7500-linux/sources/linux-2.6.24-cavium_s
ource_aug052010.tar.gz

Original comment by patrick....@gmail.com on 16 Jan 2011 at 6:29

GoogleCodeExporter commented 9 years ago
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

Original comment by tuxbox.g...@gmail.com on 16 Jan 2011 at 7:33

Attachments:

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
someone managed to get a working firmware with kernel 2.6.24?

Original comment by emap...@gmail.com on 10 Mar 2011 at 1:20

GoogleCodeExporter commented 9 years ago
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_s
ource_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.t
ar.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.

Original comment by stefansc...@googlemail.com on 18 Aug 2011 at 1:48

Attachments:

GoogleCodeExporter commented 9 years ago
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.

Original comment by stefansc...@googlemail.com on 18 Aug 2011 at 6:35

Attachments:

GoogleCodeExporter commented 9 years ago
Maybe I will un-retire my NAS and give it a try :D

Original comment by tuxbox.g...@gmail.com on 18 Aug 2011 at 9:17

GoogleCodeExporter commented 9 years ago
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.

Original comment by stefansc...@googlemail.com on 20 Aug 2011 at 11:38

Attachments:

GoogleCodeExporter commented 9 years ago
Does this kernel help solving any of the memory swap problems that it's 
predecessor had? Like transmission crashing due to out of memory?

Original comment by qui...@gmail.com on 1 Feb 2012 at 7:26

GoogleCodeExporter commented 9 years ago
Probably not. 

One interesting thing to try with a newer kernel would be compcache 
(http://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.

Original comment by stefansc...@googlemail.com on 2 Feb 2012 at 12:16

GoogleCodeExporter commented 9 years ago
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?

Original comment by qui...@gmail.com on 2 Feb 2012 at 1:05

GoogleCodeExporter commented 9 years ago
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:
http://code.google.com/p/snake-os/issues/detail?id=243#c5
It also helps somewhat to limit the number of connections and max speed.

Original comment by stefansc...@googlemail.com on 2 Feb 2012 at 10:11

GoogleCodeExporter commented 9 years ago
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?

Original comment by qui...@gmail.com on 2 Feb 2012 at 6:37

GoogleCodeExporter commented 9 years ago
That's the idea. 

So it even crashes with swap?

Original comment by stefansc...@googlemail.com on 2 Feb 2012 at 9:30

GoogleCodeExporter commented 9 years ago
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... 

Original comment by qui...@gmail.com on 5 Feb 2012 at 12:17

GoogleCodeExporter commented 9 years ago
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.tor
rent

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.

Original comment by stefansc...@googlemail.com on 7 Feb 2012 at 6:30

GoogleCodeExporter commented 9 years ago
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

Original comment by qui...@gmail.com on 7 Feb 2012 at 10:34

GoogleCodeExporter commented 9 years ago
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.

Original comment by stefansc...@googlemail.com on 8 Feb 2012 at 1:19

Attachments:

GoogleCodeExporter commented 9 years ago
Good job !!

Original comment by patrick....@gmail.com on 8 Feb 2012 at 7:50

GoogleCodeExporter commented 9 years ago
but if I'm not wrong the flash memory is just 3M, so, is it possible upload 
that kernel into the nas?

Original comment by websysc...@gmail.com on 8 Feb 2012 at 3:38

GoogleCodeExporter commented 9 years ago
The flash is 4mb. It's a full snake os image that is installable from the web 
interface.

Original comment by stefansc...@googlemail.com on 8 Feb 2012 at 4:13

GoogleCodeExporter commented 9 years ago
oh I see.

why don't you do a wiki of how to build a full snake os image?

that'd be nice

Original comment by websysc...@gmail.com on 8 Feb 2012 at 4:45

GoogleCodeExporter commented 9 years ago
There's an entry on the FAQ page about that. 
http://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.

Original comment by stefansc...@googlemail.com on 8 Feb 2012 at 7:27

Attachments:

GoogleCodeExporter commented 9 years ago
Thanks a lot Stefan! Lets cross our fingers and hope for a more stable NAS :D

Original comment by qui...@gmail.com on 8 Feb 2012 at 7:52

GoogleCodeExporter commented 9 years ago
Just tested and installed image, and yes it is true that there is a much free 
memory.
But there is a issue with samba, cant copy files(permission denied) bigger then 
200kb o_O . Any idea,solution,something ?

Original comment by tok...@gmail.com on 8 Feb 2012 at 11:13

GoogleCodeExporter commented 9 years ago
These kind of random breakes were what I was worried about..

What OS are you using? 

I don't have that issue but I keep timing out after copying a few mb with samba.

Original comment by stefansc...@googlemail.com on 9 Feb 2012 at 1:05

GoogleCodeExporter commented 9 years ago
It is not OS problem, i think you didnt include cifs in kernel. Can you attach 
your .config please?

Original comment by tok...@gmail.com on 9 Feb 2012 at 1:09

GoogleCodeExporter commented 9 years ago
It's attached to http://code.google.com/p/snake-os/issues/detail?id=101#c20

Isn't the cifs module only for mounting external shares?

Original comment by stefansc...@googlemail.com on 9 Feb 2012 at 1:20

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
You cant copy files over the network without cifs, unless you didnt compile 
whole samba. Anyway, tnx for help and .config, ill try to compile myself and 
ill post results here ;)

Original comment by tok...@gmail.com on 9 Feb 2012 at 2:56

GoogleCodeExporter commented 9 years ago
But cifs isn't enabled in the old kernel either.

I just asked about the OS because you seem to be seeing something different 
than I do.

Original comment by stefansc...@googlemail.com on 9 Feb 2012 at 3:31

GoogleCodeExporter commented 9 years ago
Rly dont have idea, on win7 that was a issue. Also i cant compile firmware 
(followed your instructions) :

==================================
du -sk /opt/snake-os-read-only/rootfs/target
5528    /opt/snake-os-read-only/rootfs/target
==================================
sudo mkfs.jffs2 -d /opt/snake-os-read-only/rootfs/target -o 
/opt/snake-os-read-only/output/jffs2.img -p 0x2a0000 -X zlib 
sudo: mkfs.jffs2: command not found
make: *** [gen_rootfs] Error 1

Can anybody with older firmware can give me a output of #lsmod ?

Original comment by tok...@gmail.com on 9 Feb 2012 at 3:48

GoogleCodeExporter commented 9 years ago
You have to install mtd-utils.

Original comment by stefansc...@googlemail.com on 9 Feb 2012 at 4:24

GoogleCodeExporter commented 9 years ago
@Stefan

This ARM processor can support 66MHz operation to PCI devices:

CONFIG_STR8100_PCI33M=y
# CONFIG_STR8100_PCI66M is not set

and why don't you try with FASTFPE?

CONFIG_FPE_NWFPE=y
# CONFIG_FPE_NWFPE_XP is not set
# CONFIG_FPE_FASTFPE is not set

Original comment by websysc...@gmail.com on 9 Feb 2012 at 5:35

GoogleCodeExporter commented 9 years ago
Can anyone please tell me if the latest version 
"snakeos-V1.3.2_2.6.36-20120208.bin" includes NFS support?

Original comment by mguraliu...@gmail.com on 9 Feb 2012 at 7:15

GoogleCodeExporter commented 9 years ago
@mguraliuc1978 

No, it is not compiled with nfs support

Original comment by tok...@gmail.com on 9 Feb 2012 at 7:22

GoogleCodeExporter commented 9 years ago
I'm fairly sure that the PCI bus isn't used on these. It would actually be 
interesting to see what happens if it's turned off completely. If nothing 
depends on it this could reduce power consumption a bit.

NWFPE was the default. I guess it'd be mostly interesting for multimedia type 
things. Maybe some day I'll try to compare the options.

Original comment by stefansc...@googlemail.com on 9 Feb 2012 at 7:24

GoogleCodeExporter commented 9 years ago
@Stefan

If you take a look on svn version of snakeos, you will see that cifs is 
included in kernel. So i still think this is a problem with samba.

Original comment by tok...@gmail.com on 9 Feb 2012 at 7:29

GoogleCodeExporter commented 9 years ago
Hum I see 
# CONFIG_CIFS is not set
in 
http://code.google.com/p/snake-os/source/browse/trunk/configs/str8132_defconfig_
jffs2
and in config-2.6.36. So unless the default has changed it should be disabled 
in both cases.

I can try to turn it on.. but I doubt that it will make a difference.

Original comment by stefansc...@googlemail.com on 9 Feb 2012 at 7:49

GoogleCodeExporter commented 9 years ago
however 2.6.36 is not currently a "longterm supported kernel version" which 
means it will not receive security updates and bug fixes in the near future. 
Luckily 2.6.35 is a longterm release, and we can backport the patch to that 
version. You can get these patches 

http://mirror.lug.udel.edu/pub/lug-udel/projects/ts7500/patch-2.6.35.11-ts7500.b
z2
http://www.kernel.org/pub/linux/kernel/v2.6/longterm/v2.6.35/linux-2.6.35.11.tar
.bz2

Original comment by websysc...@gmail.com on 9 Feb 2012 at 8:18

GoogleCodeExporter commented 9 years ago
Thanks.. that's probably not a bad idea.

Apparently the tree is maintained by Andi Kleen. http://halobates.de/blog/
It's up to 2.6.35.14 now. 
http://www.kernel.org/pub/linux/kernel/v2.6/longterm/v2.6.35/

3.0 would be an interesting target too because it's the the current "official" 
longterm release.
http://www.kroah.com/log/linux/stable-status-01-2012.html

I did screw around with 3.0 a bit already but didn't get anything bootable at 
the time.

Original comment by stefansc...@googlemail.com on 9 Feb 2012 at 8:59

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
Hi all, I used that kernel and I bricked the Nas. The System and Power led stay 
on and the lan seems to be down. I tried the hard reset but the nas didn't 
respond. I also tried a serial connection, using a Nokia CA-42 compatible 
cable, without success (TNo text in minicom shell). So, how can restore the 
original firmware ?

Original comment by pietro.m...@gmail.com on 15 Feb 2012 at 10:36

GoogleCodeExporter commented 9 years ago
that is a bad news.  did you try to buy a new one?

nah .. I'm just kidding

Did you upgrade from original firmware?

Original comment by websysc...@gmail.com on 16 Feb 2012 at 12:45

GoogleCodeExporter commented 9 years ago
[deleted comment]
GoogleCodeExporter commented 9 years ago
I have a problem same with pietro.m...@gmail.com (Comment 45) after upgrade the 
system and Power LED stay on and the Lan seems to be down. (I upgrade from 
SNAKE OS V 1.3.2).
How can fix it ?

Original comment by anusorn....@gmail.com on 16 Feb 2012 at 9:29

GoogleCodeExporter commented 9 years ago
Hi all, I solved following this guide 
http://code.google.com/p/snake-os/wiki/Recovery. Pay attention to:
- Cross RX / TX cables between cable and WLX-652
- USB power of your PC
- Use a direct cable when download via TFTP the rescue.8132 file

Original comment by pietro.m...@gmail.com on 16 Feb 2012 at 11:17

GoogleCodeExporter commented 9 years ago
Yeah the firmware updater doesn't touch the bootloader so recovery via serial 
cable should generally be possible.

Did you get anything on the console when it tried to boot? I'm curious why it 
seems to be failing in some cases.

I'm still trying to figure out why samba doesn't work right. The only 
workaround so far is to disable scatter/gather support in the nic driver, but 
that could hurt performance..

Original comment by stefansc...@googlemail.com on 16 Feb 2012 at 4:45