summaryrefslogtreecommitdiff
path: root/configs/releng
diff options
context:
space:
mode:
authorErich Eckner <git@eckner.net>2017-10-10 13:36:35 +0200
committerErich Eckner <git@eckner.net>2021-02-14 14:55:32 +0100
commita45ef7b0cdbbdea9c57eae7737bb07b42e0cce03 (patch)
treebd49c59b243594835d8e6b6e2d23ae16c64c2ecb /configs/releng
parent7ff7589a24e9698c33484dfe7019345df394f3b0 (diff)
downloadarchiso32-a45ef7b0cdbbdea9c57eae7737bb07b42e0cce03.tar.xz
configs/releng/build.sh: generate architecture specific pacman.conf (differing mirror lists, differing caches)
Diffstat (limited to 'configs/releng')
-rwxr-xr-xconfigs/releng/build.sh36
1 files changed, 20 insertions, 16 deletions
diff --git a/configs/releng/build.sh b/configs/releng/build.sh
index da29433..742a79d 100755
--- a/configs/releng/build.sh
+++ b/configs/releng/build.sh
@@ -52,12 +52,16 @@ run_once() {
fi
}
-# Setup custom pacman.conf with current cache directories.
+# Setup custom pacman.conf with current cache directories and custom mirrorlist.
make_pacman_conf() {
local _cache_dirs
_cache_dirs=("$(pacman -v 2>&1 | grep '^Cache Dirs:' | sed 's/Cache Dirs:\s*//g')")
sed -r "s|^#?\\s*CacheDir.+|CacheDir = $(echo -n "${_cache_dirs[@]}")|g" \
- "${script_path}/pacman.conf" > "${work_dir}/pacman.conf"
+ "${script_path}/pacman.conf" > "${work_dir}/pacman-x86_64.conf"
+ sed '
+ s@/var/cache/pacman/pkg/@/var/cache/archbuild32/@
+ s@Include = /etc/pacman\.d/mirrorlist$@\032@
+ ' "${work_dir}/pacman-x86_64.conf" > "${work_dir}/pacman-i686.conf"
}
# Prepare working directory and copy custom airootfs files (airootfs)
@@ -77,10 +81,10 @@ make_custom_airootfs() {
# Packages (airootfs)
make_packages() {
if [ -n "${verbose}" ]; then
- mkarchiso -v -w "${work_dir}/${arch}" -C "${work_dir}/pacman.conf" -D "${install_dir}" \
+ arch=${arch} mkarchiso -v -w "${work_dir}/${arch}" -C "${work_dir}/pacman-${arch}.conf" -D "${install_dir}" \
-p "$(grep -h -v '^#' "${script_path}/packages."{both,${arch}}| sed ':a;N;$!ba;s/\n/ /g')" install
else
- mkarchiso -w "${work_dir}/${arch}" -C "${work_dir}/pacman.conf" -D "${install_dir}" \
+ arch=${arch} mkarchiso -w "${work_dir}/${arch}" -C "${work_dir}/pacman-${arch}.conf" -D "${install_dir}" \
-p "$(grep -h -v '^#' "${script_path}/packages."{both,${arch}}| sed ':a;N;$!ba;s/\n/ /g')" install
fi
}
@@ -88,9 +92,9 @@ make_packages() {
# Needed packages for x86_64 EFI boot
make_packages_efi() {
if [ -n "${verbose}" ]; then
- mkarchiso -v -w "${work_dir}/${arch}" -C "${work_dir}/pacman.conf" -D "${install_dir}" -p "efitools" install
+ arch=${arch} mkarchiso -v -w "${work_dir}/${arch}" -C "${work_dir}/pacman-${arch}.conf" -D "${install_dir}" -p "efitools" install
else
- mkarchiso -w "${work_dir}/${arch}" -C "${work_dir}/pacman.conf" -D "${install_dir}" -p "efitools" install
+ arch=${arch} mkarchiso -w "${work_dir}/${arch}" -C "${work_dir}/pacman-${arch}.conf" -D "${install_dir}" -p "efitools" install
fi
}
@@ -112,11 +116,11 @@ make_setup_mkinitcpio() {
exec 17<>"${work_dir}/gpgkey"
fi
if [ -n "${verbose}" ]; then
- ARCHISO_GNUPG_FD="${gpg_key:+17}" mkarchiso -v -w "${work_dir}/${arch}" -C "${work_dir}/pacman.conf" \
+ ARCHISO_GNUPG_FD="${gpg_key:+17}" arch=${arch} mkarchiso -v -w "${work_dir}/${arch}" -C "${work_dir}/pacman-${arch}.conf" \
-D "${install_dir}" \
-r 'mkinitcpio -c /etc/mkinitcpio-archiso.conf -k /boot/vmlinuz-linux -g /boot/archiso.img' run
else
- ARCHISO_GNUPG_FD="${gpg_key:+17}" mkarchiso -w "${work_dir}/${arch}" -C "${work_dir}/pacman.conf" \
+ ARCHISO_GNUPG_FD="${gpg_key:+17}" arch=${arch} mkarchiso -w "${work_dir}/${arch}" -C "${work_dir}/pacman-${arch}.conf" \
-D "${install_dir}" \
-r 'mkinitcpio -c /etc/mkinitcpio-archiso.conf -k /boot/vmlinuz-linux -g /boot/archiso.img' run
fi
@@ -128,10 +132,10 @@ make_setup_mkinitcpio() {
# Customize installation (airootfs)
make_customize_airootfs() {
if [ -n "${verbose}" ]; then
- mkarchiso -v -w "${work_dir}/${arch}" -C "${work_dir}/pacman.conf" -D "${install_dir}" \
+ arch=${arch} mkarchiso -v -w "${work_dir}/${arch}" -C "${work_dir}/pacman-${arch}.conf" -D "${install_dir}" \
-r '/root/customize_airootfs.sh' run
else
- mkarchiso -w "${work_dir}/${arch}" -C "${work_dir}/pacman.conf" -D "${install_dir}" \
+ arch=${arch} mkarchiso -w "${work_dir}/${arch}" -C "${work_dir}/pacman-${arch}.conf" -D "${install_dir}" \
-r '/root/customize_airootfs.sh' run
fi
rm "${work_dir}/${arch}/airootfs/root/customize_airootfs.sh"
@@ -249,11 +253,11 @@ make_efiboot() {
make_prepare() {
cp -a -l -f "${work_dir}/${arch}/airootfs" "${work_dir}"
if [ -n "${verbose}" ]; then
- mkarchiso -v -w "${work_dir}" -D "${install_dir}" pkglist
- mkarchiso -v -w "${work_dir}" -D "${install_dir}" ${gpg_key:+-g ${gpg_key}} prepare
+ arch=${arch} mkarchiso -v -w "${work_dir}" -D "${install_dir}" pkglist
+ arch=${arch} mkarchiso -v -w "${work_dir}" -D "${install_dir}" ${gpg_key:+-g ${gpg_key}} prepare
else
- mkarchiso -w "${work_dir}" -D "${install_dir}" pkglist
- mkarchiso -w "${work_dir}" -D "${install_dir}" ${gpg_key:+-g ${gpg_key}} prepare
+ arch=${arch} mkarchiso -w "${work_dir}" -D "${install_dir}" pkglist
+ arch=${arch} mkarchiso -w "${work_dir}" -D "${install_dir}" ${gpg_key:+-g ${gpg_key}} prepare
fi
rm -rf "${work_dir}/airootfs"
# rm -rf "${work_dir}/${arch}/airootfs" (if low space, this helps)
@@ -262,10 +266,10 @@ make_prepare() {
# Build ISO
make_iso() {
if [ -n "${verbose}" ]; then
- mkarchiso -v -w "${work_dir}" -D "${install_dir}" -L "${iso_label}" -P "${iso_publisher}" \
+ arch=${arch} mkarchiso -v -w "${work_dir}" -D "${install_dir}" -L "${iso_label}" -P "${iso_publisher}" \
-A "${iso_application}" -o "${out_dir}" iso "${iso_name}-${iso_version}-dual.iso"
else
- mkarchiso -w "${work_dir}" -D "${install_dir}" -L "${iso_label}" -P "${iso_publisher}" \
+ arch=${arch} mkarchiso -w "${work_dir}" -D "${install_dir}" -L "${iso_label}" -P "${iso_publisher}" \
-A "${iso_application}" -o "${out_dir}" iso "${iso_name}-${iso_version}-dual.iso"
fi
}