Difference between revisions of "Installation Chroot"
Nik.martin (talk | contribs) m (→Configure /etc/rc.conf) |
Kynikos.bot (talk | contribs) (wikify some external links, use https for archlinux.org) |
||
Line 24: | Line 24: | ||
|- | |- | ||
|mirror | |mirror | ||
− | |Miror of download: the list is available [ | + | |Miror of download: the list is available [https://archlinux.org/download/ here] |
|http://mir.archlinux.fr | |http://mir.archlinux.fr | ||
|- | |- | ||
|pacman_mirrorlist_ver | |pacman_mirrorlist_ver | ||
− | |Actual version of '''pacman-mirrorlist''', see [ | + | |Actual version of '''pacman-mirrorlist''', see [https://www.archlinux.org/packages/pacman-mirrorlist here]. |
|20110703-1 | |20110703-1 | ||
|} | |} |
Revision as of 04:00, 3 December 2012
This article will detail the installation of Arch Linux from another GNU/Linux (kernel >= 2.6.27) with a chroot.
This article was originally published in the ArchLinux.fr wiki.
A script doing all the steps described in this page is available at: install-chroot.sh
It is recommended to read the article.
Contents
Requirement
To install ArchLinux you need some data :
Variable | Description | Example |
---|---|---|
install_path | You have to mount in this directory all the partitions that will be part of your system | /mnt/newarch |
arch | Architecture of the system: (we can only install i686 from a i686 system) | i686 or x86_64 |
mirror | Miror of download: the list is available here | http://mir.archlinux.fr |
pacman_mirrorlist_ver | Actual version of pacman-mirrorlist, see here. | 20110703-1 |
You also need a minimal chroot. You can find an archive matching your achitecture here.
You can export variable with this command, for example :
export install_path="/mnt/newarch"
Before we begin, we will create the tmp
directory in the new architecture in order to put it temporary files. In $install_path
:
mkdir tmp chmod 1777 tmp
Base system creation
We need to download the archive and the package pacman-mirrorlist
:
cd "$install_path"/tmp wget "$mirror/core/os/$arch/pacman-mirrorlist-$pacman_mirrorlist_ver-any.pkg.tar.xz" wget "http://mir.archlinux.fr/~tuxce/chroot/archlinux.chroot.$arch.tgz" cd .. tar xvf tmp/pacman-mirrorlist-$pacman_mirrorlist_ver-any.pkg.tar.xz tar xvf tmp/archlinux.chroot.$arch.tgz
The mirror configuration file (etc/pacman.d/mirrorlist
) has all its lines commented, you have to uncomment at least one line, for example :
Server = http://mir.archlinux.fr/$repo/os/$arch
Chroot preparation
The network
In order to have dns resolution, copy your /etc/resolv.conf
from the host system to the chroot :
cp /etc/resolv.conf etc/resolv.conf
Mount special file
We need to mount the special file system /dev
, /proc
and /sys
:
mount -o bind /proc "$install_path"/proc mount -o bind /dev "$install_path"/dev mount -o bind /sys "$install_path"/sys
Register the mount partitions
Mount partition are list in /etc/mtab
, we need to copy it contents :
grep -v rootfs /proc/mounts > etc/mtab
In the chroot
The chroot is ready, enter it :
chroot "$install_path" /bin/bash
Base system installation
pacman -Syf base
Configure the new system
Configure /etc/rc.conf
One of the central file in the ArchLinux system. You'll find everything you need here. The current default rc.conf is here
Partition configuration
To specify what partitions will be used by your operating system you need to edit the /etc/fstab
file. This file lists the partitions, where they will be mounted, the type of the file system and some other options. Be sure to check this page for more information. Here is a quick example of the /etc/fstab
file:
# # /etc/fstab: static file system information # # <file system> <dir> <type> <options> <dump> <pass> devpts /dev/pts devpts defaults 0 0 shm /dev/shm tmpfs nodev,nosuid 0 0 /dev/sda5 swap swap defaults 0 0 /dev/sda6 / ext4 defaults 0 1 /dev/sda7 /home ext4 defaults 0 2
To see the list of partitions on your hard disk run the command fdisk -l
(l is a lowercase L, NOT the digit) as root.
Grub
Perhaps you'll need GRUB now. You'll find information here
Users
Root password
The root password is empty by default, you may want to set one :
passwd root
Main user
A basic configuration is :
useradd -G wheel,audio,optical,storage,video,power -m nom_utilisateur passwd nom_utilisateur
You'll find more information here
sudo configuration
See here.