Difference between revisions of "Install Arch i586"

From ArchWiki
Jump to: navigation, search
m (Preface)
(27 intermediate revisions by 16 users not shown)
Line 1: Line 1:
[[Category:Installation]]
+
[[Category:Getting and installing Arch]]
[[Category:Arch i586]]
+
[[Category:CPU]]
= Preface =
+
{{out of date}}
This document tries to describe the process which let me successfully build ArchLinux under other architectures.
+
== Preface ==
 +
This document tries to describe the process which let me successfully build Arch Linux under other architectures.
  
= Requirement =
+
== Requirements ==
* A faster PC which installed ArchLinux, we'll use it to build packages for i586.
+
* A faster PC with Arch Linux already installed, we'll use it to build packages for i586.
 
* free disk space about 2G bytes.
 
* free disk space about 2G bytes.
= Step 1. Download PKGBUILD source =
+
: (space reqirement might grow to 4GB for a core repository per the begin of 2009)
get required packages
+
* enough time, experience and temper prepared for fixing any problem encountered during the long long build
  pacman -S cvsup ccache libtar libol
+
: (the core repository might take two days to build, excluding those failed, on a 2GHz E5405)
edit the /etc/abs/abs.conf enable arch,extra.
+
 
SUPFILES=(arch extra !unstable !community)
+
== Step 1. Prepare build enviroment ==
Maybe you can also get the testing version by [[Getting_Testing_PKGBUILDs]].
+
Prepare your system for build tasks as described in [[Makepkg#Setting Things Up]] :
Execute abs to get PKGBUILDs in /var/abs, make a directory called i586, and copy base packages into it.
+
  pacman -S base-devel abs
 +
Check /etc/abs.conf for activated repos, you should have at least core activated, check out or update
 +
your abs tree. Then create an work directory for your i586 PKGBUILDs and duplicate repos into it.
 
  # abs
 
  # abs
  # mkdir /var/abs/i586
+
  # mkdir -p /home/i586/abs
  # cd /var/abs/i586
+
  # cd /home/i586/abs
  # cp -a ../base .
+
  # cp -r /var/abs/core .
= Step 2. Compile Require Packages =
+
: (in order to avoid building packages as root, it is better to customize specific ~/.abs.conf and ~/.makepkg.conf instead of system-wide /etc/abs.conf and /etc/makepkg.conf)
prepare the destination directory where we put the package. Here we use /home/i586/base, edit the /etc/makepkg.conf, modify following lines, we use -mtune option for x86 can also use the binary packages.
+
You also should create an directory where you will put the packages.  
  export CC="ccache gcc"
+
# mkdir -p /home/i586/pkg
export CPP="ccache cpp"
+
Edit the /etc/makepkg.conf or copy to ~/.makepkg.conf , modify the following lines, we'll use -mtune option for x86 can also use the binary packages.
export CXX="ccache g++"
+
  CARCH="i586"
export CARCH="i586"
+
  CHOST="i586-pc-linux-gnu"
  export CHOST="i586-pc-linux-gnu"
+
  CFLAGS="-mtune=i586 -O2 -pipe"
  export CFLAGS="-mtune=i586 -O2 -pipe"
+
  CXXFLAGS="-mtune=i586 -O2 -pipe"
  export CXXFLAGS="-mtune=i586 -O2 -pipe"
+
For faster compiling take a look on ccache and/or distcc.
export PKGDEST=/home/i586/base
+
There are two bug in gcc-4.0.2-1 package, I do following fixed.
+
* remove the compile backward compatiable 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 -c option to clean files after successful make package.
+
mkdir -p /home/i586/base
+
cd /var/abs/i586
+
makeworld -c /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 =
+
== Step 2. Build packages ==
== found out which package build failed by grep ==
+
After we have prepared our build enviroment now is the time to run some last commands and get some coffee. Change to your
grep failed build.log
+
i586 abs directory and run makeworld.  
== build again by makepkg ==
+
  # cd /home/i586/abs
solve the failed package by manual run makepkg(eg. pacman failed)
+
  # makeworld --clean --ignorearch --syncdeps --rmdeps --noconfirm /home/i586/pkg/core/ core/
  cd /var/abs/i586/base/pacman
+
When you didn't want to repeat typing your root pw for resolving dependencies you could
  makepkg -w /home/i586/base
+
allow your build user to use pacman without retyping pw. See [[Disable root password and gain su sudo with no password]] for more information.
== Solve Missing Dependencies ==
+
: (sudo is designed with security concerns, environs are stripped during sessions; so for those have only proxied access to the internet, it is better to expicitly allow passing environs like http_proxy/ftp_proxy/RSYNC_PROXY etc in /etc/sudoer)
You may found the error message like
+
And do not forget to deactivate it after using for building process!
==> Missing Dependencies:
+
requires: libtar
+
get the missing libary for your system
+
pacman -S libtar
+
== 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 ==
+
== Step 3. Solve Problem during Compiling ==
Found following error message:
+
After the build Process come to an end, we should check which packages have problems while building.
  ccache cpp -Wall -D_GNU_SOURCE -DLinux  ...
+
  # grep failed build.log
  cpp: too many input files
+
Then you should change to the package directorys in your abs copy and retry building it.
make: *** [depend] Error 1
+
  # cd core/<failed package>
  ==> ERROR: Build Failed.  Aborting...
+
  # PKGDEST=/home/i586/pkg/core/ makepkg --clean --ignorearch --syncdeps --rmdeps
Comment off the ccache setting in /etc/makepkg.conf.  Try again.
+
For more information about building packages see in [[makepkg]]
  
= Step 4. Share Built Packages for i586 =
+
== Step 4. Share Built Packages for i586 ==
generate current.db.tar.gz
+
Set up a [[Custom local repository]] for sharing your packages with the target system.
gensync /var/abs/i586 /home/i586/current.db.tar.gz /home/i586
+
  
= Step 5. Install ArchLinux on i586 by bootable linux =
+
== Step 5. Install Arch Linux on i586 by bootable linux ==
# grep "^base" packages.txt | grep -v pacman \
+
See [[Install Arch from within another distro]], and use your custom repos as package source.
  | grep -v glibc | grep -v iputils \
+
More soon ....
  | 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
+

Revision as of 09:25, 13 June 2012

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#)

Preface

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

Requirements

  • A faster PC with Arch Linux already installed, we'll use it to build packages for i586.
  • free disk space about 2G bytes.
(space reqirement might grow to 4GB for a core repository per the begin of 2009)
  • enough time, experience and temper prepared for fixing any problem encountered during the long long build
(the core repository might take two days to build, excluding those failed, on a 2GHz E5405)

Step 1. Prepare build enviroment

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

pacman -S base-devel abs

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

# abs
# mkdir -p /home/i586/abs
# cd /home/i586/abs
# cp -r /var/abs/core .
(in order to avoid building packages as root, it is better to customize specific ~/.abs.conf and ~/.makepkg.conf instead of system-wide /etc/abs.conf and /etc/makepkg.conf)

You also should create an directory where you will put the packages.

# mkdir -p /home/i586/pkg

Edit the /etc/makepkg.conf or copy to ~/.makepkg.conf , modify the following lines, we'll use -mtune option for x86 can also use the binary packages.

CARCH="i586"
CHOST="i586-pc-linux-gnu"
CFLAGS="-mtune=i586 -O2 -pipe"
CXXFLAGS="-mtune=i586 -O2 -pipe"

For faster compiling take a look on ccache and/or distcc.

Step 2. Build packages

After we have prepared our build enviroment now is the time to run some last commands and get some coffee. Change to your i586 abs directory and run makeworld.

# cd /home/i586/abs
# makeworld --clean --ignorearch --syncdeps --rmdeps --noconfirm /home/i586/pkg/core/ core/

When you didn't want to repeat typing your root pw for resolving dependencies you could allow your build user to use pacman without retyping pw. See Disable root password and gain su sudo with no password for more information.

(sudo is designed with security concerns, environs are stripped during sessions; so for those have only proxied access to the internet, it is better to expicitly allow passing environs like http_proxy/ftp_proxy/RSYNC_PROXY etc in /etc/sudoer)

And do not forget to deactivate it after using for building process!

Step 3. Solve Problem during Compiling

After the build Process come to an end, we should check which packages have problems while building.

# grep failed build.log

Then you should change to the package directorys in your abs copy and retry building it.

# cd core/<failed package>
# PKGDEST=/home/i586/pkg/core/ makepkg --clean --ignorearch --syncdeps --rmdeps

For more information about building packages see in makepkg

Step 4. Share Built Packages for i586

Set up a Custom local repository for sharing your packages with the target system.

Step 5. Install Arch Linux on i586 by bootable linux

See Install Arch from within another distro, and use your custom repos as package source. More soon ....