From d2addb25c94e10341362e38af89ca3afd6144409 Mon Sep 17 00:00:00 2001 From: nl6720 Date: Sun, 15 Aug 2021 12:17:12 +0300 Subject: mkarchiso: silence mkfs.fat in quiet mode mkfs.fat does not have a -q/--quiet option, so redirect its stdout to /dev/null instead. See https://github.com/dosfstools/dosfstools/issues/103 . Related to #148. --- archiso/mkarchiso | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/archiso/mkarchiso b/archiso/mkarchiso index 34c3e24..bb0549a 100755 --- a/archiso/mkarchiso +++ b/archiso/mkarchiso @@ -505,7 +505,13 @@ _make_efibootimg() { # https://lists.gnu.org/archive/html/grub-devel/2019-04/msg00099.html rm -f -- "${work_dir}/efiboot.img" _msg_info "Creating FAT image of size: ${imgsize} KiB..." - mkfs.fat -C -n ARCHISO_EFI "${work_dir}/efiboot.img" "${imgsize}" + if [[ "${quiet}" == "y" ]]; then + # mkfs.fat does not have a -q/--quiet option, so redirect stdout to /dev/null instead + # https://github.com/dosfstools/dosfstools/issues/103 + mkfs.fat -C -n ARCHISO_EFI "${work_dir}/efiboot.img" "${imgsize}" > /dev/null + else + mkfs.fat -C -n ARCHISO_EFI "${work_dir}/efiboot.img" "${imgsize}" + fi # Create the default/fallback boot path in which a boot loaders will be placed later. mmd -i "${work_dir}/efiboot.img" ::/EFI ::/EFI/BOOT -- cgit v1.2.3-70-g09d2 From ad6d65ab875c9a1ea6edea9e6b1ba99be4932cae Mon Sep 17 00:00:00 2001 From: nl6720 Date: Thu, 16 Sep 2021 10:40:21 +0300 Subject: mkarchiso: silence xorriso's note about SOURCE_DATE_EPOCH The `xorriso -as mkisofs` option `-quiet` is interpreted too late. Use native xorriso option `-report_about SORRY` instead and ensure it is the first option. Related to #148. --- archiso/mkarchiso | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/archiso/mkarchiso b/archiso/mkarchiso index bb0549a..eb30e04 100755 --- a/archiso/mkarchiso +++ b/archiso/mkarchiso @@ -995,12 +995,17 @@ _build_bootstrap_image() { # Build ISO _build_iso_image() { - local xorrisofs_options=() + local xorriso_options=() xorrisofs_options=() local bootmode [[ -d "${out_dir}" ]] || install -d -- "${out_dir}" - [[ "${quiet}" == "y" ]] && xorrisofs_options+=('-quiet') + if [[ "${quiet}" == "y" ]]; then + # The when xorriso is run in mkisofs compatibility mode (xorrisofs), the mkisofs option -quiet is interpreted + # too late (e.g. messages about SOURCE_DATE_EPOCH still get shown). + # Instead use native xorriso option to silence the output. + xorriso_options=('-report_about' 'SORRY' "${xorriso_options[@]}") + fi # Add required xorrisofs options for each boot mode for bootmode in "${bootmodes[@]}"; do @@ -1009,7 +1014,7 @@ _build_iso_image() { rm -f -- "${out_dir}/${image_name}" _msg_info "Creating ISO image..." - xorriso -as mkisofs \ + xorriso "${xorriso_options[@]}" -as mkisofs \ -iso-level 3 \ -full-iso9660-filenames \ -joliet \ -- cgit v1.2.3-70-g09d2 From 5738f40aa94c97dc5393703900a20ae2f79b2045 Mon Sep 17 00:00:00 2001 From: nl6720 Date: Thu, 16 Sep 2021 10:50:02 +0300 Subject: mkarchiso: redirect command -v output to /dev/null The output is irrelevant, we only need the return code. Related to #148. --- archiso/mkarchiso | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archiso/mkarchiso b/archiso/mkarchiso index eb30e04..38aad06 100755 --- a/archiso/mkarchiso +++ b/archiso/mkarchiso @@ -748,7 +748,7 @@ _validate_requirements_airootfs_image_type_ext4+squashfs() { } _validate_requirements_airootfs_image_type_erofs() { - if ! command -v mkfs.erofs; then + if ! command -v mkfs.erofs &> /dev/null; then (( validation_error=validation_error+1 )) _msg_error "Validating '${airootfs_image_type}': mkfs.erofs is not available on this host. Install 'erofs-utils'!" 0 fi -- cgit v1.2.3-70-g09d2 From 009140bd8bb497df148c3b468f0e1b217371d62c Mon Sep 17 00:00:00 2001 From: nl6720 Date: Thu, 16 Sep 2021 11:11:34 +0300 Subject: mkarchiso: do not show subdirectory sizes in netboot mode Only the total size is relevant. Related to #148. --- archiso/mkarchiso | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/archiso/mkarchiso b/archiso/mkarchiso index 38aad06..b7fe91c 100755 --- a/archiso/mkarchiso +++ b/archiso/mkarchiso @@ -704,7 +704,7 @@ _export_netboot_artifacts() { install -d -m 0755 "${out_dir}" cp -a -- "${isofs_dir}/${install_dir}/" "${out_dir}/" _msg_info "Done!" - du -h -- "${out_dir}/${install_dir}" + du -hs -- "${out_dir}/${install_dir}" } # sign build artifacts for netboot -- cgit v1.2.3-70-g09d2 From 8cfe29043f0626e12e157cd3f2354a6baf3ba076 Mon Sep 17 00:00:00 2001 From: nl6720 Date: Fri, 5 Nov 2021 12:46:54 +0200 Subject: mkarchiso: use mksquashfs -quiet instead of redirecting its stdout to /dev/null mksquashfs supports a -quiet option since squashfs-tools 4.4. Use this option in non-verbose mode instead of redirecting stdout of the whole command to /dev/null. This allows to have only one instance of mksquashfs in _run_mksquashfs instead of multiple ones in if-then-else. Related to #148. --- archiso/mkarchiso | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/archiso/mkarchiso b/archiso/mkarchiso index b7fe91c..8332604 100755 --- a/archiso/mkarchiso +++ b/archiso/mkarchiso @@ -165,13 +165,10 @@ _cleanup_pacstrap_dir() { # Create a squashfs image and place it in the ISO 9660 file system. # $@: options to pass to mksquashfs _run_mksquashfs() { - local image_path="${isofs_dir}/${install_dir}/${arch}/airootfs.sfs" + local mksquashfs_options=() image_path="${isofs_dir}/${install_dir}/${arch}/airootfs.sfs" rm -f -- "${image_path}" - if [[ "${quiet}" == "y" ]]; then - mksquashfs "$@" "${image_path}" -noappend "${airootfs_image_tool_options[@]}" -no-progress > /dev/null - else - mksquashfs "$@" "${image_path}" -noappend "${airootfs_image_tool_options[@]}" - fi + [[ ! "${quiet}" == "y" ]] || mksquashfs_options+=('-no-progress' '-quiet') + mksquashfs "$@" "${image_path}" -noappend "${airootfs_image_tool_options[@]}" "${mksquashfs_options[@]}" } # Create an ext4 image containing the root file system and pack it inside a squashfs image. -- cgit v1.2.3-70-g09d2 From a7f879fcdd5986ad6047a4a59d61ef10b7d9f05e Mon Sep 17 00:00:00 2001 From: nl6720 Date: Mon, 22 Nov 2021 11:40:59 +0200 Subject: mkarchiso: use mkfs.erofs --quiet in quiet mode erofs-utils 1.4 introduced a --quiet option. Related to #148. --- archiso/mkarchiso | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/archiso/mkarchiso b/archiso/mkarchiso index 8332604..4d7b1bc 100755 --- a/archiso/mkarchiso +++ b/archiso/mkarchiso @@ -213,16 +213,18 @@ _mkairootfs_squashfs() { # Create an EROFS image containing the root file system and saves it on the ISO 9660 file system. _mkairootfs_erofs() { - local fsuuid + local fsuuid mkfs_erofs_options=() [[ -e "${pacstrap_dir}" ]] || _msg_error "The path '${pacstrap_dir}' does not exist" 1 install -d -m 0755 -- "${isofs_dir}/${install_dir}/${arch}" local image_path="${isofs_dir}/${install_dir}/${arch}/airootfs.erofs" rm -f -- "${image_path}" + [[ ! "${quiet}" == "y" ]] || mkfs_erofs_options+=('--quiet') # Generate reproducible file system UUID from SOURCE_DATE_EPOCH fsuuid="$(uuidgen --sha1 --namespace 93a870ff-8565-4cf3-a67b-f47299271a96 --name "${SOURCE_DATE_EPOCH}")" + mkfs_erofs_options+=('-U' "${fsuuid}" "${airootfs_image_tool_options[@]}") _msg_info "Creating EROFS image, this may take some time..." - mkfs.erofs -U "${fsuuid}" "${airootfs_image_tool_options[@]}" -- "${image_path}" "${pacstrap_dir}" + mkfs.erofs "${mkfs_erofs_options[@]}" -- "${image_path}" "${pacstrap_dir}" _msg_info "Done!" } -- cgit v1.2.3-70-g09d2