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
- All Categories
- 167 LFX Mentorship
- 219 LFX Mentorship: Linux Kernel
- 801 Linux Foundation IT Professional Programs
- 357 Cloud Engineer IT Professional Program
- 181 Advanced Cloud Engineer IT Professional Program
- 83 DevOps Engineer IT Professional Program
- 149 Cloud Native Developer IT Professional Program
- 112 Express Training Courses
- 138 Express Courses - Discussion Forum
- 6.2K Training Courses
- 48 LFC110 Class Forum - Discontinued
- 17 LFC131 Class Forum
- 35 LFD102 Class Forum
- 227 LFD103 Class Forum
- 19 LFD110 Class Forum
- 39 LFD121 Class Forum
- 15 LFD133 Class Forum
- 7 LFD134 Class Forum
- 17 LFD137 Class Forum
- 63 LFD201 Class Forum
- 3 LFD210 Class Forum
- 5 LFD210-CN Class Forum
- 2 LFD213 Class Forum - Discontinued
- 128 LFD232 Class Forum - Discontinued
- 1 LFD233 Class Forum
- 2 LFD237 Class Forum
- 23 LFD254 Class Forum
- 697 LFD259 Class Forum
- 109 LFD272 Class Forum
- 3 LFD272-JP クラス フォーラム
- 10 LFD273 Class Forum
- 154 LFS101 Class Forum
- 1 LFS111 Class Forum
- 1 LFS112 Class Forum
- 1 LFS116 Class Forum
- 1 LFS118 Class Forum
- LFS120 Class Forum
- 7 LFS142 Class Forum
- 7 LFS144 Class Forum
- 3 LFS145 Class Forum
- 1 LFS146 Class Forum
- 3 LFS147 Class Forum
- 1 LFS148 Class Forum
- 15 LFS151 Class Forum
- 1 LFS157 Class Forum
- 34 LFS158 Class Forum
- 8 LFS162 Class Forum
- 1 LFS166 Class Forum
- 1 LFS167 Class Forum
- 3 LFS170 Class Forum
- 2 LFS171 Class Forum
- 1 LFS178 Class Forum
- 1 LFS180 Class Forum
- 1 LFS182 Class Forum
- 1 LFS183 Class Forum
- 29 LFS200 Class Forum
- 736 LFS201 Class Forum - Discontinued
- 2 LFS201-JP クラス フォーラム
- 14 LFS203 Class Forum
- 102 LFS207 Class Forum
- 1 LFS207-DE-Klassenforum
- 1 LFS207-JP クラス フォーラム
- 301 LFS211 Class Forum
- 55 LFS216 Class Forum
- 48 LFS241 Class Forum
- 48 LFS242 Class Forum
- 37 LFS243 Class Forum
- 15 LFS244 Class Forum
- LFS245 Class Forum
- LFS246 Class Forum
- 50 LFS250 Class Forum
- 1 LFS250-JP クラス フォーラム
- LFS251 Class Forum
- 155 LFS253 Class Forum
- LFS254 Class Forum
- LFS255 Class Forum
- 5 LFS256 Class Forum
- 1 LFS257 Class Forum
- 1.3K LFS258 Class Forum
- 10 LFS258-JP クラス フォーラム
- 121 LFS260 Class Forum
- 159 LFS261 Class Forum
- 41 LFS262 Class Forum
- 82 LFS263 Class Forum - Discontinued
- 15 LFS264 Class Forum - Discontinued
- 11 LFS266 Class Forum - Discontinued
- 20 LFS267 Class Forum
- 25 LFS268 Class Forum
- 31 LFS269 Class Forum
- 1 LFS270 Class Forum
- 199 LFS272 Class Forum
- 1 LFS272-JP クラス フォーラム
- LFS274 Class Forum
- 3 LFS281 Class Forum
- 10 LFW111 Class Forum
- 261 LFW211 Class Forum
- 182 LFW212 Class Forum
- 13 SKF100 Class Forum
- 1 SKF200 Class Forum
- 1 SKF201 Class Forum
- 782 Hardware
- 198 Drivers
- 68 I/O Devices
- 37 Monitors
- 96 Multimedia
- 174 Networking
- 91 Printers & Scanners
- 83 Storage
- 758 Linux Distributions
- 80 Debian
- 67 Fedora
- 15 Linux Mint
- 13 Mageia
- 23 openSUSE
- 143 Red Hat Enterprise
- 31 Slackware
- 13 SUSE Enterprise
- 348 Ubuntu
- 461 Linux System Administration
- 39 Cloud Computing
- 70 Command Line/Scripting
- Github systems admin projects
- 90 Linux Security
- 77 Network Management
- 101 System Management
- 46 Web Management
- 64 Mobile Computing
- 17 Android
- 34 Development
- 1.2K New to Linux
- 1K Getting Started with Linux
- 371 Off Topic
- 114 Introductions
- 174 Small Talk
- 19 Study Material
- 806 Programming and Development
- 304 Kernel Development
- 204 Software Development
- 1.8K Software
- 211 Applications
- 180 Command Line
- 3 Compiling/Installing
- 405 Games
- 309 Installation
- 97 All In Program
- 97 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)