HMNHD 2.104 - Own Linux

Post Reply
tenshisan
Posts: 2
Joined: Sat Apr 28, 2012 9:10 pm

HMNHD 2.104 - Own Linux

Post by tenshisan » Sat Apr 28, 2012 9:13 pm

Hey Guys,
Iam a Linux-Freak is there any way to install my own Linux-Distribution (Arch Linux) on the NAS and build it for my needings?

Mijzelf
Posts: 6199
Joined: Mon Jun 16, 2008 10:45 am

Re: HMNHD 2.104 - Own Linux

Post by Mijzelf » Sun Apr 29, 2012 12:32 pm

Sure. When you look at the Wiki you'll see that this box uses u-boot to load a kernel from harddisk, and start it with the commandline 'root=/dev/sda1 init=/linuxrc'. So as long as you provide a valid rootfs in /dev/sda1, and a startscript in /linuxrc, it will work fine.
There is (AFAIK) only one catch: the driver of the nic is in gmac.ko, and when loading this module it will request for some nic firmware (which is available in /lib/firmware). In the Debian Lenny based stock firmware udevd takes care of that (which has to be started before loading the gmac module). I suppose Arch can provide the same functionality.
Maybe this can be circumvented by bulding a kernel from the ZyXEL NSA-210 GPL sources. That box uses the same SoC, and seems to have the nic driver build-in.
You could first try to run Arch from an USB stick.
Search the forum and the Wiki for 'running Debian' and 'running from USB stick' for more details.

geyperman
Posts: 65
Joined: Sun Jun 06, 2010 9:52 pm

Re: HMNHD 2.104 - Own Linux

Post by geyperman » Mon Apr 30, 2012 9:32 am

Hi. Months ago I was looking to build a custom firmware. I was able to build one based in debian squeeze with udev from lenny. I didn't find how to enable power button and some other stuff I don't remember.

Now I want to restart the project and I took a look to Arch Linux Arm. I found that last releases needs kernel versions newer than what we have. I'm not very skilled compiling from source code. Do you think it could be possible to build an updated functional kernel?

Mijzelf
Posts: 6199
Joined: Mon Jun 16, 2008 10:45 am

Re: HMNHD 2.104 - Own Linux

Post by Mijzelf » Mon Apr 30, 2012 3:40 pm

I was wondering the same. As you may know this box runs an Oxnas 810 SoC, and the GPL sources of boxes using this SoC that I'm aware of, all use the same old 2.6.24.4 kernel.
But. The successor of the 810 is the (dual core) 820, the one which is used in the HMNHD CE. This SoC is also in the Pogoplug Pro. The GPL sources of this pogoplug contains an 2.6.31.6-r2 kernel, and to my surprise this kernel also seems to have 810 support.
I tried to build it, but it fails on me with 'Error: selected processor does not support `clrex''. I get the same error when I try to build an 820 kernel, so maybe I should try another compiler.

geyperman
Posts: 65
Joined: Sun Jun 06, 2010 9:52 pm

Re: HMNHD 2.104 - Own Linux

Post by geyperman » Mon Apr 30, 2012 4:08 pm

Mijzelf wrote:I was wondering the same. As you may know this box runs an Oxnas 810 SoC, and the GPL sources of boxes using this SoC that I'm aware of, all use the same old 2.6.24.4 kernel.
But. The successor of the 810 is the (dual core) 820, the one which is used in the HMNHD CE. This SoC is also in the Pogoplug Pro. The GPL sources of this pogoplug contains an 2.6.31.6-r2 kernel, and to my surprise this kernel also seems to have 810 support.
No way to get 3.x version? Make sense?
I tried to build it, but it fails on me with 'Error: selected processor does not support `clrex''. I get the same error when I try to build an 820 kernel, so maybe I should try another compiler.
Are you compiling "natively" in box o cross compiling?

tenshisan
Posts: 2
Joined: Sat Apr 28, 2012 9:10 pm

Re: HMNHD 2.104 - Own Linux

Post by tenshisan » Mon Apr 30, 2012 5:25 pm

kay this Seams to hardcore for me.
I wanted an web server setup for an website, and turn on the indexing service cuz I want to add the sheared folders to my library in windows 7 without copying to offline files...

Mijzelf
Posts: 6199
Joined: Mon Jun 16, 2008 10:45 am

Re: HMNHD 2.104 - Own Linux

Post by Mijzelf » Tue May 01, 2012 5:46 pm

