Difference between revisions of "Install Arch i586"

From ArchWiki
Jump to: navigation, search
(Solve validity check error)
(32 intermediate revisions by 18 users not shown)
Line 1: Line 1:
[[Category:Installation]]
+
[[Category:Getting and installing Arch]]
= Preface =
+
[[Category:CPU]]
This document try to describe the process which let me successful build ArchLinux under other architectures.
+
{{out of date}}
= Requirement =
+
== Preface ==
A faster PC which installed ArchLinux, we'll use it to build packages for i586.
+
This document tries to describe the process which let me successfully build Arch Linux under other architectures.
= Step 1. Download PKGBUILD source =
+
 
get required packages
+
== Requirements ==
  pacman -S cvsup ccache libtar libol
+
* A faster PC with Arch Linux already installed, we'll use it to build packages for i586.
edit the /etc/abs/abs.conf enable arch,extra.
+
* free disk space about 2G bytes.
SUPFILES=(arch extra !unstable !community)
+
: (space reqirement might grow to 4GB for a core repository per the begin of 2009)
Maybe you can also get the testing version by [[Getting_Testing_PKGBUILDs]].
+
* enough time, experience and temper prepared for fixing any problem encountered during the long long build
Execute abs to get PKGBUILDs in /var/abs, make a directory called i586, and copy base packages into it.
+
: (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
 
  # 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
+
 
compile all base directory
+
== Step 2. Build packages ==
  mkdir -p /home/i586/base
+
After we have prepared our build enviroment now is the time to run some last commands and get some coffee. Change to your
cd /var/abs/i586
+
i586 abs directory and run makeworld.
  makeworld /home/i586/base base
+
  # cd /home/i586/abs
we can view the process by build.log and makepkg.log under /var/abs/i586/.
+
  # 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 =
+
== Step 3. Solve Problem during Compiling ==
== found out which package build failed by grep ==
+
After the build Process come to an end, we should check which packages have problems while building.
  grep failed build.log  
+
  # grep failed build.log
== build again by makepkg ==
+
Then you should change to the package directorys in your abs copy and retry building it.
solve the failed package by manual run makepkg(eg. pacman failed)
+
  # cd core/<failed package>
  cd /var/abs/i586/base/pacman
+
  # PKGDEST=/home/i586/pkg/core/ makepkg --clean --ignorearch --syncdeps --rmdeps
  makepkg -w /home/i586/base
+
For more information about building packages see in [[makepkg]]
== Solve Missing Dependencies ==
+
You may found the error message like
+
==> 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 4. Share Built Packages for i586 ==
Found following error message:
+
Set up a [[Custom local repository]] for sharing your packages with the target system.
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 =
+
== Step 5. Install Arch Linux on i586 by bootable linux ==
= Step 5. Install ArchLinux on i586 by bootable linux =
+
See [[Install Arch from within another distro]], and use your custom repos as package source.
# grep "^base" packages.txt | grep -v pacman \
+
More soon ....
  | 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
+

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 ....