User:Hiciu

From Openmoko

(Difference between revisions)
Jump to: navigation, search
(New page: == Archlinux on ARM: == === Preparations === You need: *sbox2 *toolchain *qemu *optional: melas (http://melas.ossproject.org/) if you want to build toolchain on you own ==== sbox2 ==== ho...)
 
 
(11 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
== Archlinux on ARM: ==
 
== Archlinux on ARM: ==
 +
We moved here: http://hiciu.rootnode.net/arch/<span style="color:red"><sup>'''(DEAD LINK)'''</sup></span>. This page is probably outdated.
 +
 
=== Preparations ===
 
=== Preparations ===
You need:
+
 
 +
Needed packages:
 
*sbox2
 
*sbox2
*toolchain
 
 
*qemu
 
*qemu
*optional: melas (http://melas.ossproject.org/) if you want to build toolchain on you own
+
*crosstool-ng (for building the toolchain)
 +
 
 +
==== Toolchain for cross-compiling ====
 +
 
 +
*Install crosstool-ng-svn from AUR (http://aur.archlinux.org/packages.php?ID=25122)
 +
 
 +
yaourt -S crosstool-ng-svn
 +
 
 +
*Make a directory for building the toolchain
 +
 
 +
mkdir ~/toolchain-build
 +
cd ~/toolchain-build
 +
 
 +
*Copy the configuration for Arch Cross Toolchain
 +
 
 +
wget http://shelli.fi/~bane/.config<span style="color:red"><sup>'''(DEAD LINK)'''</sup></span>
 +
 
 +
*Now you can change the settings with command
 +
 
 +
ct-ng menuconfig
 +
 
 +
*And build it with
 +
 
 +
ct-ng build
 +
 
 +
If you used default settings, you should now have the toolchain in the directory "arm-unknown-linux-gnueabi" in your home directory
  
 
==== sbox2 ====
 
==== sbox2 ====
Line 17: Line 44:
 
  ./autogen.sh
 
  ./autogen.sh
 
  ./configure && make && sudo make install
 
  ./configure && make && sudo make install
 
==== (optional) melas ====
 
''todo: make PKGBUILD for toolchain && remove this section''
 
homepage: http://melas.ossproject.org/
 
 
"Melas is an uncomplicated build and packaging tool", something similar to Arch Build System. This will be used to build toolchain and qemu with eabi patch.
 
 
mkdir ~/melas
 
cd ~/melas
 
svn co http://svn.ossproject.org/melas/trunk melas-trunk
 
cd melas-trunk
 
./bin/mls release
 
#(and install)
 
sudo tar xzf melas_0.12.1_all.tgz -C /
 
 
==== toolchain ====
 
''todo: make PKGBUILD''
 
precompiled package: http://hiciu.rootnode.net/download/igelle/gcc-armv4t-unknown-linux-gnueabi_4.3.2_i386.deb or http://hiciu.rootnode.net/download/igelle/gcc-armv4t-unknown-linux-gnueabi_4.3.2_i386.tar.gz (Download and extract to /).
 
 
(optional) How to build:
 
mkdir ~/gcc-cross
 
cd ~/gcc-cross
 
mls --import=gcc-cross --set-GCCARCHTUPLE=armv4t-unknown-linux-gnueabi rebuild
 
#and install - this will make a *.deb package :P
 
ar x gcc-*.deb
 
sudo tar xzf data.tar.gz -C /
 
 
This will install itself in /usr/gcc-armv4t-unknown-linux-gnueabi
 
  
 
==== qemu ====
 
==== qemu ====
Line 51: Line 50:
  
 
=== Setting up Scratchbox buildroot ===
 
=== Setting up Scratchbox buildroot ===
  sudo cp -R /usr/gcc-armv4t-unknown-linux-gnueabi/sysroot-armv4t-unknown-linux-gnueabi/ ~/arch-arm-buildroot
+
 
sudo chown -R $USERNAME\:users ~/arch-arm-buildroot
+
If you changed the paths from toolchain configuration, you need to change these commands too
 +
 
 +
  cp -R ~/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sys-root/ ~/arch-arm-buildroot
 
  cd ~/arch-arm-buildroot
 
  cd ~/arch-arm-buildroot
  sb2-init -c "/usr/bin/qemu-arm" armv4t /usr/gcc-armv4t-unknown-linux-gnueabi/bin/armv4t-unknown-linux-gnueabi-gcc
+
  sb2-init -c "/usr/bin/qemu-arm" arm ~/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc
  
 
==== Preparing Arch Build System ====
 
==== Preparing Arch Build System ====
Line 67: Line 68:
 
Edit file ~/.makepkg.conf, change:
 
Edit file ~/.makepkg.conf, change:
 
  CARCH="armv4t"
 
  CARCH="armv4t"
  CHOST="armv4t-unknown-linux-gnueabi"
+
  CHOST="arm-unknown-linux-gnueabi"
  
 
  CFLAGS="-march=armv4t -mtune=arm920t -O2 -pipe"
 
  CFLAGS="-march=armv4t -mtune=arm920t -O2 -pipe"
Line 75: Line 76:
  
 
read more here: http://wiki.archlinux.org/index.php/Install_Arch_i586
 
read more here: http://wiki.archlinux.org/index.php/Install_Arch_i586
+
 
 
=== Compiling packages ===
 
=== Compiling packages ===
 
==== All packages in repository: ====
 
==== All packages in repository: ====
Line 100: Line 101:
 
==== Synchronizing your repo ====
 
==== Synchronizing your repo ====
 
''todo: How we will share? rsync / svn / git / some kind of web gui? What is better for big binary files?''
 
''todo: How we will share? rsync / svn / git / some kind of web gui? What is better for big binary files?''
 +
 +
hiciu's repository browser: http://hiciu.rootnode.net/arch-arm/
 +
 +
== Progress ==
 +
*Part I: Make packages from base and base-devel groups with scratchbox: 101 / 171
 +
**install them on qemu-arm machine: 0 / 1
 +
*Part II: rebuild all packages from "core" repository using Arch on qemu-arm machine 0 / 171
 +
*Part III: make qemu image with Arch on armv4t (for compiling, packaging, etc.), install Arch on GTA02: 0 / 2
 +
 +
== People ==
 +
Who's involved?
 +
*YourNameHere!
 +
*hiciu - responsible for making qemu image with Arch on arm
 +
*Beini - Most likely helping with PKGBUILDs, installer script, etc. whatever I'm capable of doing ;)
 +
 +
== Ideas ==
 +
*Installer script could be just `pacman -Sy base --root /media/card --dbpath /media/card/... --config arm.conf`

Latest revision as of 23:17, 14 July 2012

Contents

[edit] Archlinux on ARM:

We moved here: http://hiciu.rootnode.net/arch/(DEAD LINK). This page is probably outdated.

[edit] Preparations

Needed packages:

  • sbox2
  • qemu
  • crosstool-ng (for building the toolchain)

[edit] Toolchain for cross-compiling

yaourt -S crosstool-ng-svn
  • Make a directory for building the toolchain
mkdir ~/toolchain-build
cd ~/toolchain-build
  • Copy the configuration for Arch Cross Toolchain
wget http://shelli.fi/~bane/.config(DEAD LINK)
  • Now you can change the settings with command
ct-ng menuconfig
  • And build it with
ct-ng build

If you used default settings, you should now have the toolchain in the directory "arm-unknown-linux-gnueabi" in your home directory

[edit] sbox2

homepage: http://freedesktop.org/wiki/Software/sbox2

"Scratchbox 2 is a cross-compilation engine".

wget http://people.freedesktop.org/~lle/sbox2-releases/sbox2-1.99.0.23.tar.bz2
tar xjf sbox2-1.99.0.23.tar.bz2
cd sbox2-1.99.0.23
./autogen.sh
./configure && make && sudo make install

[edit] qemu

pacman -Sy qemu

(should be 0.10, for 0.9 read this: http://qemu-arm-eabi.wiki.sourceforge.net/)

[edit] Setting up Scratchbox buildroot

If you changed the paths from toolchain configuration, you need to change these commands too

cp -R ~/arm-unknown-linux-gnueabi/arm-unknown-linux-gnueabi/sys-root/ ~/arch-arm-buildroot
cd ~/arch-arm-buildroot
sb2-init -c "/usr/bin/qemu-arm" arm ~/arm-unknown-linux-gnueabi/bin/arm-unknown-linux-gnueabi-gcc

[edit] Preparing Arch Build System

follow http://wiki.archlinux.org/index.php/ABS_-_The_Arch_Build_System

After all copy build tree to buildroot:

cp -R /var/abs/ ~/arch-arm-buildroot

Now customize your makepkg.conf:

cp /etc/makepkg.conf ~/.makepkg.conf

Edit file ~/.makepkg.conf, change:

CARCH="armv4t"
CHOST="arm-unknown-linux-gnueabi"
CFLAGS="-march=armv4t -mtune=arm920t -O2 -pipe"
CXXFLAGS="-march=armv4t -mtune=arm920t -O2 -pipe"
PACKAGER="me <me@email.com>"

read more here: http://wiki.archlinux.org/index.php/Install_Arch_i586

[edit] Compiling packages

[edit] All packages in repository:

cd ~/arch-arm-buildroot
mkdir pkgs
sb2
makeworld --clean --ignorearch --syncdeps --rmdeps --noconfirm pkgs/core abs/core/

[edit] One package, from PKGBUILD:

cd ~/arch-arm-buildroot
sb2
cd mypackage
makepkg -A

(where "-A" means ignore architecture)

[edit] Installing missing dependencies

(well.. You have to build them first :P).

cd ~/arch-arm-buildroot
tar xzf pkgs/$REPO/$PACKAGE
#maybe pacman --root=~/arch-arm-buildroot -U pkgs/$REPO/$PACKAGE or something..

[edit] Synchronizing your repo

todo: How we will share? rsync / svn / git / some kind of web gui? What is better for big binary files?

hiciu's repository browser: http://hiciu.rootnode.net/arch-arm/

[edit] Progress

  • Part I: Make packages from base and base-devel groups with scratchbox: 101 / 171
    • install them on qemu-arm machine: 0 / 1
  • Part II: rebuild all packages from "core" repository using Arch on qemu-arm machine 0 / 171
  • Part III: make qemu image with Arch on armv4t (for compiling, packaging, etc.), install Arch on GTA02: 0 / 2

[edit] People

Who's involved?

  • YourNameHere!
  • hiciu - responsible for making qemu image with Arch on arm
  • Beini - Most likely helping with PKGBUILDs, installer script, etc. whatever I'm capable of doing ;)

[edit] Ideas

  • Installer script could be just `pacman -Sy base --root /media/card --dbpath /media/card/... --config arm.conf`
Personal tools

Archlinux on ARM:

Preparations

You need:

sbox2

homepage: http://freedesktop.org/wiki/Software/sbox2

"Scratchbox 2 is a cross-compilation engine".

wget http://people.freedesktop.org/~lle/sbox2-releases/sbox2-1.99.0.23.tar.bz2
tar xjf sbox2-1.99.0.23.tar.bz2
cd sbox2-1.99.0.23
./autogen.sh
./configure && make && sudo make install

(optional) melas

todo: make PKGBUILD for toolchain && remove this section homepage: http://melas.ossproject.org/

"Melas is an uncomplicated build and packaging tool", something similar to Arch Build System. This will be used to build toolchain and qemu with eabi patch.

mkdir ~/melas
cd ~/melas
svn co http://svn.ossproject.org/melas/trunk melas-trunk
cd melas-trunk
./bin/mls release
#(and install)
sudo tar xzf melas_0.12.1_all.tgz -C /

toolchain

todo: make PKGBUILD precompiled package: http://hiciu.rootnode.net/download/igelle/gcc-armv4t-unknown-linux-gnueabi_4.3.2_i386.deb or http://hiciu.rootnode.net/download/igelle/gcc-armv4t-unknown-linux-gnueabi_4.3.2_i386.tar.gz (Download and extract to /).

(optional) How to build:

mkdir ~/gcc-cross
cd ~/gcc-cross
mls --import=gcc-cross --set-GCCARCHTUPLE=armv4t-unknown-linux-gnueabi rebuild
#and install - this will make a *.deb package :P
ar x gcc-*.deb
sudo tar xzf data.tar.gz -C /

This will install itself in /usr/gcc-armv4t-unknown-linux-gnueabi

qemu

pacman -Sy qemu

(should be 0.10, for 0.9 read this: http://qemu-arm-eabi.wiki.sourceforge.net/)

Setting up Scratchbox buildroot

sudo cp -R /usr/gcc-armv4t-unknown-linux-gnueabi/sysroot-armv4t-unknown-linux-gnueabi/ ~/arch-arm-buildroot
sudo chown -R $USERNAME\:users ~/arch-arm-buildroot
cd ~/arch-arm-buildroot
sb2-init -c "/usr/bin/qemu-arm" armv4t /usr/gcc-armv4t-unknown-linux-gnueabi/bin/armv4t-unknown-linux-gnueabi-gcc

Preparing Arch Build System

follow http://wiki.archlinux.org/index.php/ABS_-_The_Arch_Build_System

After all copy build tree to buildroot:

cp -R /var/abs/ ~/arch-arm-buildroot

Now customize your makepkg.conf:

cp /etc/makepkg.conf ~/.makepkg.conf

Edit file ~/.makepkg.conf, change:

CARCH="armv4t"
CHOST="armv4t-unknown-linux-gnueabi"
CFLAGS="-march=armv4t -mtune=arm920t -O2 -pipe"
CXXFLAGS="-march=armv4t -mtune=arm920t -O2 -pipe"
PACKAGER="me <me@email.com>"

read more here: http://wiki.archlinux.org/index.php/Install_Arch_i586

Compiling packages

All packages in repository:

cd ~/arch-arm-buildroot
mkdir pkgs
sb2
makeworld --clean --ignorearch --syncdeps --rmdeps --noconfirm pkgs/core abs/core/

One package, from PKGBUILD:

cd ~/arch-arm-buildroot
sb2
cd mypackage
makepkg -A

(where "-A" means ignore architecture)

Installing missing dependencies

(well.. You have to build them first :P).

cd ~/arch-arm-buildroot
tar xzf pkgs/$REPO/$PACKAGE
#maybe pacman --root=~/arch-arm-buildroot -U pkgs/$REPO/$PACKAGE or something..

Synchronizing your repo

todo: How we will share? rsync / svn / git / some kind of web gui? What is better for big binary files?