geyperman wrote:No way to get 3.x version?
Don't know. The problem is that the Oxnas processors are not supported by the vanilla kernel. So you're dependent on the port provided by Oxford, which is the famous 2.6.24.4 kernel. OpenEmbedded has done some effort to support the 810, but stopped it.
That's why I was surprised to see 810 support in a 2.6.31 kernel.
Are you compiling "natively" in box o cross compiling?
I am compiling on an Arm.

Driminicus
Posts: 160
Joined: Fri Apr 08, 2011 9:59 am

Re: HMNHD 2.104 - Own Linux

Post by Driminicus » Wed May 02, 2012 2:27 pm

tenshisan wrote:kay this Seams to hardcore for me.
I wanted an web server setup for an website, and turn on the indexing service cuz I want to add the sheared folders to my library in windows 7 without copying to offline files...
I am by no means a linux freak, but I can help you with the last part. Look here or here.
Oh, and I think you should be able to host a website on your nas without rebuilding the kernel. You should be able to install a webserver when you have root access (which is easy to get).
If you want more specifics, you should probably ask Mijzelf or someone else more knowledgeable than me.

geyperman
Posts: 65
Joined: Sun Jun 06, 2010 9:52 pm

Re: HMNHD 2.104 - Own Linux

Post by geyperman » Wed May 09, 2012 2:53 pm

Mijzelf wrote:
geyperman wrote:Are you compiling "natively" in box o cross compiling?
I am compiling on an Arm.
I tried to cross compile the pogoplug source using emdebian cross toolchain. I get no errors compiling for 820, but when compiling for 810 I get the same errors with clrex.

I guess that we can patch irq.c to do a "dummy Store-Exclusive" instead of the clrex.

Page 11 Resetting monitors : http://infocenter.arm.com/help/topic/co ... itives.pdf

Examples #1
Examples #2

Mijzelf
Posts: 6199
Joined: Mon Jun 16, 2008 10:45 am

Re: HMNHD 2.104 - Own Linux

Post by Mijzelf » Wed May 09, 2012 7:18 pm

Good catch! And I'm surprised that this is necessary. I checked the 3.2 kernel, and it contains the same code in irq.c. That patch is dated 2008. Why doesn't the vanilla kernel do this?

geyperman
Posts: 65
Joined: Sun Jun 06, 2010 9:52 pm

Re: HMNHD 2.104 - Own Linux

Post by geyperman » Wed May 09, 2012 8:14 pm

:D
Can you patch and try to compile?
I could try to patch and cross compile tomorrow, but I'm not very skilled.

UPDATE:
As asm_do_IRQ function in irq.c doesn't have a reset in kernel 2.6.24.4 neither in 2.6.32.1, I commented both paragraphs in arch/arm/kernel/irq.c from pogoplug 2.6.31.6-r2:
/* clrex not supported in OXNAS810
// Issue a clrex to invalidate any locks in case the interrupt performs
// any cache ops
__asm__ __volatile__(
"clrex\n"
:
:
:"cc");
*/
Maybe would be better to use strex, but I don't know which parameters are right.

As I'm not very used to configure and compile kernels, I copied the .config from iomega source kernel (2.6.24.4) and with "make menuconfig" unselected the option "Load LEON power button monitoring program" to avoid the following error:
arch/arm/mach-oxnas/oxnas.c:957:41: error: mach/leon-power-button-prog.h: No such file or directory
After this, doing a make uImage:
[...]
UIMAGE arch/arm/boot/uImage
Image Name: Linux-2.6.31.6
Created: Thu May 10 10:36:58 2012
Image Type: ARM Linux Kernel Image (uncompressed)
Data Size: 1700380 Bytes = 1660.53 kB = 1.62 MB
Load Address: 0x48008000
Entry Point: 0x48008000
Image arch/arm/boot/uImage is ready
If useful, maybe we can get "mach/leon-power-button-prog.h" from another sources.

UPDATE2:

I copied leon-power-button-prog.h from arch/arm/mach-ox820/include/mach to arch/arm/mach-oxnas/include/mach. The iomega .config compiles without errors, but I don't know if it will work.

I tried to compile with ox810_dse_defconfig and I got some errors. I'd guess it would work.

I will try to boot with the uImage 2.6.31r2 using reloaded.ko, but last time I tried make it work, I hadn't success. I haven't jtag and I'm doing it blind.

zerb
Posts: 2
Joined: Wed Apr 21, 2010 10:07 pm

Re: HMNHD 2.104 - Own Linux

Post by zerb » Thu May 10, 2012 9:22 pm

