summaryrefslogtreecommitdiff
path: root/liveusb/build.sh
diff options
context:
space:
mode:
Diffstat (limited to 'liveusb/build.sh')
-rwxr-xr-xliveusb/build.sh16
1 files changed, 15 insertions, 1 deletions
diff --git a/liveusb/build.sh b/liveusb/build.sh
index e0663a0..be18c69 100755
--- a/liveusb/build.sh
+++ b/liveusb/build.sh
@@ -10,6 +10,7 @@ arch=$(uname -m)
work_dir=work
out_dir=out
+pacman_conf=${work_dir}/pacman.conf
script_path=$(readlink -f ${0%/*})
# Helper function to run make_*() only one time per architecture.
@@ -20,9 +21,21 @@ run_once() {
fi
}
+# Setup custom pacman.conf with current cache directories.
+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 > ${pacman_conf}
+}
+
# Base installation (airootfs)
make_basefs() {
- mkarchiso -v -w "${work_dir}" -D "${install_dir}" init
+ mkarchiso -v -w "${work_dir}" -C "${pacman_conf}" -D "${install_dir}" init
+}
+
+# Additional packages (airootfs)
+make_packages() {
+ mkarchiso -v -w "${work_dir}" -C "${pacman_conf}" -D "${install_dir}" -p "$(grep -h -v ^# ${script_path}/packages.x86_64)" install
}
# Copy mkinitcpio archiso hooks and build initramfs (airootfs)
@@ -73,6 +86,7 @@ make_iso() {
}
run_once make_basefs
+run_once make_packages
run_once make_setup_mkinitcpio
run_once make_boot
run_once make_syslinux