3 echo -e >&2 "\033[1;32m==>\033[0m Installing base system (x86_64)..."
5 local mirrorlist=$(mktemp --tmpdir mirrorlist.XXXX)
7 sed "s/i686\|x86_64/x86_64/g" "/etc/pacman.d/mirrorlist" > "$mirrorlist"
9 local config=$(mktemp --tmpdir pacman.conf.XXXX)
12 echo -e "[options]\n\n" \
13 "RootDir = /opt/arch64/\n" \
14 "DBPath = /opt/arch64/var/lib/pacman/\n" \
15 "LogFile = /opt/arch64/var/log/pacman.log\n" \
16 "HoldPkg = pacman glibc\n" \
17 "SyncFirst = pacman\n" > "$config"
19 for i in testing core extra community; do
20 # comment the following line to enable testing in chroot
21 [ "$i" == "testing" ] && continue
23 echo -e "[$i]\nInclude = $mirrorlist\n" >> "$config"
27 pacman --noconfirm --config "$config" -Sy base base-devel sudo >&2 || return 1
29 install -Dm644 "$mirrorlist" "/opt/arch64/etc/pacman.d/mirrorlist"
31 for i in group hosts localtime locale.gen pacman.conf \
32 profile.d/locale.sh rc.conf resolv.conf shadow sudoers; do
33 ln -f "/etc/$i" "/opt/arch64/etc/" 2>/dev/null \
34 || cp -af "/etc/$i" "/opt/arch64/etc/"
37 echo -e >&2 "\033[1;32m==>\033[0m Configuring schroot..."
46 run-setup-scripts=true
47 run-exec-scripts=false
48 script-config=script-arch64
50 aliases=64\n" >> /etc/schroot/schroot.conf
52 schroot -c arch64 locale-gen >&2
57 [ -e /var/lib/schroot/mount/arch64-* ] \
58 && echo -e >&2 "\033[1;31m==>\033[0m There is an active schroot session." \
59 && echo -e >&2 "\033[1;31m==>\033[0m Please close this session to complete the package removal."
60 while [ -e /var/lib/schroot/mount/arch64-* ]; do
64 echo -e >&2 "\033[1;32m==>\033[0m Removing arch64 from schroot config"
65 sed -i '/\[arch64\]/,/^$/d' /etc/schroot/schroot.conf
66 echo -e >&2 "\033[1;32m==>\033[0m Removing /opt/arch64..."