General NAS-Central Forums

Welcome to the NAS community
It is currently Mon Nov 20, 2017 12:24 am

All times are UTC




Post new topic Reply to topic  [ 14 posts ] 
Author Message
 Post subject: Which Chroot?
PostPosted: Wed Sep 02, 2009 6:24 am 
Offline

Joined: Sun Jul 19, 2009 11:39 pm
Posts: 16
I've got working an edmini v2 with ipkg packages (NSLU2).
Now I want to have a debian chroot.
In this tutorial the author proposes "PowerPC"

http://luon.net/~admar/journal/LaCieEth ... kMini.html

Some links present this as a tutorial for edmini v2.
But as far as I know edmini v2 is "armel" and in fact my nslu packages are "Armel".
So I didn't believe this tutorial and didn't follow.
I've installed an "Armel" chroot with "Lenny" on a usb-device.
But I get "bin/sh: permission denied" and after remounting "FATAL: Kernel is too old".

Can somebody give me more information an the debootstrap command:

Is it really "Armel"?
Can I take Lenny or have I got to downgrade to Etch or SID.


(... and: Is it possible to upgrade the Kernel of an Edmini v2?)



Thanks for every help.


Top
 Profile  
 
 Post subject: Re: Which Chroot?
PostPosted: Wed Sep 02, 2009 8:15 am 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6072
When armel nslu packages run on your box, it's definitely armel. Lenny dumped support for 2.4 kernels, but according to the wiki your box has a 2.6.12 kernel. You could try Etch.

The command should be something like:
Code:
su
mkdir /tmp/debian
debootstrap --foreign --arch armel lenny /tmp/debian
cd /tmp/debian
tar cvzf ../debian.tar.gz *
The tarball should be unpacked on the Edmini and chrooted:
Code:
cd /path/to/debian
wget ftp://ip.of.ftp.server/debian.tar.gz
tar xvzf debian.tar.gz
chroot /path/to/debian /debootstrap/debootstrap --second-stage
It is possible that it still won't run, when the kernel is compiled with the wrong settings. (No EABI support)

Quote:
... and: Is it possible to upgrade the Kernel of an Edmini v2?
Theoretically, yes. It should be less difficult than some other NASses either, because:
1) The vanilla kernel contains Marvell Orion support now. (Your box has a Marvell 88F5182 soc)
2) The kernel is on HD, and can easily be backupped, exchanged and restored.


Top
 Profile  
 
 Post subject: Re: Which Chroot?
PostPosted: Wed Sep 02, 2009 9:35 pm 
Offline

Joined: Sun Jul 19, 2009 11:39 pm
Posts: 16
Thank you very much for your very precise answer!!!

This is an excellent description!!!

Code:
debootstrap --foreign --arch armel lenny /tmp/debian

Ths is EXACTLY what I did (except /tmp/debian)

So the problem must be another one.
But the chroot command doesn't work.
First it writes anything like
Quote:
/bin/sh permission denied


Then after a remount of the usb drive (with the debian on it) it writes:
Code:
FATAL: kernel too old


Now you say that it is easy to replace the kernel?

Does anybody have a compiled kernel for armel ready for download?


Top
 Profile  
 
 Post subject: Re: Which Chroot?
PostPosted: Thu Sep 03, 2009 5:16 pm 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6072
The step from
Quote:
It should be less difficult than some other NASses
to
Quote:
Now you say that it is easy to replace the kernel?
is rather big.

Quote:
Does anybody have a compiled kernel for armel ready for download?
You don't need a kernel for armel, you need a kernel for your box. Which means it should support the (S)ATA interface, the USB chip, the network chip, and maybe some gpio chip to switch the fan.
Maybe the vanilla kernel for Marvell Orion is good enough, but it is possible that you still should add some drivers.

Are you sure you've got root rights when you chroot Debian?


Top
 Profile  
 
 Post subject: Re: Which Chroot?
PostPosted: Fri Sep 04, 2009 9:05 am 
Offline

Joined: Sun Jul 19, 2009 11:39 pm
Posts: 16
Quote:
The step is rather big.

Yes I was kidding in an optimistic way.

Code:
LacieData /root # whoami
root

I think that lenny doesn't work with the kernel of my box.

Quote:
Maybe the vanilla kernel for Marvell Orion is good enough, but it is possible that you still should add some drivers.

I can add drivers if I know which ones, but network and sata have to work. Without that I'm lost.

One question to the "Marvel Orion":
I've seen that some users flash the bootloader and the bios.
Is this useful or necessery.
I'm a little bit afraid of that because I'm not so good in electronics and probably not capable to solder a JTAG interface.
(But I can use a nokia-DKU)

Now the question:
Is it possible to activate the important features of u-boot and the bios with this kernel?
Other question: Does anybody have a solution to power up the box without manual intervention?


Top
 Profile  
 
 Post subject: Re: Which Chroot?
PostPosted: Fri Sep 04, 2009 10:21 am 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6072
Quote:
I think that lenny doesn't work with the kernel of my box.
According to this forum Etch should work.

Quote:
I've seen that some users flash the bootloader and the bios.
Is this useful or necessery.
AFAIK the bootloader *is* the bios, when it's in flash.
Depending on what people want to do it can be necessary to exchange the bootloader. In case of Linux the bootloader should locate and load the kernel in memory and maybe load some filesystem containing a script and all binaries needed to execute this script, and then pass the CPU to the kernel, and also pass some bootparameters.
When you want to fetch the kernel and initrd somewhere else (network,hd,flash,usbstick,...) or want to pass different parameters, or ..., then you'll have to flash another bootloader.

