Install Arch i586

From ArchWiki
Revision as of 01:45, 3 January 2009 by Sargon (talk | contribs) (Step 1. Download PKGBUILD source: update)
Jump to: navigation, search

Tango-view-refresh-red.pngThis article or section is out of date.Tango-view-refresh-red.png

Reason: please use the first argument of the template to provide a brief explanation. (Discuss in Talk:Install Arch i586#)


This document tries to describe the process which let me successfully build Arch Linux under other architectures.


  • A faster PC with Arch Linux already installed, we'll use it to build packages for i586.
  • free disk space about 2G bytes.

Step 1. Download PKGBUILD source

Prepare your system for build tasks as described in Makepkg#Setting Things Up :

pacman -Sy base-devel
pacman -S abs

Check /etc/abs.conf for activated repos, you should have at lease core activated, check out or update your abs tree with. Then create an work directory for your i586 PKGBUILDs and duplicate repos into it.

# abs
# mkdir /var/abs/i586
# cd /var/abs/i586
# cp -a ../core .

Step 2. Compile Required Packages

prepare the destination directory where we'll put the packages. Here we use /home/i586/base, edit the /etc/makepkg.conf, modify the following lines, we'll use -mtune option for x86 can also use the binary packages.

export CC="ccache gcc"
export CPP="ccache cpp"
export CXX="ccache g++"
export CARCH="i586"
export CHOST="i586-pc-linux-gnu"
export CFLAGS="-mtune=i586 -O2 -pipe"
export CXXFLAGS="-mtune=i586 -O2 -pipe"
export PKGDEST=/home/i586/base

There are two bugs in the gcc-4.0.2-1 package, do the following to fix them.

  • remove the compile backward compatible gcc-3.x dynamic library.
  • add a --host=$CHOST in compile gcc-4.0.2 line like following code
./configure --host=$CHOST ...

compile all base directory, the makeworld will call makepkg with --clean option to clean files after successful make package and with --ignorearch the core packages usually not have i586 in there arch parameter.

mkdir -p /home/i586/base
cd /var/abs/i586
makeworld --clean --ignorearch /home/i586/base base

we can view the process by build.log and makepkg.log under /var/abs/i586/.

Step 3. Solve Problem during Compiling

find out which package build failed by grep

grep failed build.log

build again by makepkg

solve the failed package by manual run makepkg(eg. pacman failed)

cd /var/abs/i586/base/pacman
makepkg -w /home/i586/base

Solve Missing Dependencies

You may found the error message like

==> Missing Dependencies:
requires: libtar

get the missing library for your system

pacman -S libtar

or run the makeworld with additional options like --syncdeps and --rmdeps. You could also use --noconfirm if you want to run the process without waiting for your confirmation.

Solve validity check error

You may found the error message like ( here I use syslog-ng as example)

==> ERROR: One or more files did not pass the validity check!

To make sure you get the full size package, remove the source cache and try again

cd /var/abs/i586/base/syslog-ng
makepkg -C ; makepkg

If still failed, you should try to check the PKGBUILD, read the syslog-ng's web-site, try to found mirror which near your site, and download it to /var/cache/pacman/src/. If that file is really missing, report to bug system.

Solve cpp: too many input files

Found following error message:

ccache cpp -Wall -D_GNU_SOURCE -DLinux  ...
cpp: too many input files
make: *** [depend] Error 1
==> ERROR: Build Failed.  Aborting...

Comment off the ccache setting in /etc/makepkg.conf. Try again.

Step 4. Share Built Packages for i586

generate current.db.tar.gz

gensync /var/abs/i586 /home/i586/current.db.tar.gz /home/i586

Step 5. Install Arch Linux on i586 by bootable linux

# grep "^base" packages.txt | grep -v pacman \
  | grep -v glibc | grep -v iputils \
  | sed -e 's:base/::' -e 's:-[0-9].*::' > ~/i.txt
# pacman -Syfw --noconfirm -r /mnt `cat ~/i.txt` kernel26 2>&1 &
# pacman -S --noconfirm -r /mnt glibc iputils pacman | tee ~/i.log
# pacman -Sf --noconfirm -r /mnt `cat ~/i.txt` kernel26