Which Chroot?

Ethernet disk mini v2
Post Reply
gerdich
Posts: 16
Joined: Sun Jul 19, 2009 11:39 pm

Which Chroot?

Post by gerdich » Wed Sep 02, 2009 6:24 am

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.

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

Re: Which Chroot?

Post by Mijzelf » Wed Sep 02, 2009 8:15 am

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: Select all

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: Select all

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)
... 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.

gerdich
Posts: 16
Joined: Sun Jul 19, 2009 11:39 pm

Re: Which Chroot?

Post by gerdich » Wed Sep 02, 2009 9:35 pm

Thank you very much for your very precise answer!!!

This is an excellent description!!!

Code: Select all

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
/bin/sh permission denied
Then after a remount of the usb drive (with the debian on it) it writes:

Code: Select all

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?

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

Re: Which Chroot?

Post by Mijzelf » Thu Sep 03, 2009 5:16 pm

The step from
It should be less difficult than some other NASses
to
Now you say that it is easy to replace the kernel?
is rather big.
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?

gerdich
Posts: 16
Joined: Sun Jul 19, 2009 11:39 pm

Re: Which Chroot?

Post by gerdich » Fri Sep 04, 2009 9:05 am

The step is rather big.
Yes I was kidding in an optimistic way.

Code: Select all

LacieData /root # whoami
root
I think that lenny doesn't work with the kernel of my box.
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?

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

Re: Which Chroot?

Post by Mijzelf » Fri Sep 04, 2009 10:21 am

I think that lenny doesn't work with the kernel of my box.
According to this forum Etch should work.
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, ...

rosbif
Posts: 112
Joined: Thu May 08, 2008 11:23 am
Location: near Toulouse, France

Re: Which Chroot?

Post by rosbif » Tue Sep 15, 2009 9:11 pm

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

gerdich
Posts: 16
Joined: Sun Jul 19, 2009 11:39 pm

Re: Which Chroot--> found it!

Post by gerdich » Wed Sep 23, 2009 2:22 pm

Code: Select all

 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.
)

rosbif
Posts: 112
Joined: Thu May 08, 2008 11:23 am
Location: near Toulouse, France

Re: Which Chroot--> found it!

Post by rosbif » Wed Sep 23, 2009 6:07 pm

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: viewtopic.php?p=301#p301 and subsequent posts in the same topic are still valid.

Happy compiling ;)

Cheers,
Chris

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

Re: Which Chroot--> found it!

Post by Mijzelf » Wed Sep 23, 2009 6:28 pm

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: Select all

cd /mnt/usbstick
wget ftp://ip.of.ftp.server/debian.tar.gz
tar xvzf debian.tar.gz
chroot /mnt/usbstick /debootstrap/debootstrap --second-stage

gerdich
Posts: 16
Joined: Sun Jul 19, 2009 11:39 pm

Re: Which Chroot?

Post by gerdich » Wed Sep 23, 2009 11:33 pm

'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.

rosbif
Posts: 112
Joined: Thu May 08, 2008 11:23 am
Location: near Toulouse, France

Re: Which Chroot?

Post by rosbif » Thu Sep 24, 2009 4:42 am

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.

gerdich
Posts: 16
Joined: Sun Jul 19, 2009 11:39 pm

Re: Which Chroot?

Post by gerdich » Thu Sep 24, 2009 12:51 pm

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?

rosbif
Posts: 112
Joined: Thu May 08, 2008 11:23 am
Location: near Toulouse, France

Re: Which Chroot?

Post by rosbif » Thu Sep 24, 2009 7:37 pm

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).

Post Reply