diff --git a/usr/lib/archboot/installer/bootloader.sh b/usr/lib/archboot/installer/bootloader.sh index 388d5f306..0063bb43c 100644 --- a/usr/lib/archboot/installer/bootloader.sh +++ b/usr/lib/archboot/installer/bootloader.sh @@ -88,10 +88,10 @@ _bootloader_kernel_parameters() { [[ "${_NAME_SCHEME_PARAMETER}" == "FSLABEL" ]] && _getrootfslabel if [[ "${_NAME_SCHEME_PARAMETER}" == "SD_GPT_AUTO_GENERATOR" ]]; then _KERNEL_PARAMS_COMMON_UNMOD="${_RAIDARRAYS} ${_LUKSSETUP}" - _KERNEL_PARAMS_MOD="$(echo "${_KERNEL_PARAMS_COMMON_UNMOD}" | sed -e 's# # #g' | sed -e 's# # #g')" + _KERNEL_PARAMS_MOD="$(echo "${_KERNEL_PARAMS_COMMON_UNMOD}" | sd ' +' ' ')" else _KERNEL_PARAMS_COMMON_UNMOD="root=${_ROOTDEV} rootfstype=${_ROOTFS} rw ${_ROOTFLAGS} ${_RAIDARRAYS} ${_LUKSSETUP}" - _KERNEL_PARAMS_MOD="$(echo "${_KERNEL_PARAMS_COMMON_UNMOD}" | sed -e 's# # #g' | sed -e 's# # #g')" + _KERNEL_PARAMS_MOD="$(echo "${_KERNEL_PARAMS_COMMON_UNMOD}" | sd ' +' ' ')" fi } @@ -163,7 +163,7 @@ _uefi_efibootmgr() { efibootmgr --quiet -b "${_bootnum}" -B >> "${_LOG}" done _BOOTMGRDEV=$(${_LSBLK} PKNAME "${_UEFISYSDEV}" 2>"${_NO_LOG}") - _BOOTMGRNUM=$(echo "${_UEFISYSDEV}" | sed -e "s#${_BOOTMGRDEV}##g" | sed -e 's#p##g') + _BOOTMGRNUM=$(echo "${_UEFISYSDEV}" | sd "${_BOOTMGRDEV}" '' | sd 'p' '') efibootmgr --quiet --create --disk "${_BOOTMGRDEV}" --part "${_BOOTMGRNUM}" --loader "${_BOOTMGR_LOADER_PATH}" --label "${_BOOTMGR_LABEL}" >> "${_LOG}" } diff --git a/usr/lib/archboot/installer/bootloader_grub.sh b/usr/lib/archboot/installer/bootloader_grub.sh index 1568654cf..0e5e339c9 100644 --- a/usr/lib/archboot/installer/bootloader_grub.sh +++ b/usr/lib/archboot/installer/bootloader_grub.sh @@ -158,7 +158,7 @@ EOF else _LINUX_UNMOD_COMMAND="linux ${_SUBDIR}/${_VMLINUZ} ${_KERNEL_PARAMS_MOD}" fi - _LINUX_MOD_COMMAND=$(echo "${_LINUX_UNMOD_COMMAND}" | sed -e 's# # #g' | sed -e 's# # #g') + _LINUX_MOD_COMMAND=$(echo "${_LINUX_UNMOD_COMMAND}" | sd ' +' ' ') ## create default kernel entry _NUMBER=0 cat << EOF >> "${_DESTDIR}/${_GRUB_PREFIX_DIR}/${_GRUB_CFG}" diff --git a/usr/lib/archboot/installer/bootloader_sb.sh b/usr/lib/archboot/installer/bootloader_sb.sh index 5f44ee411..033fd69a9 100644 --- a/usr/lib/archboot/installer/bootloader_sb.sh +++ b/usr/lib/archboot/installer/bootloader_sb.sh @@ -9,7 +9,7 @@ _secureboot_keys() { _dialog --title " Setup Keys " --no-cancel --inputbox "Enter the directory to store the keys on ${_DESTDIR}." 8 65 "/etc/secureboot/keys" 2>"${_ANSWER}" || return 1 _KEYDIR=$(cat "${_ANSWER}") #shellcheck disable=SC2086,SC2001 - _KEYDIR="$(echo ${_KEYDIR} | sed -e 's#^/##g')" + _KEYDIR="$(echo ${_KEYDIR} | sd '^/' '')" done if [[ ! -d "${_DESTDIR}/${_KEYDIR}" ]]; then while [[ -z "${_CN}" ]]; do diff --git a/usr/lib/archboot/installer/bootloader_uboot.sh b/usr/lib/archboot/installer/bootloader_uboot.sh index e41398860..5bd924c76 100644 --- a/usr/lib/archboot/installer/bootloader_uboot.sh +++ b/usr/lib/archboot/installer/bootloader_uboot.sh @@ -7,7 +7,7 @@ _uboot() { _abort_uboot [[ -d "${_DESTDIR}/boot/extlinux" ]] || mkdir -p "${_DESTDIR}/boot/extlinux" _KERNEL_PARAMS_COMMON_UNMOD="root=${_ROOTDEV} rootfstype=${_ROOTFS} rw ${_ROOTFLAGS} ${_RAIDARRAYS} ${_LUKSSETUP}" - _KERNEL_PARAMS_COMMON_MOD="$(echo "${_KERNEL_PARAMS_COMMON_UNMOD}" | sed -e 's# # #g' | sed -e 's# # #g')" + _KERNEL_PARAMS_COMMON_MOD="$(echo "${_KERNEL_PARAMS_COMMON_UNMOD}" | sd ' +' ' ')" [[ "${_RUNNING_ARCH}" == "aarch64" ]] && _TITLE="ARM 64" [[ "${_RUNNING_ARCH}" == "riscv64" ]] && _TITLE="RISC-V 64" # write extlinux.conf diff --git a/usr/lib/archboot/installer/common.sh b/usr/lib/archboot/installer/common.sh index 933c7455c..de0f790d0 100644 --- a/usr/lib/archboot/installer/common.sh +++ b/usr/lib/archboot/installer/common.sh @@ -44,7 +44,7 @@ _marvell_firmware() { _MARVELL="" _PACKAGES="${_PACKAGES// linux-firmware-marvell / }" for i in $(fd -t f . /lib/modules/"${_RUNNING_KERNEL}" | rg -w 'wireless/marvell'); do - _MARVELL="${_MARVELL} $(basename "${i}" | sed -e 's#\..*$##g')" + _MARVELL="${_MARVELL} $(basename "${i}" | sd '.ko.*$' '')" done # check marvell modules if already loaded for i in ${_MARVELL}; do