diff --git a/usr/lib/archboot/installer/bootloader.sh b/usr/lib/archboot/installer/bootloader.sh index 08b20e9d5..689af013a 100644 --- a/usr/lib/archboot/installer/bootloader.sh +++ b/usr/lib/archboot/installer/bootloader.sh @@ -37,11 +37,11 @@ _getcryptsetup() { if ! cryptsetup status "$(basename "${_ROOTDEV}")" | rg -q 'inactive'; then if cryptsetup status "$(basename "${_ROOTDEV}")" 2>"${_NO_LOG}"; then if [[ "${_NAME_SCHEME_PARAMETER}" == "FSUUID" ]]; then - _LUKSDEV="UUID=$(${_LSBLK} UUID "$(cryptsetup status "$(basename "${_ROOTDEV}")" 2>"${_NO_LOG}" | grep device: | sed -e 's#device:##g')" 2>"${_NO_LOG}")" + _LUKSDEV="UUID=$(${_LSBLK} UUID "$(cryptsetup status "$(basename "${_ROOTDEV}")" 2>"${_NO_LOG}" | rg -o 'device: (.*)' -r '$1')" 2>"${_NO_LOG}")" elif [[ "${_NAME_SCHEME_PARAMETER}" == "FSLABEL" ]]; then - _LUKSDEV="LABEL=$(${_LSBLK} LABEL "$(cryptsetup status "$(basename "${_ROOTDEV}")" 2>"${_NO_LOG}" | grep device: | sed -e 's#device:##g')" 2>"${_NO_LOG}")" + _LUKSDEV="LABEL=$(${_LSBLK} LABEL "$(cryptsetup status "$(basename "${_ROOTDEV}")" 2>"${_NO_LOG}" | rg -o 'device: (.*)' -r '$1')" 2>"${_NO_LOG}")" else - _LUKSDEV="$(cryptsetup status "$(basename "${_ROOTDEV}")" 2>"${_NO_LOG}" | grep device: | sed -e 's#device:##g'))" + _LUKSDEV="$(cryptsetup status "$(basename "${_ROOTDEV}")" 2>"${_NO_LOG}" | rg -o 'device: (.*)' -r '$1')" fi _LUKSNAME="$(basename "${_ROOTDEV}")" _LUKSSETUP="cryptdevice=${_LUKSDEV}:${_LUKSNAME}" @@ -155,7 +155,8 @@ _uefi_common() { } _uefi_efibootmgr() { - for _bootnum in $(efibootmgr | rg '^Boot[0-9]' | grep -F -i "${_BOOTMGR_LABEL}" | cut -b5-8) ; do + # delete existing entry + for _bootnum in $(efibootmgr | rg -F -i "${_BOOTMGR_LABEL}" | rg -o '^Boot(\d+)' -r '$1'); do efibootmgr --quiet -b "${_bootnum}" -B >> "${_LOG}" done _BOOTMGRDEV=$(${_LSBLK} PKNAME "${_UEFISYSDEV}" 2>"${_NO_LOG}") diff --git a/usr/lib/archboot/installer/bootloader_grub.sh b/usr/lib/archboot/installer/bootloader_grub.sh index ebf2e2748..1568654cf 100644 --- a/usr/lib/archboot/installer/bootloader_grub.sh +++ b/usr/lib/archboot/installer/bootloader_grub.sh @@ -60,16 +60,16 @@ _grub_config() { _SUBDIR="/boot" # on btrfs we need to check on subvol if mount | rg -q "${_DESTDIR} type btrfs .*subvol"; then - _SUBDIR="/$(btrfs subvolume show "${_DESTDIR}/" | grep Name | cut -c 11-60)"/boot + _SUBDIR="/$(btrfs subvolume show "${_DESTDIR}/" | rg -o 'Name: +\t+(.*)' -r '$1')"/boot fi if mount | rg -q "${_DESTDIR}/boot type btrfs .*subvol"; then - _SUBDIR="/$(btrfs subvolume show "${_DESTDIR}/boot" | grep Name | cut -c 11-60)" + _SUBDIR="/$(btrfs subvolume show "${_DESTDIR}/boot" | rg -o 'Name: +\t+(.*)' -r '$1')" fi else _SUBDIR="" # on btrfs we need to check on subvol if mount | rg -q "${_DESTDIR}/boot type btrfs .*subvol"; then - _SUBDIR="/$(btrfs subvolume show "${_DESTDIR}/boot" | grep Name | cut -c 11-60)" + _SUBDIR="/$(btrfs subvolume show "${_DESTDIR}/boot" | rg -o 'Name: +\t+(.*)' -r '$1')" fi fi ## Move old config file, if any