summaryrefslogtreecommitdiff
path: root/configs/releng/build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'configs/releng/build.sh')
-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
}