Difference between revisions of "Install Arch i586"

From ArchWiki
Jump to: navigation, search
(Step 1. Download PKGBUILD source: update)
m (Clean title.)
(18 intermediate revisions by 10 users not shown)
Line 1: Line 1:
[[Category:Getting and installing Arch (English)]]
+
[[Category:Getting and installing Arch]]
[[Category:I586 (English)]]
+
[[Category:HOWTOs (English)]]
+
 
{{out of date}}
 
{{out of date}}
= Preface =
 
 
This document tries to describe the process which let me successfully build Arch Linux under other architectures.
 
This document tries to describe the process which let me successfully build Arch Linux under other architectures.
  
= Requirements =
+
== Requirements ==
 
* A faster PC with Arch Linux already installed, 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.
 +
: (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. Download PKGBUILD source =
+
== Step 1. Prepare build enviroment ==
 
Prepare your system for build tasks as described in [[Makepkg#Setting Things Up]] :
 
Prepare your system for build tasks as described in [[Makepkg#Setting Things Up]] :
  pacman -Sy base-devel
+
  pacman -S base-devel abs
pacman -S abs
+
Check /etc/abs.conf for activated repos, you should have at least core activated, check out or update  
Check /etc/abs.conf for activated repos, you should have at lease core activated, check out or update  
+
your abs tree. Then create an work directory for your i586 PKGBUILDs and duplicate repos into it.
your abs tree with. 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 ../core .
+
  # 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. Compile Required Packages =
+
== Step 2. Build 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.
+
After we have prepared our build enviroment now is the time to run some last commands and get some coffee. Change to your
  export CC="ccache gcc"
+
i586 abs directory and run makeworld.  
export CPP="ccache cpp"
+
  # cd /home/i586/abs
export CXX="ccache g++"
+
# makeworld --clean --ignorearch --syncdeps --rmdeps --noconfirm /home/i586/pkg/core/ core/
export CARCH="i586"
+
When you didn't want to repeat typing your root pw for resolving dependencies you could
export CHOST="i586-pc-linux-gnu"
+
allow your build user to use pacman without retyping pw. See [[Disable root password and gain su sudo with no password]] for more information.
export CFLAGS="-mtune=i586 -O2 -pipe"
+
: (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)
export CXXFLAGS="-mtune=i586 -O2 -pipe"
+
And do not forget to deactivate it after using for building process!
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 =
+
== Step 3. Solve Problem during Compiling ==
== find 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
 +
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]]
  
== build again by makepkg ==
+
== Step 4. Share Built Packages for i586 ==
solve the failed package by manual run makepkg(eg. pacman failed)
+
Set up a [[Custom local repository]] for sharing your packages with the target system.
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 ==
+
== Step 5. Install Arch Linux on i586 by bootable linux ==
You may found the error message like ( here I use syslog-ng as example)
+
See [[Install Arch from within another distro]], and use your custom repos as package source.
==> ERROR: One or more files did not pass the validity check!
+
More soon ....
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
+

Revision as of 04:05, 18 May 2013

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.

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