diff --git a/archiso/mkarchiso b/archiso/mkarchiso index 4a010ad..2ccf7f0 100755 --- a/archiso/mkarchiso +++ b/archiso/mkarchiso @@ -39,14 +39,13 @@ bootmodes=() _msg_info() { local _msg="${1}" [[ "${quiet}" == "y" ]] || printf '[%s] INFO: %s\n' "${app_name}" "${_msg}" - } # Show a WARNING message # $1: message string _msg_warning() { local _msg="${1}" - printf '\n[%s] WARNING: %s\n\n' "${app_name}" "${_msg}" >&2 + printf '[%s] WARNING: %s\n' "${app_name}" "${_msg}" >&2 } # Show an ERROR message then exit with status @@ -55,14 +54,14 @@ _msg_warning() { _msg_error() { local _msg="${1}" local _error=${2} - printf '\n[%s] ERROR: %s\n\n' "${app_name}" "${_msg}" >&2 + printf '[%s] ERROR: %s\n' "${app_name}" "${_msg}" >&2 if (( _error > 0 )); then exit "${_error}" fi } _chroot_init() { - mkdir -p -- "${airootfs_dir}" + install -d -m 0755 -o 0 -g 0 -- "${airootfs_dir}" _pacman base syslinux } @@ -72,35 +71,51 @@ _chroot_run() { _mount_airootfs() { trap "_umount_airootfs" EXIT HUP INT TERM - mkdir -p -- "${work_dir}/mnt/airootfs" - _msg_info "Mounting '${airootfs_dir}.img' on '${work_dir}/mnt/airootfs'" + install -d -m 0755 -- "${work_dir}/mnt/airootfs" + _msg_info "Mounting '${airootfs_dir}.img' on '${work_dir}/mnt/airootfs'..." mount -- "${airootfs_dir}.img" "${work_dir}/mnt/airootfs" _msg_info "Done!" } _umount_airootfs() { - _msg_info "Unmounting '${work_dir}/mnt/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 } +_mount_efibootimg() { + trap "_umount_efibootimg" EXIT HUP INT TERM + install -d -m 0755 -- "${work_dir}/mnt/efiboot" + _msg_info "Mounting '${isofs_dir}/EFI/archiso/efiboot.img' on '${work_dir}/mnt/efiboot'..." + mount -- "${isofs_dir}/EFI/archiso/efiboot.img" "${work_dir}/mnt/efiboot" + _msg_info "Done!" +} + +_umount_efibootimg() { + _msg_info "Unmounting '${work_dir}/mnt/efiboot'..." + umount -d -- "${work_dir}/mnt/efiboot" + _msg_info "Done!" + rmdir -- "${work_dir}/mnt/efiboot" + trap - EXIT HUP INT TERM +} + # Show help usage, with an exit status. # $1: exit status number. -_usage () { +_usage() { IFS='' read -r -d '' usagetext < general options: -B Directory of the archiso profile to build -p PACKAGE(S) Package(s) to install, can be used multiple times - -C Config file for pacman. + -C pacman configuration file. Default: '${pacman_conf}' - -L