• Diff for "groovy/Installation/Linaro/Source"
Differences between revisions 3 and 4
Revision 3 as of 2013-02-03 05:15:36
Size: 2902
Editor: Kai Franke
Comment:
Revision 4 as of 2013-02-04 17:54:20
Size: 3796
Editor: Kai Franke
Comment: Resize img file instructions now work *yay*
Deletions are marked like this. Additions are marked like this.
Line 16: Line 16:
Line 19: Line 20:
== Set up chroot environment == == Set up chroot environment and increase image size==
Line 21: Line 22:
Install qemu, create an empty image and mount it Install qemu, and increase image size
Line 25: Line 26:
}}}
Unfortunately using gparted on this image will not work. I tried multiple ways and this is the only way I got work. Create device maps from the partition table and symlinks for gparted
{{{
Line 34: Line 38:
Right click on the ext3 partition -> Resize/Move. Use all unallocated space to resize. As you might see, gparted converted the unallocated space to used space. That was not so cool. Exit gparted, delete the device maps, then create them again and start gparted afterwards using those commands.
{{{
sudo kpartx -d gumstix.img
sudo kpartx -a gumstix.img
sudo gparted gumstix.img
}}}
gparted will still see the new space as used. Now here comes the trick: Resize the ext3 partition again by making it just a tiny bit smaller. Apply your changes. If everything worked, gparted will now find the free space and you can resize it to the full size again. Exit gparted and be happy!

Installing ROS on Linaro Image from source

Install from source requires that you download and compile the source code on your own. Beware it might take days to compile natively on an embedded device for the desktop package and you will have to fix a few things described in the respective section. To speed things up, it is recommended to set up a chroot environment.

Get latest Linaro Image

On your Linux workstation do

sudo apt-get install git linaro-image-tools
git clone git://github.com/gumstix/Gumstix-Overo-Linaro.git 

Now you need to create the image.

linaro-media-create --rootfs ext3 --mmc gumstix.img --dev overo --hwpack Gumstix-Overo-Linaro/Gumstix-Overo-Linaro-armhf-HWPack.tar.gz --binary Gumstix-Overo-Linaro/Gumstix-Overo-Linaro-Precise-ALIP-armhf-RootFS.tar.gz

This will take a while (15 minutes), so feel free to grab a coffee

Now you can dd the image to a SD card and stick it into the gumstix or you can set up a chroot environment which will speed compilation up by magnitudes

== Set up chroot environment and increase image size== This is only needed if you want to speed up the installing process by working on an image instead of natively compiling on the embedded device. Install qemu, and increase image size

sudo apt-get install qemu qemu-user qemu-user-static kpartx
qemu-img resize gumstix.img 13G

Unfortunately using gparted on this image will not work. I tried multiple ways and this is the only way I got work. Create device maps from the partition table and symlinks for gparted

sudo kpartx -a gumstix.img
ls /dev/mapper/
ln -s /dev/mapper/loop0p1 gumstix.img1
ln -s /dev/mapper/loop0p2 gumstix.img2

Increase the size of the image using gparted

sudo gparted gumstix.img

Right click on the ext3 partition -> Resize/Move. Use all unallocated space to resize. As you might see, gparted converted the unallocated space to used space. That was not so cool. Exit gparted, delete the device maps, then create them again and start gparted afterwards using those commands.

sudo kpartx -d gumstix.img
sudo kpartx -a gumstix.img
sudo gparted gumstix.img

gparted will still see the new space as used. Now here comes the trick: Resize the ext3 partition again by making it just a tiny bit smaller. Apply your changes. If everything worked, gparted will now find the free space and you can resize it to the full size again. Exit gparted and be happy!

Now we need to mount the right partition. To find out the offset you can use parted

parted gumstix.img
WARNING: You are not superuser.  Watch out for permissions.
GNU Parted 2.3
Using /home/frk1pal/gumstix/gumstix.img
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) unit                                                             
Unit?  [compact]? B                                                       
(parted) print                                                            
Model:  (file)
Disk /home/frk1pal/gumstix/gumstix.img: 13958643712B
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number  Start      End           Size          Type     File system  Flags
 1      32256B     54525439B     54493184B     primary  fat32        boot, lba
 2      54525952B  13958643711B  13904117760B  primary  ext3

(parted) quit
sudo mount -o loop,offset=54525952 gumstix.img /mnt
sudo cp /usr/bin/qemu-arm-static /mnt/usr/bin/
sudo chroot /mnt/gumstix

Set up Linaro

You will need to do a few things before you can use the Linaro installation

dpkg --configure -a
printf "nameserver 8.8.8.8" > /etc/resolv.conf
ping google.com

If the ping works, you are ready to go.

apt-get update
apt-get upgrade

Wiki: groovy/Installation/Linaro/Source (last edited 2013-03-22 06:32:11 by MarcusLiebhardt)