diff options
author | bill-auger <mr.j.spam.me@gmail.com> | 2017-10-16 23:40:09 -0400 |
---|---|---|
committer | bill-auger <mr.j.spam.me@gmail.com> | 2017-11-19 21:46:10 -0500 |
commit | affa6e70a9da9b4538f85141e604e2189a175e0a (patch) | |
tree | 84f10d17cba8754d0a51e87238f4ed6c7684c587 /parabolaiso | |
parent | 67b8fed42a077ac1e7025d742230b9083c4b12a9 (diff) |
enable offline install
Diffstat (limited to 'parabolaiso')
-rwxr-xr-x | parabolaiso/mkparabolaiso | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/parabolaiso/mkparabolaiso b/parabolaiso/mkparabolaiso index 7e70554..82eab30 100755 --- a/parabolaiso/mkparabolaiso +++ b/parabolaiso/mkparabolaiso @@ -16,6 +16,8 @@ iso_application="Parabola GNU/Linux-libre Live/Rescue CD" install_dir="parabola" work_dir="work" out_dir="out" +enable_offline_install='false' + # Show an INFO message # $1: message string @@ -77,6 +79,10 @@ _chroot_init() { _pacman "base" _pacman "syslinux" fi + # Restore live local repo cache + if [[ -d "${work_dir}/isorepo-${arch}" ]]; then + mv "${work_dir}/isorepo-${arch}" "${work_dir}/root-image/" + fi } _chroot_run() { @@ -152,6 +158,8 @@ _usage () echo " -D <install_dir> Set an install_dir. All files will by located here." echo " Default: '${install_dir}'" echo " NOTE: Max 8 characters, use only [a-z0-9]" + echo " -O Enable offline install." + echo " Default: '${enable_offline_install}'" echo " -w <work_dir> Set the working directory" echo " Default: '${work_dir}'" echo " -o <out_dir> Set the output directory" @@ -196,8 +204,10 @@ _show_config () { ;; run) _msg_info " Run command: ${run_cmd}" + _msg_info " Offline install: ${enable_offline_install}" ;; prepare) + _msg_info " Offline install: ${enable_offline_install}" ;; checksum) ;; @@ -243,17 +253,21 @@ _cleanup () { if [[ -d "${work_dir}/root-image/boot" ]]; then find "${work_dir}/root-image/boot" -type f -name 'vmlinuz*' -delete fi - # Delete pacman database sync cache files (*.tar.gz) - if [[ -d "${work_dir}/root-image/var/lib/pacman" ]]; then - find "${work_dir}/root-image/var/lib/pacman" -maxdepth 1 -type f -delete - fi - # Delete pacman database sync cache - if [[ -d "${work_dir}/root-image/var/lib/pacman/sync" ]]; then - find "${work_dir}/root-image/var/lib/pacman/sync" -delete - fi - # Delete pacman package cache - if [[ -d "${work_dir}/root-image/var/cache/pacman/pkg" ]]; then - find "${work_dir}/root-image/var/cache/pacman/pkg" -type f -delete + if [[ "${enable_offline_install}" == 'false' ]]; then + # Delete pacman database sync cache files (*.tar.gz) + if [[ -d "${work_dir}/root-image/var/lib/pacman" ]]; then + find "${work_dir}/root-image/var/lib/pacman" -maxdepth 1 -type f -delete + fi + # Delete pacman database sync cache + if [[ -d "${work_dir}/root-image/var/lib/pacman/sync" ]]; then + find "${work_dir}/root-image/var/lib/pacman/sync" -delete + fi + # Delete pacman package cache + if [[ -d "${work_dir}/root-image/var/cache/pacman/pkg" ]]; then + find "${work_dir}/root-image/var/cache/pacman/pkg" -type f -delete + fi + # Stash live local repo cache + mv "${work_dir}/root-image/isorepo" "${work_dir}/isorepo-${arch}" 2> /dev/null || true fi # Delete all log files, keeps empty dirs. if [[ -d "${work_dir}/root-image/var/log" ]]; then @@ -526,7 +540,7 @@ if [[ ${EUID} -ne 0 ]]; then _msg_error "This script must be run as root." 1 fi -while getopts 'p:r:C:L:P:A:D:w:o:vh' arg; do +while getopts 'p:r:C:L:P:A:D:Ow:o:vh' arg; do case "${arg}" in p) pkg_list="${pkg_list} ${OPTARG}" ;; r) run_cmd="${OPTARG}" ;; @@ -535,6 +549,7 @@ while getopts 'p:r:C:L:P:A:D:w:o:vh' arg; do P) iso_publisher="${OPTARG}" ;; A) iso_application="${OPTARG}" ;; D) install_dir="${OPTARG}" ;; + O) enable_offline_install='true' ;; w) work_dir="${OPTARG}" ;; o) out_dir="${OPTARG}" ;; v) quiet="n" ;; |