Please keep us posted, I'm dying to use a more up-to-date kernel!

Mijzelf
Posts: 6199
Joined: Mon Jun 16, 2008 10:45 am

Re: HMNHD 2.104 - Own Linux

Post by Mijzelf » Sat May 12, 2012 5:55 pm

Hm. There is more wrong than only irq.c. drivers/net/gmac/gmac-napi.c misses some defines. I copied them from mach-ox820. Now the kernel compiles, but still doesn't work.
It spits kilobytes of gibberish. That might be due to a wrong baudrate, but I don't think so. There is too much data to be a bootlog. My logfile of a simple reboot is 500k. The first part:

Code: Select all

reloaded for DNS-323, 2007 tp@fonz.de
Physical memory 0x48000000-0x4C000000, 64 MiB
kernel load address: 48008000
kernel start address: 48008000
initrd load address: 48800000
taglist load address: 48000100
zImage: 2140316 bytes
not using 131072 bytes reserved memory at c0480000 / 48480000
not using 131072 bytes reserved memory at c0440000 / 48440000
not using 131072 bytes reserved memory at c0400000 / 48400000
loaded 131072 of 2140316 bytes at c2fc0000 / 4afc0000
loaded 131072 of 2140316 bytes at c2fe0000 / 4afe0000
loaded 131072 of 2140316 bytes at c2f80000 / 4af80000
not using 131072 bytes reserved memory at c0520000 / 48520000
not using 131072 bytes reserved memory at c0540000 / 48540000
not using 131072 bytes reserved memory at c0560000 / 48560000
not using 131072 bytes reserved memory at c0580000 / 48580000
not using 131072 bytes reserved memory at c05a0000 / 485a0000
not using 131072 bytes reserved memory at c05c0000 / 485c0000
loaded 131072 of 2140316 bytes at c2e80000 / 4ae80000
loaded 131072 of 2140316 bytes at c2ea0000 / 4aea0000
loaded 131072 of 2140316 bytes at c2ec0000 / 4aec0000
loaded 131072 of 2140316 bytes at c2e00000 / 4ae00000
loaded 131072 of 2140316 bytes at c2a40000 / 4aa40000
loaded 131072 of 2140316 bytes at c2a00000 / 4aa00000
loaded 131072 of 2140316 bytes at c2a20000 / 4aa20000
loaded 131072 of 2140316 bytes at c3aa0000 / 4baa0000
loaded 131072 of 2140316 bytes at c3680000 / 4b680000
loaded 131072 of 2140316 bytes at c3720000 / 4b720000
loaded 131072 of 2140316 bytes at c2f20000 / 4af20000
loaded 131072 of 2140316 bytes at c3ac0000 / 4bac0000
loaded 131072 of 2140316 bytes at c2a80000 / 4aa80000
loaded 43164 of 2140316 bytes at c2ac0000 / 4aac0000
zImage: OK (17 segments)
reboot_machtype = 1152
ATAG_CORE: pagesize 4096
ATAG_MEM: start 48000000 size 64MiB
ATAG_CMDLINE: elevator=cfq panic=20 root=/dev/sda1 rootwait console=ttyS0,115200 init=/sbin/init mem=64M
reboot_taglist  = 4bf73000 (c3f73000)
copying 2176 bytes reboot code from bf00033c to c272e000
reboot_reboot_start  = 4a72e000
Reloading...
Uncompressing Linux................................................................................................................................. done, booting the kernel.
œÙÞåø@æÅâãÙßÞ@b^f^ca^f@XÙÚúÅÜƀÆÙÜÅãÅâæÅâY@XÇÃÃ@æÅâãÙßÞ@d^d^e@X„ÅÂÙÁÞ@d^d^e]xY@Y@Ca`b@£Áä@Áù@ab@axze`zd`@ƒ…£€@b`abƒ ¥z@¢ybf…š]£@»da`fybfeœ@âÅæÙãÙßÞ@e@X¢æe€…šY\@Ãâ}```ecaggƒ ¥z@Š™Š€@ÄÁäÁ@ÃÁÃØÅ\@Š™Š€@ÙÞãäâåÃäÙßÞ@ÃÁÃØŝÁÃØÙÞÅz@Ÿøã•eEâ*”Zƒ

geyperman
Posts: 65
Joined: Sun Jun 06, 2010 9:52 pm

Re: HMNHD 2.104 - Own Linux

Post by geyperman » Mon May 14, 2012 6:51 am

what a pity... :(

Post Reply