Difference between revisions of "Ubuntu 12.04 Multiarch"

From IGEP - ISEE Wiki

Jump to: navigation, search
Line 43: Line 43:
  
 
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
 
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
 +
 
# newer versions of the distribution.
 
# newer versions of the distribution.
 +
 +
 +
 
deb [arch=i386] http://us.archive.ubuntu.com/ubuntu/ precise main restricted
 
deb [arch=i386] http://us.archive.ubuntu.com/ubuntu/ precise main restricted
 
deb-src http://us.archive.ubuntu.com/ubuntu/ precise main restricted
 
deb-src http://us.archive.ubuntu.com/ubuntu/ precise main restricted
 +
  
 
deb [arch=armel,armhf] http://ports.ubuntu.com/ubuntu-ports precise main universe
 
deb [arch=armel,armhf] http://ports.ubuntu.com/ubuntu-ports precise main universe
 +
 +
  
 
## Major bug fix updates produced after the final release of the
 
## Major bug fix updates produced after the final release of the
 +
 
## distribution.
 
## distribution.
 +
 +
 +
 
deb [arch=i386] http://us.archive.ubuntu.com/ubuntu/ precise-updates main restricted
 
deb [arch=i386] http://us.archive.ubuntu.com/ubuntu/ precise-updates main restricted
 
deb-src http://us.archive.ubuntu.com/ubuntu/ precise-updates main restricted
 
deb-src http://us.archive.ubuntu.com/ubuntu/ precise-updates main restricted
 +
  
 
deb [arch=armel,armhf] http://ports.ubuntu.com/ubuntu-ports precise-updates main restricted
 
deb [arch=armel,armhf] http://ports.ubuntu.com/ubuntu-ports precise-updates main restricted
 +
 +
  
 
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
 
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
 +
 
## team. Also, please note that software in universe WILL NOT receive any
 
## team. Also, please note that software in universe WILL NOT receive any
 +
 
## review or updates from the Ubuntu security team.
 
## review or updates from the Ubuntu security team.
 +
 +
 +
 
deb [arch=i386] http://us.archive.ubuntu.com/ubuntu/ precise universe
 
deb [arch=i386] http://us.archive.ubuntu.com/ubuntu/ precise universe
 
deb-src http://us.archive.ubuntu.com/ubuntu/ precise universe
 
deb-src http://us.archive.ubuntu.com/ubuntu/ precise universe
 
deb [arch=i386] http://us.archive.ubuntu.com/ubuntu/ precise-updates universe
 
deb [arch=i386] http://us.archive.ubuntu.com/ubuntu/ precise-updates universe
 
deb-src http://us.archive.ubuntu.com/ubuntu/ precise-updates universe
 
deb-src http://us.archive.ubuntu.com/ubuntu/ precise-updates universe
 +
 +
  
 
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu  
 
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu  
 +
 
## team, and may not be under a free licence. Please satisfy yourself as to  
 
## team, and may not be under a free licence. Please satisfy yourself as to  
 +
 
## your rights to use the software. Also, please note that software in  
 
## your rights to use the software. Also, please note that software in  
 +
 
## multiverse WILL NOT receive any review or updates from the Ubuntu
 
## multiverse WILL NOT receive any review or updates from the Ubuntu
 +
 
## security team.
 
## security team.
 +
 +
 +
 
deb [arch=i386] http://us.archive.ubuntu.com/ubuntu/ precise multiverse
 
deb [arch=i386] http://us.archive.ubuntu.com/ubuntu/ precise multiverse
 
deb-src http://us.archive.ubuntu.com/ubuntu/ precise multiverse
 
deb-src http://us.archive.ubuntu.com/ubuntu/ precise multiverse
 
deb [arch=i386] http://us.archive.ubuntu.com/ubuntu/ precise-updates multiverse
 
deb [arch=i386] http://us.archive.ubuntu.com/ubuntu/ precise-updates multiverse
 
deb-src http://us.archive.ubuntu.com/ubuntu/ precise-updates multiverse
 
deb-src http://us.archive.ubuntu.com/ubuntu/ precise-updates multiverse
 +
 +
  
 
## N.B. software from this repository may not have been tested as
 
## N.B. software from this repository may not have been tested as
 +
 
## extensively as that contained in the main release, although it includes
 
