From e264b44682a930f70715ea58cf96e69c87a86b64 Mon Sep 17 00:00:00 2001 From: David Runge Date: Sat, 30 May 2020 00:01:28 +0200 Subject: Add license and basic documentation LICENSE: Add GPL-3.0 license. {{archiso,configs}/*,.editorconfig,.gitlab-ci.yml}: Add SPDX license identifier. Makefile: Add SPDX license identifier. Install the `run_archiso.sh` script as global executable `run_archiso`. Use -D and -t flags to install to install files more generically (without a previous call to install the directory). README.rst: Add README outlining the project's scope, how to build images from the profiles and how to test. AUTHORS.rst: Add list of all direct contributors to the repository. CONTRIBUTING.rst: Add basic contribution guidelines, explaining the linter and the license in use. Closes #7 Closes #3 --- archiso/mkarchiso | 2 ++ 1 file changed, 2 insertions(+) (limited to 'archiso/mkarchiso') diff --git a/archiso/mkarchiso b/archiso/mkarchiso index 5e229a4..ad5232a 100755 --- a/archiso/mkarchiso +++ b/archiso/mkarchiso @@ -1,4 +1,6 @@ #!/bin/bash +# +# SPDX-License-Identifier: GPL-3.0-or-later set -e -u -- cgit v1.2.3-70-g09d2 From 945f3834c287bd06d33d4ac6c3b777e3df37dea7 Mon Sep 17 00:00:00 2001 From: nl6720 Date: Thu, 30 Jul 2020 18:18:00 +0300 Subject: Show mksquashfs progress bar when mkarchiso is run in verbose mode --- archiso/mkarchiso | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'archiso/mkarchiso') diff --git a/archiso/mkarchiso b/archiso/mkarchiso index ad5232a..4e2a868 100755 --- a/archiso/mkarchiso +++ b/archiso/mkarchiso @@ -229,7 +229,7 @@ _mkairootfs_img () { -comp "${sfs_comp}" -no-progress &> /dev/null else mksquashfs "${work_dir}/airootfs.img" "${work_dir}/iso/${install_dir}/${arch}/airootfs.sfs" -noappend \ - -comp "${sfs_comp}" -no-progress + -comp "${sfs_comp}" fi _msg_info "Done!" rm "${work_dir}/airootfs.img" @@ -248,7 +248,7 @@ _mkairootfs_sfs () { -comp "${sfs_comp}" -no-progress &> /dev/null else mksquashfs "${work_dir}/airootfs" "${work_dir}/iso/${install_dir}/${arch}/airootfs.sfs" -noappend \ - -comp "${sfs_comp}" -no-progress + -comp "${sfs_comp}" fi _msg_info "Done!" } -- cgit v1.2.3-70-g09d2 From 6312ccc9bccb453c8506322581aa467538bc123f Mon Sep 17 00:00:00 2001 From: nl6720 Date: Thu, 30 Jul 2020 18:36:21 +0300 Subject: Ensure all files in the ISO's Rock Ridge file system are owned by root archiso/mkarchiso: Add the -rational-rock option to xorriso. This is a preparatory step for creating ISOs as a regular user. See https://gitlab.archlinux.org/archlinux/archiso/-/issues/40 . --- archiso/mkarchiso | 2 ++ 1 file changed, 2 insertions(+) (limited to 'archiso/mkarchiso') diff --git a/archiso/mkarchiso b/archiso/mkarchiso index 4e2a868..df7ee05 100755 --- a/archiso/mkarchiso +++ b/archiso/mkarchiso @@ -309,6 +309,7 @@ command_iso () { xorriso -as mkisofs -quiet \ -iso-level 3 \ -full-iso9660-filenames \ + -rational-rock \ -volid "${iso_label}" \ -appid "${iso_application}" \ -publisher "${iso_publisher}" \ @@ -324,6 +325,7 @@ command_iso () { xorriso -as mkisofs \ -iso-level 3 \ -full-iso9660-filenames \ + -rational-rock \ -volid "${iso_label}" \ -appid "${iso_application}" \ -publisher "${iso_publisher}" \ -- cgit v1.2.3-70-g09d2 From 0387b253c8ff90df30ad35883f710ddce3e04854 Mon Sep 17 00:00:00 2001 From: nl6720 Date: Sat, 1 Aug 2020 14:51:11 +0300 Subject: archiso/mkarchiso: general bash improvements Quote all variables. Terminate option processing using '--' for commands that support it. Do not hardcode file descriptor. Compare integers with arithmetic comparison instead of string comparison. Replace echo with printf. Use heredoc for usage text. Don't print INFO messages when quiet is set. Export SOURCE_DATE_EPOCH. --- archiso/mkarchiso | 192 +++++++++++++++++++++++++++--------------------------- 1 file changed, 96 insertions(+), 96 deletions(-) (limited to 'archiso/mkarchiso') diff --git a/archiso/mkarchiso b/archiso/mkarchiso index df7ee05..1dca307 100755 --- a/archiso/mkarchiso +++ b/archiso/mkarchiso @@ -4,10 +4,13 @@ set -e -u -export LANG=C +# Control the environment +umask 0022 +export LANG="C" +export SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-"$(date +%s)"}" -app_name=${0##*/} -arch=$(uname -m) +app_name="${0##*/}" +arch="$(uname -m)" pkg_list=() run_cmd="" quiet="y" @@ -20,13 +23,14 @@ work_dir="work" out_dir="out" sfs_mode="sfs" sfs_comp="xz" -gpg_key= +gpg_key="" # Show an INFO message # $1: message string _msg_info() { local _msg="${1}" - echo "[mkarchiso] INFO: ${_msg}" + [[ "${quiet}" == "y" ]] || printf '[%s] INFO: %s\n' "${app_name}" "${_msg}" + } # Show an ERROR message then exit with status @@ -35,83 +39,83 @@ _msg_info() { _msg_error() { local _msg="${1}" local _error=${2} - echo - echo "[mkarchiso] ERROR: ${_msg}" - echo - if [[ ${_error} -gt 0 ]]; then + printf '\n[%s] ERROR: %s\n\n' "${app_name}" "${_msg}" >&2 + if (( _error > 0 )); then exit "${_error}" fi } _chroot_init() { - mkdir -p ${work_dir}/airootfs + mkdir -p -- "${work_dir}/airootfs" _pacman base syslinux } _chroot_run() { - eval arch-chroot ${work_dir}/airootfs "${run_cmd}" + eval -- arch-chroot "${work_dir}/airootfs" "${run_cmd}" } _mount_airootfs() { trap "_umount_airootfs" EXIT HUP INT TERM - mkdir -p "${work_dir}/mnt/airootfs" + 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" + mount -- "${work_dir}/airootfs.img" "${work_dir}/mnt/airootfs" _msg_info "Done!" } _umount_airootfs() { _msg_info "Unmounting '${work_dir}/mnt/airootfs'" - umount -d "${work_dir}/mnt/airootfs" + umount -d -- "${work_dir}/mnt/airootfs" _msg_info "Done!" - rmdir "${work_dir}/mnt/airootfs" + rmdir -- "${work_dir}/mnt/airootfs" trap - EXIT HUP INT TERM } # Show help usage, with an exit status. # $1: exit status number. -_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 airootfs" - echo " -C Config file for pacman." - echo " Default: '${pacman_conf}'" - echo " -L