From 765756ae126d57735c22d59a7c1242f01443921e Mon Sep 17 00:00:00 2001 From: David P Date: Wed, 16 May 2018 21:08:49 -0400 Subject: modify entire source according to archiso32 and remove unused configs/talkingparabola-X11 Signed-off-by: David P --- parabolaiso/mkparabolaiso | 432 +++++++++++++++------------------------------- 1 file changed, 142 insertions(+), 290 deletions(-) (limited to 'parabolaiso/mkparabolaiso') diff --git a/parabolaiso/mkparabolaiso b/parabolaiso/mkparabolaiso index 93e6995..d55668d 100755 --- a/parabolaiso/mkparabolaiso +++ b/parabolaiso/mkparabolaiso @@ -11,11 +11,15 @@ run_cmd="" quiet="y" pacman_conf="/etc/pacman.conf" export iso_label="PARA_$(date +%Y%m)" -iso_publisher="Parabola GNU/Linux-libre " +iso_publisher="Parabola GNU/Linux-libre " iso_application="Parabola GNU/Linux-libre Live/Rescue CD" install_dir="parabola" work_dir="work" out_dir="out" +sfs_mode="sfs" +sfs_comp="xz" +gpg_key= +init=systemd # Show an INFO message # $1: message string @@ -38,101 +42,35 @@ _msg_error() { fi } -# Show space usage similar to df, but better formatted. -# $1: mount-point or mounted device. -_show_space_usage () { - local _where="${1}" - local _fs _total _used _avail _pct_u=0 _mnt - read _fs _total _used _avail _pct_u _mnt < <(df -m "${_where}" | tail -1) &> /dev/null - _msg_info "Total: ${_total} MiB (100%) | Used: ${_used} MiB (${_pct_u}) | Avail: ${_avail} MiB ($((100 - ${_pct_u%\%}))%)" -} - -_chroot_mount () { - mount -t devtmpfs dev "${work_dir}/root-image/dev" - mount -t devpts devpts "${work_dir}/root-image/dev/pts" - mount -t tmpfs devshm "${work_dir}/root-image/dev/shm" - mount -t proc proc "${work_dir}/root-image/proc" - mount -t tmpfs run "${work_dir}/root-image/run" - mount -t sysfs sys "${work_dir}/root-image/sys" - mount -t tmpfs tmp "${work_dir}/root-image/tmp" - - trap '_chroot_umount' EXIT HUP INT TERM -} - -_chroot_umount () { - umount "${work_dir}/root-image/tmp" - umount "${work_dir}/root-image/sys" - umount "${work_dir}/root-image/run" - umount "${work_dir}/root-image/proc" - umount "${work_dir}/root-image/dev/shm" - umount "${work_dir}/root-image/dev/pts" - umount "${work_dir}/root-image/dev" - - trap - EXIT HUP INT TERM -} - _chroot_init() { - if [[ ! -d ${work_dir}/root-image/var/cache/pacman ]]; then - mkdir -p ${work_dir}/root-image/{dev,proc,run,sys,tmp,var/lib/pacman} - _pacman "base" - _pacman "syslinux" - fi + mkdir -p ${work_dir}/airootfs + case $init in + openrc) _pacman "base-openrc openrc-init syslinux" ;; + runit) _pacman "base-openrc runit syslinux" ;; + systemd) _pacman "base syslinux" ;; + esac } _chroot_run() { - _chroot_mount - eval chroot ${work_dir}/root-image "${run_cmd}" - _chroot_umount + eval arch-chroot ${work_dir}/airootfs "${run_cmd}" } -# Mount a filesystem (trap signals in case of error for unmounting it -# $1: source image -# $2: mount-point -_mount_fs() { - local _src="${1}" - local _dst="${2}" - trap "_umount_fs ${_src}" EXIT HUP INT TERM - mkdir -p "${_dst}" - _msg_info "Mounting '${_src}' on '${_dst}'" - mount "${_src}" "${_dst}" - _show_space_usage "${_dst}" +_mount_airootfs() { + trap "_umount_airootfs" EXIT HUP INT TERM + mkdir -p "${work_dir}/mnt/airootfs" + _msg_info "Mounting '${work_dir}/airootfs.img' on '${work_dir}/mnt/airootfs'" + mount "${work_dir}/airootfs.img" "${work_dir}/mnt/airootfs" + _msg_info "Done!" } -# Unmount a filesystem (and untrap signals) -# $1: mount-point or device/image -_umount_fs() { - local _dst="${1}" - _show_space_usage "${_dst}" - _msg_info "Unmounting '${_dst}'" - umount "${_dst}" - rmdir "${_dst}" +_umount_airootfs() { + _msg_info "Unmounting '${work_dir}/mnt/airootfs'" + umount -d "${work_dir}/mnt/airootfs" + _msg_info "Done!" + rmdir "${work_dir}/mnt/airootfs" trap - EXIT HUP INT TERM } -# Compare if a file/directory (source) is newer than other file (target) -# $1: source file/directory -# $2: target file -# return: 0 if target does not exists or if target is older than source. -# 1 if target is newer than source -_is_directory_changed() { - local _src="${1}" - local _dst="${2}" - - if [ -e "${_dst}" ]; then - if [[ $(find ${_src} -newer ${_dst} | wc -l) -gt 0 ]]; then - _msg_info "Target '${_dst}' is older than '${_src}', updating." - rm -f "${_dst}" - return 0 - else - _msg_info "Target '${_dst}' is up to date with '${_src}', skipping." - return 1 - fi - else - _msg_info "Target '${_dst}' does not exist, making it from '${_src}'" - return 0 - fi -} - # Show help usage, with an exit status. # $1: exit status number. _usage () @@ -140,7 +78,7 @@ _usage () echo "usage ${app_name} [options] command " echo " general options:" echo " -p PACKAGE(S) Package(s) to install, can be used multiple times" - echo " -r Run inside root-image" + echo " -r Run inside airootfs" echo " -C Config file for pacman." echo " Default: '${pacman_conf}'" echo " -L