## extensively as that contained in the main release, although it includes
 +
 
## newer versions of some applications which may provide useful features.
 
## newer versions of some applications which may provide useful features.
 +
 
## Also, please note that software in backports WILL NOT receive any review
 
## Also, please note that software in backports WILL NOT receive any review
 +
 
## or updates from the Ubuntu security team.
 
## or updates from the Ubuntu security team.
 +
 +
 +
 
deb [arch=i386] http://us.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
 
deb [arch=i386] http://us.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
 
deb-src http://us.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
 
deb-src http://us.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
 +
  
 
deb [arch=i386] http://us.archive.ubuntu.com/ubuntu/ precise-security main restricted
 
deb [arch=i386] http://us.archive.ubuntu.com/ubuntu/ precise-security main restricted
Line 88: Line 126:
 
deb [arch=i386] http://us.archive.ubuntu.com/ubuntu/ precise-security multiverse
 
deb [arch=i386] http://us.archive.ubuntu.com/ubuntu/ precise-security multiverse
 
deb-src http://us.archive.ubuntu.com/ubuntu/ precise-security multiverse
 
deb-src http://us.archive.ubuntu.com/ubuntu/ precise-security multiverse
 +
 +
  
 
## Uncomment the following two lines to add software from Canonical's
 
## Uncomment the following two lines to add software from Canonical's
 +
 
## 'partner' repository.
 
## 'partner' repository.
 +
 
## This software is not part of Ubuntu, but is offered by Canonical and the
 
## This software is not part of Ubuntu, but is offered by Canonical and the
 +
 
## respective vendors as a service to Ubuntu users.
 
## respective vendors as a service to Ubuntu users.
 +
 +
 +
 
deb [arch=i386] http://archive.canonical.com/ubuntu precise partner
 
deb [arch=i386] http://archive.canonical.com/ubuntu precise partner
 
deb-src http://archive.canonical.com/ubuntu precise partner
 
deb-src http://archive.canonical.com/ubuntu precise partner
 +
 +
  
 
## This software is not part of Ubuntu, but is offered by third-party
 
## This software is not part of Ubuntu, but is offered by third-party
 +
 
## developers who want to ship their latest software.
 
## developers who want to ship their latest software.
 +
 +
 +
 
deb [arch=i386] http://extras.ubuntu.com/ubuntu precise main
 
deb [arch=i386] http://extras.ubuntu.com/ubuntu precise main
 
deb-src http://extras.ubuntu.com/ubuntu precise main
 
deb-src http://extras.ubuntu.com/ubuntu precise main
  
</pre><div>Take a note, the src packages be common for all architectures and it's not necessary to set the architecture.</div><div>We add the tags [arch=i386] or [arch=armhf] or if any repo provide more &nbsp;<span style="line-height: 1.1em;">[arch=armel,armhf]</span></div><div><span style="line-height: 1.1em;" />You should add your whised repositories there ...</div><div></div>
+
 
 +
</pre><div>Take a note, the src packages be common for all architectures and it's not necessary to set the architecture.</div><div>We add the tags [arch=i386] or [arch=armhf] or if any repo provide more &nbsp;<span style="line-height: 1.1em;">[arch=armel,armhf]</span></div><div>You should add your whised repositories there ...</div><div></div>

Revision as of 13:01, 20 May 2014

Ubuntu 12.04.4 LTS MultiArch (i386 <-> ARM Hard float)

We will learn about configure & install multi-arch packages in our host machine Ubuntu 12.04.4 LTS. This is required when we wish cross compile software using our host machine under Ubuntu/debian environment.

Overview

What we learn? Configure our environment and install cross packages in Ubuntu, after install the packages we will cross compile programs using our ubuntu host.

Host Enviroment

This how to is done using 12.04.4 LTS (32 bits) in your host, you can download it from our server using this link or directly from Ubuntu (Canonical) website. You can install it in a Virtual Machine enviroment using any Virtualization software or directly in your PC.

Host Configuration

We will modify dpkg & apt for use a multi arch environment but what extacly is a multi arch environment?

In our case we will add the architecture ARM Hard float and after that we can install the packages or cross compile packages using our host machine.

The first step is add the multi arch option in dpkg.

