Using debootstrap for install X86 -> ARM
Hi all!
At work they gave me the following task (and i need some help from you guys!):
At work we have a normal PC running Ubuntu 9.10 (32-bit), which works good.
We also have a LaCie Ethernet Disk Mini v2, which runs embedded Linux (RedHat), but is so trimmed down, you can't use the disk we would like to use it.
The task is this: On the X86 machine, make a bootable image for the ARM architecture and write it to a harddisk (which fits the LaCie offc.) so it can boot off it.
Now i have done some investigation, but don't know how to combine it all:
- I can use debootstrap to create a minimal Debian system, but there comes the problem, you can't chroot into a foreign created system (i.e. X86 cannot chroot into ARM system).
- I can use QEMU, which can emulate a ARM processor, but can i use the image that QEMU uses as a normal image for a harddisk, so it would boot off it (when using dd to write it to a real harddisk)?
- Current kernels support the LaCie hardware (Marvell chipset)
- I know how to use tools such as dd, so if the image is generated i can write it to disk and have the LaCie boot from it.
The LaCie box has the following:
1 ARM9 ARMv5TEJ (266 MHz) CPU with 64 Mb RAM, Gigabit network controller and 1 usb host port, internal there is a sata port obviously.
The only thing i want at the moment is to have the LaCie boot Debian and i can SSH into it, from there the rest is easy as pie.
Is someone willing to help me accomplish this task? It would seriously mean and help alot!
If all goes well and if i get all things up and running i would like to make a Howto of it and place that here, maybe it will be of some use !
Comments
-
Is this what you want to do? http://wiki.debian.org/EmDebian/CrossDebootstrap
Otherwise, you may want to consider a smaller distro, like Angstrom (http://www.angstrom-distribution.org/) or you'll have to compile a cross compiling tool chain and build your own packages and distribution essentially using something akin to OpenEmbeded.0 -
Thanks for your reply!
It looks very useful, but i have a question about it:
The device does not have a screen or keyboard to attach to it, but i've read the EmDebian howto and it's focussed on the fact that the device should boot from NFS, which i think the LaCie box does not support, or am i getting something wrong?
I've set up the first stage of debootstrap, which leaves me with a folder with basic Debian installed, i need to copy it over and do a chroot, but i can't chroot on the LaCie box, since it has not that utility, so there i am stuck again.
The howto speaks of QEMU, however, nowhere in the tutorial it is being used.
Should i create a ARM VM in QEMU and then run the processes again?0 -
That is exactly how I would approach this. I would build the entire thing on the x86 machine first, using QEMU to run and test the ARM code. Once you have successfully created a working installation, then I would go ahead and copy it over to the lacie. Unfortunately, I've never used a LaCie, but I have done something similar in the past with other headless hardware.0
-
Ok, I read up a bit mroe about the device you have. I think you're not facing a trivial task
I foudn this article where someone essentially had to remove the disk from the unit and mount it in their pc to be bale to make modifications: http://jim.studt.net/edmini/index.html
If you are OK with voiding the warranty, this is the way to go, since there doesn't seem to be a serial port on the boar (again I don't have one of my own to examine). So, essentially, do the debbootstrap thing, and start to build an image on youe x86 w/ apps for ARM. you should be able to get away w/ not having to cross compile everything, since Debian support arm, and has binary packages. Once you have *most* of it working, you'll need to create a disk image and copy your new system into that disk image. The image will essentially just be a file holding a partition. If you don't know how to do this, let me know, and I'll explain. Then, you will need to use that disk image as a disk for QEMU if you want to test it first. The only thing I'm fuzzon on is the boot loader. You want to examine the first 512 bytes of the disk that shipped with the device to see if you can determine what boot loader it uses. If it's grub, you should be able to install it into your created disk image using QEMU. If it's not, well, things can get a little more tricky.
good luck, and keep me posted. I'm curious.0 -
one more thing. In the ubuntu repository, there is the following package that might be of help you, too:
qemu-arm-static - - static qemu-arm binary that enables to use arm chroots0 -
Hi,
Thanks for the info and support so far!
I already voided my warranty, as i got it from my work, which bought it 2 years ago, so no warranty left.
I modified in such ways that i have SSH access on the box and i have made a 1:1 copy of the entire distribution to a old S-ATA disk, so if install fails i always can roll back.
I found some info as well, the bootloader is U-Boot and the partition scheme default is this:
SDA1 -> EXT3 with BOOT flag, about 3Gb
SDA2 -> SWAP (512 Mb)
SDA3 -> EXT3 that holds the userfiles (the space you see as available)
SDA4 -> Extended partition (90 Mb)
SDA5 -> Unformatted (16 Mb)
SDA6 -> Unformatted (8 Mb)
SDA7 -> EXT3, that holds the boot kernel (if this partition is not available it won't boot at all)
My guess is that there is some link in uboot to boot from the 1st partition, which automatically links to the 7th partition in order to boot and then switch back to the 1st partition to load config files etc.
Is it possible to copy the debootstrapped system to the LaCie and then in fstab let it mount to it on /proc instead of the LaCie system proc? Should kernels be the same or won't that matter in this part?
I also found out that there is a RS232 / JTAG interface soldered onto the main board, which can be hooked up with a Nokia DKU5 USB cable LOL! With that cable linked you can command U-Boot!
I've shot 3 photo's of the main board, for reference, the board says ED MINI V2, altho, the V2 has a USB B connector for connection with a PC, and mine does not have any (which only the V1 had), strange? Maybe it's a refurb?
Another strange thing is that the V2 uses XFS by default (according to LaCie) and mine uses EXT3 (also the V1 specifications...).
Strangely the only thing that does seem to be true is the CPU, the ARM9, which was a PPC on V1. Also V1 had 32 Mb RAM and mine has 64 Mb.
http://langerak.ath.cx/downloads/lacie (for photo's)
Ok, another edit:
I've managed to do a debootstrap for the ARM arch. Tarred the stuff, scp'ed it to the LaCie (with the LaCie software running). Untarred it, copied chroot to /usr/sbin and now i am able to chroot into the minimal Debian system. I ran debootstraps secpnd stage and got it minimally working
. Only the supplied rm executable was faulty, copied that from the LaCie system into the debian chroot and now i can install lot's of software offcourse.
By the way, you said it would be trivial, is it manageable to install Linux on it? I like to learn alot from this process and really try to get this to work, but do you think it'll ever work the way i want it?0 -
Well, 1 week later and still haven't got any progress in this...
Maybe this won't work after all? Some ppl say that they did manage to install Debian on it and some say it's not possible due to the kernel being flashed into ROM.
As said before, i am now able to chroot within the LaCie linux, so chrooting into Ubuntu is what i can do.
Since this is working, now i need a way to install a kernel into it and modify it so that U-Boot can boot off it. Or even better. Make an image which i can put on the harddisk (dd or partimage), put the disk back in the LaCie and let it boot.
Any suggestions or tips? Still want to make this work!0 -
langerak wrote:Since this is working, now i need a way to install a kernel into it and modify it so that U-Boot can boot off it. Or even better. Make an image which i can put on the harddisk (dd or partimage), put the disk back in the LaCie and let it boot.
Any suggestions or tips? Still want to make this work!
Hi, I am trying to do the same thing, use QEMU to run an ARM kernel under a i686 system.
I found these links:
[ul][li]
http://balau82.wordpress.com/2010/04/12/booting-linux-with-u-boot-on-qemu-arm/[/li][li]
http://arstechnica.com/civis/viewtopic.php?f=16&t=1110090[/li][/ul]
Still have not gotten it to work. Please, let me know if you can?0
Categories
- 10.1K All Categories
- 35 LFX Mentorship
- 88 LFX Mentorship: Linux Kernel
- 504 Linux Foundation Boot Camps
- 279 Cloud Engineer Boot Camp
- 103 Advanced Cloud Engineer Boot Camp
- 48 DevOps Engineer Boot Camp
- 41 Cloud Native Developer Boot Camp
- 2 Express Training Courses
- 2 Express Courses - Discussion Forum
- 1.8K Training Courses
- 17 LFC110 Class Forum
- 5 LFC131 Class Forum
- 20 LFD102 Class Forum
- 148 LFD103 Class Forum
- 13 LFD121 Class Forum
- 61 LFD201 Class Forum
- LFD210 Class Forum
- 1 LFD213 Class Forum - Discontinued
- 128 LFD232 Class Forum
- 23 LFD254 Class Forum
- 569 LFD259 Class Forum
- 100 LFD272 Class Forum
- 1 LFD272-JP クラス フォーラム
- 1 LFS145 Class Forum
- 23 LFS200 Class Forum
- 739 LFS201 Class Forum
- 1 LFS201-JP クラス フォーラム
- 1 LFS203 Class Forum
- 45 LFS207 Class Forum
- 298 LFS211 Class Forum
- 53 LFS216 Class Forum
- 46 LFS241 Class Forum
- 41 LFS242 Class Forum
- 37 LFS243 Class Forum
- 10 LFS244 Class Forum
- 27 LFS250 Class Forum
- 1 LFS250-JP クラス フォーラム
- 131 LFS253 Class Forum
- 998 LFS258 Class Forum
- 10 LFS258-JP クラス フォーラム
- 87 LFS260 Class Forum
- 126 LFS261 Class Forum
- 31 LFS262 Class Forum
- 79 LFS263 Class Forum
- 15 LFS264 Class Forum
- 10 LFS266 Class Forum
- 17 LFS267 Class Forum
- 17 LFS268 Class Forum
- 21 LFS269 Class Forum
- 200 LFS272 Class Forum
- 1 LFS272-JP クラス フォーラム
- 212 LFW211 Class Forum
- 154 LFW212 Class Forum
- 899 Hardware
- 217 Drivers
- 74 I/O Devices
- 44 Monitors
- 115 Multimedia
- 208 Networking
- 101 Printers & Scanners
- 85 Storage
- 749 Linux Distributions
- 88 Debian
- 64 Fedora
- 14 Linux Mint
- 13 Mageia
- 24 openSUSE
- 133 Red Hat Enterprise
- 33 Slackware
- 13 SUSE Enterprise
- 355 Ubuntu
- 473 Linux System Administration
- 38 Cloud Computing
- 69 Command Line/Scripting
- Github systems admin projects
- 94 Linux Security
- 77 Network Management
- 108 System Management
- 49 Web Management
- 63 Mobile Computing
- 22 Android
- 27 Development
- 1.2K New to Linux
- 1.1K Getting Started with Linux
- 528 Off Topic
- 127 Introductions
- 213 Small Talk
- 20 Study Material
- 794 Programming and Development
- 262 Kernel Development
- 498 Software Development
- 923 Software
- 258 Applications
- 182 Command Line
- 2 Compiling/Installing
- 76 Games
- 316 Installation
- 54 All In Program
- 54 All In Forum
Upcoming Training
-
August 20, 2018
Kubernetes Administration (LFS458)
-
August 20, 2018
Linux System Administration (LFS301)
-
August 27, 2018
Open Source Virtualization (LFS462)
-
August 27, 2018
Linux Kernel Debugging and Security (LFD440)