mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-19 19:40:37 +02:00
replace grep with rg
This commit is contained in:
parent
a8d8dbda96
commit
3426ffcb20
1 changed files with 4 additions and 1 deletions
|
@ -27,8 +27,11 @@ _getrootflags() {
|
||||||
|
|
||||||
_getraidarrays() {
|
_getraidarrays() {
|
||||||
_RAIDARRAYS=""
|
_RAIDARRAYS=""
|
||||||
|
# fallback to md assembly on boot commandline
|
||||||
if [[ -f "${_DESTDIR}/etc/mdadm.conf" ]] && ! rg -q '^ARRAY' "${_DESTDIR}"/etc/mdadm.conf 2>"${_NO_LOG}"; then
|
if [[ -f "${_DESTDIR}/etc/mdadm.conf" ]] && ! rg -q '^ARRAY' "${_DESTDIR}"/etc/mdadm.conf 2>"${_NO_LOG}"; then
|
||||||
_RAIDARRAYS="$(echo -n "$(grep ^md /proc/mdstat 2>"${_NO_LOG}" | sed -e 's#\[[0-9]\]##g' -e 's# :.* raid[0-9]##g' -e 's#md#md=#g' -e 's# #,/dev/#g' -e 's#_##g')")"
|
_RAIDARRAYS="$(echo -n "$(rg '^md' /proc/mdstat 2>"${_NO_LOG}" |\
|
||||||
|
sd '\[[0-9]\]| :.* raid[0-9]+' '' |\
|
||||||
|
sd 'md' 'md=' | sd ' ' ',/dev/' | sd '_' '')")"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue