replace > /dev/null 2>&1 with _NO_LOG

This commit is contained in:
Tobias Powalowski 2023-01-14 08:08:28 +01:00
parent f3207cd46a
commit a3ce7ab754
5 changed files with 25 additions and 24 deletions

View file

@ -56,14 +56,14 @@ _autoprepare() {
fi fi
while [[ -z "${_DEFAULTFS}" ]]; do while [[ -z "${_DEFAULTFS}" ]]; do
_FSOPTS="" _FSOPTS=""
command -v mkfs.btrfs > /dev/null 2>&1 && _FSOPTS="${_FSOPTS} btrfs Btrfs" command -v mkfs.btrfs ${_NO_LOG} && _FSOPTS="${_FSOPTS} btrfs Btrfs"
command -v mkfs.ext4 > /dev/null 2>&1 && _FSOPTS="${_FSOPTS} ext4 Ext4" command -v mkfs.ext4 ${_NO_LOG} && _FSOPTS="${_FSOPTS} ext4 Ext4"
command -v mkfs.ext3 > /dev/null 2>&1 && _FSOPTS="${_FSOPTS} ext3 Ext3" command -v mkfs.ext3 ${_NO_LOG} && _FSOPTS="${_FSOPTS} ext3 Ext3"
command -v mkfs.ext2 > /dev/null 2>&1 && _FSOPTS="${_FSOPTS} ext2 Ext2" command -v mkfs.ext2 ${_NO_LOG} && _FSOPTS="${_FSOPTS} ext2 Ext2"
command -v mkfs.xfs > /dev/null 2>&1 && _FSOPTS="${_FSOPTS} xfs XFS" command -v mkfs.xfs ${_NO_LOG} && _FSOPTS="${_FSOPTS} xfs XFS"
command -v mkfs.f2fs > /dev/null 2>&1 && _FSOPTS="${_FSOPTS} f2fs F2FS" command -v mkfs.f2fs ${_NO_LOG} && _FSOPTS="${_FSOPTS} f2fs F2FS"
command -v mkfs.nilfs2 > /dev/null 2>&1 && _FSOPTS="${_FSOPTS} nilfs2 Nilfs2" command -v mkfs.nilfs2 ${_NO_LOG} && _FSOPTS="${_FSOPTS} nilfs2 Nilfs2"
command -v mkfs.jfs > /dev/null 2>&1 && _FSOPTS="${_FSOPTS} jfs JFS" command -v mkfs.jfs ${_NO_LOG} && _FSOPTS="${_FSOPTS} jfs JFS"
# create 1 MB bios_grub partition for grub BIOS GPT support # create 1 MB bios_grub partition for grub BIOS GPT support
if [[ -n "${_GUIDPARAMETER}" ]]; then if [[ -n "${_GUIDPARAMETER}" ]]; then
_GUID_DEVICE_SIZE="2" _GUID_DEVICE_SIZE="2"

View file

@ -9,11 +9,12 @@ if grep -qw archboot /etc/hostname; then
else else
_DESTDIR="/" _DESTDIR="/"
fi fi
if pgrep -x Xorg > /dev/null 2>&1; then if pgrep -x Xorg ${_NO_LOG}; then
_LOG="/dev/tty8" _LOG="/dev/tty8"
else else
_LOG="/dev/tty7" _LOG="/dev/tty7"
fi fi
_NO_LOG="> /dev/null 2>&1"
_VC_NUM="$(basename ${_LOG} | sed -e 's#tty##g')" _VC_NUM="$(basename ${_LOG} | sed -e 's#tty##g')"
_VC="VC${_VC_NUM}" _VC="VC${_VC_NUM}"
# install stages # install stages

View file

@ -46,15 +46,15 @@ _ssd_optimization() {
_select_filesystem() { _select_filesystem() {
# don't allow vfat as / filesystem, it will not work! # don't allow vfat as / filesystem, it will not work!
_FSOPTS="" _FSOPTS=""
command -v mkfs.btrfs > /dev/null 2>&1 && _FSOPTS="${_FSOPTS} btrfs Btrfs" command -v mkfs.btrfs ${_NO_LOG} && _FSOPTS="${_FSOPTS} btrfs Btrfs"
command -v mkfs.ext4 > /dev/null 2>&1 && _FSOPTS="${_FSOPTS} ext4 Ext4" command -v mkfs.ext4 ${_NO_LOG} && _FSOPTS="${_FSOPTS} ext4 Ext4"
command -v mkfs.ext3 > /dev/null 2>&1 && _FSOPTS="${_FSOPTS} ext3 Ext3" command -v mkfs.ext3 ${_NO_LOG} && _FSOPTS="${_FSOPTS} ext3 Ext3"
command -v mkfs.ext2 > /dev/null 2>&1 && _FSOPTS="${_FSOPTS} ext2 Ext2" command -v mkfs.ext2 ${_NO_LOG} && _FSOPTS="${_FSOPTS} ext2 Ext2"
command -v mkfs.vfat > /dev/null 2>&1 && [[ -z "${_DO_ROOT}" ]] && _FSOPTS="${_FSOPTS} vfat FAT32" command -v mkfs.vfat ${_NO_LOG} && [[ -z "${_DO_ROOT}" ]] && _FSOPTS="${_FSOPTS} vfat FAT32"
command -v mkfs.xfs > /dev/null 2>&1 && _FSOPTS="${_FSOPTS} xfs XFS" command -v mkfs.xfs ${_NO_LOG} && _FSOPTS="${_FSOPTS} xfs XFS"
command -v mkfs.f2fs > /dev/null 2>&1 && _FSOPTS="${_FSOPTS} f2fs F2FS" command -v mkfs.f2fs ${_NO_LOG} && _FSOPTS="${_FSOPTS} f2fs F2FS"
command -v mkfs.nilfs2 > /dev/null 2>&1 && _FSOPTS="${_FSOPTS} nilfs2 Nilfs2" command -v mkfs.nilfs2 ${_NO_LOG} && _FSOPTS="${_FSOPTS} nilfs2 Nilfs2"
command -v mkfs.jfs > /dev/null 2>&1 && _FSOPTS="${_FSOPTS} jfs JFS" command -v mkfs.jfs ${_NO_LOG} && _FSOPTS="${_FSOPTS} jfs JFS"
#shellcheck disable=SC2086 #shellcheck disable=SC2086
_dialog --menu "Select a filesystem for ${_DEVICE}:" 16 50 13 ${_FSOPTS} 2>"${_ANSWER}" || return 1 _dialog --menu "Select a filesystem for ${_DEVICE}:" 16 50 13 ${_FSOPTS} 2>"${_ANSWER}" || return 1
_FSTYPE=$(cat "${_ANSWER}") _FSTYPE=$(cat "${_ANSWER}")

View file

@ -30,9 +30,9 @@ _do_wireless() {
_WLAN_AUTH="" _WLAN_AUTH=""
if [[ "${_CONNECTION}" == "wireless" ]]; then if [[ "${_CONNECTION}" == "wireless" ]]; then
# disconnect the interface first! # disconnect the interface first!
iwctl station "${_INTERFACE}" disconnect > /dev/null 2>&1 iwctl station "${_INTERFACE}" disconnect ${_NO_LOG}
# clean old keys first! # clean old keys first!
rm -f /var/lib/iwd/* > /dev/null 2>&1 rm -f /var/lib/iwd/* ${_NO_LOG}
#shellcheck disable=SC2086,SC2046 #shellcheck disable=SC2086,SC2046
_dialog --menu "Choose your SSID:\n(Empty spaces in your SSID are replaced by '+' char)" 14 60 7 \ _dialog --menu "Choose your SSID:\n(Empty spaces in your SSID are replaced by '+' char)" 14 60 7 \
$(_essid_scan _) \ $(_essid_scan _) \
@ -61,9 +61,9 @@ _do_wireless() {
_dialog --infobox "Connection to SSID='${_WLAN_SSID}' with interface ${_INTERFACE} ..." 3 70 _dialog --infobox "Connection to SSID='${_WLAN_SSID}' with interface ${_INTERFACE} ..." 3 70
_printk off _printk off
if [[ -z "${_WLAN_KEY}" ]]; then if [[ -z "${_WLAN_KEY}" ]]; then
iwctl station "${_INTERFACE}" "${_WLAN_CONNECT}" "${_WLAN_SSID}" > /dev/null 2>&1 && _WLAN_AUTH=1 iwctl station "${_INTERFACE}" "${_WLAN_CONNECT}" "${_WLAN_SSID}" ${_NO_LOG} && _WLAN_AUTH=1
else else
iwctl --passphrase="${_WLAN_KEY}" station "${_INTERFACE}" "${_WLAN_CONNECT}" "${_WLAN_SSID}" > /dev/null 2>&1 && _WLAN_AUTH=1 iwctl --passphrase="${_WLAN_KEY}" station "${_INTERFACE}" "${_WLAN_CONNECT}" "${_WLAN_SSID}" ${_NO_LOG} && _WLAN_AUTH=1
fi fi
if [[ -n "${_WLAN_AUTH}" ]]; then if [[ -n "${_WLAN_AUTH}" ]]; then
_dialog --infobox "Authentification successfull. Continuing in 3 seconds ..." 3 70 _dialog --infobox "Authentification successfull. Continuing in 3 seconds ..." 3 70

View file

@ -118,11 +118,11 @@ _prepare_pacman() {
[[ ! -d "${_DESTDIR}/var/lib/pacman" ]] && mkdir -p "${_DESTDIR}/var/lib/pacman" [[ ! -d "${_DESTDIR}/var/lib/pacman" ]] && mkdir -p "${_DESTDIR}/var/lib/pacman"
_dialog --infobox "Waiting for Arch Linux keyring initialization ..." 3 40 _dialog --infobox "Waiting for Arch Linux keyring initialization ..." 3 40
# pacman-key process itself # pacman-key process itself
while pgrep -x pacman-key > /dev/null 2>&1; do while pgrep -x pacman-key ${_NO_LOG}; do
sleep 1 sleep 1
done done
# gpg finished in background # gpg finished in background
while pgrep -x gpg > /dev/null 2>&1; do while pgrep -x gpg ${_NO_LOG}; do
sleep 1 sleep 1
done done
[[ -e /etc/systemd/system/pacman-init.service ]] && systemctl stop pacman-init.service [[ -e /etc/systemd/system/pacman-init.service ]] && systemctl stop pacman-init.service