From ea85b0a0494a74f3d5d0852a2123d6f9f7d2741d Mon Sep 17 00:00:00 2001 From: Tobias Powalowski Date: Sat, 14 Jan 2023 09:00:54 +0100 Subject: [PATCH] replace &> /dev/null and &>/dev/null with >${_NO_LOG} --- usr/lib/archboot/installer/autoprepare.sh | 10 +++++----- usr/lib/archboot/installer/partition.sh | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/usr/lib/archboot/installer/autoprepare.sh b/usr/lib/archboot/installer/autoprepare.sh index dc699ac7b..4bef34db4 100644 --- a/usr/lib/archboot/installer/autoprepare.sh +++ b/usr/lib/archboot/installer/autoprepare.sh @@ -200,12 +200,12 @@ _autoprepare() { _printk off _dialog --infobox "Partitioning ${_DISK} ..." 0 0 # clean partition table to avoid issues! - sgdisk --zap "${_DISK}" &>/dev/null + sgdisk --zap "${_DISK}" >"${_NO_LOG}" # clear all magic strings/signatures - mdadm, lvm, partition tables etc. - dd if=/dev/zero of="${_DISK}" bs=512 count=2048 &>/dev/null - wipefs -a "${_DISK}" &>/dev/null + dd if=/dev/zero of="${_DISK}" bs=512 count=2048 >"${_NO_LOG}" + wipefs -a "${_DISK}" >"${_NO_LOG}" # create fresh GPT - sgdisk --clear "${_DISK}" &>/dev/null + sgdisk --clear "${_DISK}" >"${_NO_LOG}" # create actual partitions sgdisk --set-alignment="2048" --new="${_GPT_BIOS_GRUB_DEVICE_NUM}":0:+"${_GPT_BIOS_GRUB_DEVICE_SIZE}"M --typecode="${_GPT_BIOS_GRUB_DEVICE_NUM}":EF02 --change-name="${_GPT_BIOS_GRUB_DEVICE_NUM}":BIOS_GRUB "${_DISK}" > "${_LOG}" sgdisk --set-alignment="2048" --new="${_UEFISYS_DEVICE_NUM}":0:+"${_UEFISYS_DEVICE_SIZE}"M --typecode="${_UEFISYS_DEVICE_NUM}":EF00 --change-name="${_UEFISYS_DEVICE_NUM}":UEFI_SYSTEM "${_DISK}" > "${_LOG}" @@ -228,7 +228,7 @@ _autoprepare() { _dialog --infobox "Partitioning ${_DISK}" 0 0 # clean partitiontable to avoid issues! dd if=/dev/zero of="${_DISK}" bs=512 count=2048 >"${_NO_LOG}" - wipefs -a "${_DISK}" &>/dev/null + wipefs -a "${_DISK}" >"${_NO_LOG}" # create DOS MBR with parted parted -a optimal -s "${_DISK}" unit MiB mktable msdos >"${_NO_LOG}" parted -a optimal -s "${_DISK}" unit MiB mkpart primary 1 $((_GUID_DEVICE_SIZE+_BOOT_DEVICE_SIZE)) >"${_LOG}" diff --git a/usr/lib/archboot/installer/partition.sh b/usr/lib/archboot/installer/partition.sh index 937e17d95..162ab44b5 100644 --- a/usr/lib/archboot/installer/partition.sh +++ b/usr/lib/archboot/installer/partition.sh @@ -20,12 +20,12 @@ _check_gpt() { if [[ -z "${_GUID_DETECTED}" ]]; then _dialog --defaultno --yesno "Conversion failed on ${_DISK}.\nSetup detected no GUID (gpt) partition table on ${_DISK}.\n\nDo you want to create a new GUID (gpt) table now on ${_DISK}?\n\n${_DISK} will be COMPLETELY ERASED! Are you absolutely sure?" 0 0 || return 1 # clean partition table to avoid issues! - sgdisk --zap "${_DISK}" &>/dev/null + sgdisk --zap "${_DISK}" >"${_NO_LOG}" # clear all magic strings/signatures - mdadm, lvm, partition tables etc. - dd if=/dev/zero of="${_DISK}" bs=512 count=2048 &>/dev/null - wipefs -a "${_DISK}" &>/dev/null + dd if=/dev/zero of="${_DISK}" bs=512 count=2048 >"${_NO_LOG}" + wipefs -a "${_DISK}" >"${_NO_LOG}" # create fresh GPT - sgdisk --clear "${_DISK}" &>/dev/null + sgdisk --clear "${_DISK}" >"${_NO_LOG}" _GUID_DETECTED=1 fi fi @@ -86,8 +86,8 @@ _check_efisys_part() { _dialog --inputbox "Enter the mountpoint of your EFI System partition (Default is /boot): " 0 0 "/boot" 2>"${_ANSWER}" || return 1 _UEFISYS_MP="$(cat "${_ANSWER}")" fi - umount "${_DESTDIR}/${_UEFISYS_MP}" &> /dev/null - umount "${_UEFISYS_DEVICE}" &> /dev/null + umount "${_DESTDIR}/${_UEFISYS_MP}" >"${_NO_LOG}" + umount "${_UEFISYS_DEVICE}" >"${_NO_LOG}" if [[ -n "${_FORMAT_UEFISYS_FAT32}" ]]; then mkfs.vfat -F32 -n "EFISYS" "${_UEFISYS_DEVICE}" fi