Go to /etc/dpkg/dpkg.cfg.d and if the directory is empty you must create one file named: multi arch and inside the file we will put this line: foreign-architecture armhf

So this is the result:

pwd

/etc/dpkg/dpkg.cfg.d

ls -al

mcaro@mcaro-vm-u12:/etc/dpkg/dpkg.cfg.d$ ls -al
total 12
drwxr-xr-x 2 root root 4096 May  8 10:25 .
drwxr-xr-x 4 root root 4096 May  8 09:43 ..
-rw-r--r-- 1 root root   27 May  8 10:25 multiarch

mcaro@mcaro-vm-u12:/etc/dpkg/dpkg.cfg.d$ cat multiarch 
foreign-architecture armhf
Now we're ready for modify the apt repo sources for our wished new architecture, you should edit the file /etc/apt/sources.list and change the repositories as (I left here a sources.list sample file)
# deb cdrom:[Ubuntu 12.04.4 LTS _Precise Pangolin_ - Release i386 (20140204)]/ precise main restricted
  1. See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
  1. newer versions of the distribution.


deb [arch=i386] http://us.archive.ubuntu.com/ubuntu/ precise main restricted deb-src http://us.archive.ubuntu.com/ubuntu/ precise main restricted


deb [arch=armel,armhf] http://ports.ubuntu.com/ubuntu-ports precise main universe


    1. Major bug fix updates produced after the final release of the
    1. distribution.


deb [arch=i386] http://us.archive.ubuntu.com/ubuntu/ precise-updates main restricted deb-src http://us.archive.ubuntu.com/ubuntu/ precise-updates main restricted


deb [arch=armel,armhf] http://ports.ubuntu.com/ubuntu-ports precise-updates main restricted


    1. N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    1. team. Also, please note that software in universe WILL NOT receive any
    1. review or updates from the Ubuntu security team.


deb [arch=i386] http://us.archive.ubuntu.com/ubuntu/ precise universe deb-src http://us.archive.ubuntu.com/ubuntu/ precise universe deb [arch=i386] http://us.archive.ubuntu.com/ubuntu/ precise-updates universe deb-src http://us.archive.ubuntu.com/ubuntu/ precise-updates universe


    1. N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    1. team, and may not be under a free licence. Please satisfy yourself as to
    1. your rights to use the software. Also, please note that software in
    1. multiverse WILL NOT receive any review or updates from the Ubuntu
    1. security team.


deb [arch=i386] http://us.archive.ubuntu.com/ubuntu/ precise multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ precise multiverse deb [arch=i386] http://us.archive.ubuntu.com/ubuntu/ precise-updates multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ precise-updates multiverse


    1. N.B. software from this repository may not have been tested as
    1. extensively as that contained in the main release, although it includes
    1. newer versions of some applications which may provide useful features.
    1. Also, please note that software in backports WILL NOT receive any review
    1. or updates from the Ubuntu security team.


deb [arch=i386] http://us.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse


deb [arch=i386] http://us.archive.ubuntu.com/ubuntu/ precise-security main restricted deb-src http://us.archive.ubuntu.com/ubuntu/ precise-security main restricted deb [arch=i386] http://us.archive.ubuntu.com/ubuntu/ precise-security universe deb-src http://us.archive.ubuntu.com/ubuntu/ precise-security universe deb [arch=i386] http://us.archive.ubuntu.com/ubuntu/ precise-security multiverse deb-src http://us.archive.ubuntu.com/ubuntu/ precise-security multiverse


    1. Uncomment the following two lines to add software from Canonical's
    1. 'partner' repository.
    1. This software is not part of Ubuntu, but is offered by Canonical and the
    1. respective vendors as a service to Ubuntu users.


deb [arch=i386] http://archive.canonical.com/ubuntu precise partner deb-src http://archive.canonical.com/ubuntu precise partner


    1. This software is not part of Ubuntu, but is offered by third-party
    1. developers who want to ship their latest software.


deb [arch=i386] http://extras.ubuntu.com/ubuntu precise main deb-src http://extras.ubuntu.com/ubuntu precise main


Take a note, the src packages be common for all architectures and it's not necessary to set the architecture.
We add the tags [arch=i386] or [arch=armhf] or if any repo provide more  [arch=armel,armhf]
You should add your whised repositories there ...