In your case both the kernel and rootfs are on harddisk. (partition 6 and 7). So I don't think it will be necessary to flash anything. Just get the disk out of the box, make a backup of partition 6, and put your own kernel on it. (When you've got shell-access you even could do this on the box itself)
The hard part is getting that kernel. You can download the GPL sources, and try to compile that and put in part6. If that works change .config to your taste, or download the latest kernelsources, ...


Top
 Profile  
 
 Post subject: Re: Which Chroot?
PostPosted: Tue Sep 15, 2009 9:11 pm 
Offline

Joined: Thu May 08, 2008 11:23 am
Posts: 112
Location: near Toulouse, France
Mijzelf wrote:
gerdich wrote:
I think that lenny doesn't work with the kernel of my box.
According to this forum Etch should work.

I agree: etch will run on top of the stock LaCie 2.6.12 kernel but lenny needs >= 2.6.16 IIRC :(
However this is from my rapidly failing memory :(

Cheers,
Chris


Top
 Profile  
 
PostPosted: Wed Sep 23, 2009 2:22 pm 
Offline

Joined: Sun Jul 19, 2009 11:39 pm
Posts: 16
Code:
 debootstrap --foreign --arch arm etch /mnt


With this chroot it works!!!


(but
a) I would preferre lenny with a new kernel :cry:

b) How can I boot from this chroot (on USB). It would be useful to make may harddisk sleep.
)


Top
 Profile  
 
PostPosted: Wed Sep 23, 2009 6:07 pm 
Offline

Joined: Thu May 08, 2008 11:23 am
Posts: 112
Location: near Toulouse, France
gerdich wrote:
a) I would preferre lenny with a new kernel :cry:

There is no great problem if you are prepared to compile your own kernel ;)
AFAIK the instructions I gave in this post: http://forum.nas-central.org/viewtopic.php?p=301#p301 and subsequent posts in the same topic are still valid.

Happy compiling ;)

Cheers,
Chris


Top
 Profile  
 
PostPosted: Wed Sep 23, 2009 6:28 pm 
Offline

Joined: Mon Jun 16, 2008 10:45 am
Posts: 6072
gerdich wrote:
b) How can I boot from this chroot (on USB). It would be useful to make may harddisk sleep.

'Boot from chroot'? Do you mean: How can I chroot Etch on an USB-stick?

Format an USB-stick ext2 or ext3. Plug it into the box. I suppose it will be automounted. Use the 'mount' command to find where it's mounted. Lets say it's /mnt/usbstick. Then
Code:
cd /mnt/usbstick
wget ftp://ip.of.ftp.server/debian.tar.gz
tar xvzf debian.tar.gz
chroot /mnt/usbstick /debootstrap/debootstrap --second-stage


Top
 Profile  
 
 Post subject: Re: Which Chroot?
PostPosted: Wed Sep 23, 2009 11:33 pm 
Offline

Joined: Sun Jul 19, 2009 11:39 pm
Posts: 16
Quote:
'Boot from chroot'? Do you mean: How can I chroot Etch on an USB-stick?


No. My chroot is already on a USB-Stick (a CF in fact).

Normally if you use "debootstrap" it is to create a new system. On my USB (CF) there is now a new system.
How can I boot that system instead of the system on the hard disk?

(With grub: I know how.
But with uboot: I don't know how.)

Another question:
How do I get the kernel of the hard disk as a file on the usb stick.


Top
 Profile  
 
 Post subject: Re: Which Chroot?
PostPosted: Thu Sep 24, 2009 4:42 am 
Offline

Joined: Thu May 08, 2008 11:23 am
Posts: 112
Location: near Toulouse, France
gerdich wrote:
Another question:
How do I get the kernel of the hard disk as a file on the usb stick.

The kernel on the hard disk is a uImage file.
The stock LaCie kernel is a raw uImage file on partition 6.
You can copy this using dd or even cp.

So getting the kernel onto a USB stick is no problem.
However I don't think the stock U-Boot can read a USB stick :( let alone boot from one.

Perhaps you could store a kernel (probably in a different form) on a USB stick and kexec it from a running Linux system.
Unfortunately I am not familiar with kexec and I have never used it :(

That said, your objective seems to be to let the hard disk spin down.
Putting the kernel on a USB stick will not help with that :(
The kernel file is read into memory once at boot time and the file is never accessed again.


Top
 Profile  
 
 Post subject: Re: Which Chroot?
PostPosted: Thu Sep 24, 2009 12:51 pm 
Offline

Joined: Sun Jul 19, 2009 11:39 pm
Posts: 16
Quote:
I don't think the stock U-Boot can read a USB stick


Is there perhaps a "SATA2-Splitter" to add a second sata-device?
(There are cheap driverless adapter to IDE: http://cgi.ebay.ch/SATA-IDE-SATA-conver ... 286.c0.m14 )

Or what about the network? Boot on nfs?


Top
 Profile  
 
 Post subject: Re: Which Chroot?
PostPosted: Thu Sep 24, 2009 7:37 pm 
Offline

Joined: Thu May 08, 2008 11:23 am
Posts: 112
Location: near Toulouse, France
gerdich wrote:
Is there perhaps a "SATA2-Splitter" to add a second sata-device?

I don't know of one.
However the EDmini v2 uses the same PCB as the EBD which has two SATA disks.
The second SATA connector is not fitted on the EDmini v2 but you should be able to fit one.
Otherwise you could possibly use the solder pads for eSATA.

gerdich wrote:
Or what about the network? Boot on nfs?

Yes, you can boot from the network (as I told you yesterday in another topic).


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 14 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 9 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group