diff options
author | Jonathan Bauer | 2019-02-27 11:19:13 +0100 |
---|---|---|
committer | Jonathan Bauer | 2019-02-27 11:19:13 +0100 |
commit | 3f85f714002635255ce21fce20fe5ba469061f95 (patch) | |
tree | c02cd794968578f07db6ca2f5fa7555aed27b0e8 | |
parent | improvements & bug fixes (diff) | |
download | slx-tools-3f85f714002635255ce21fce20fe5ba469061f95.tar.gz slx-tools-3f85f714002635255ce21fce20fe5ba469061f95.tar.xz slx-tools-3f85f714002635255ce21fce20fe5ba469061f95.zip |
fix search/replace for ash
-rw-r--r-- | slx-tools | 8 |
1 files changed, 5 insertions, 3 deletions
@@ -29,7 +29,8 @@ is_volatile() { [ -z "$1" ] && return 2 local _dev="$(get_backing_dev "$1")" [ -z "$_dev" ] && return 0 - [ "$_dev" = "${_dev//\/dev\/mapper/}" ] && return 1 + # NOTE: ash does not search/replace when the expression is surrounded by quotes + [ "x$_dev" = "x"${_dev//\/dev\/mapper/} ] && return 1 local _mp="$(get_backing_dev_mp "$1")" [ -z "$_mp" ] && return 2 # it is a device mapper device, check if it was setup in dracut's initramfs. @@ -42,8 +43,9 @@ is_volatile() { get_dm_backing_size() { [ -z "$1" ] && return 1 - local _dev="$(get_backing_part $1)" - [ "$_dev" = "${_dev//\/dev\/mapper/}" ] && return 1 + local _dev="$(get_backing_dev $1)" + # NOTE: ash does not search/replace when the expression is surrounded by quotes + [ "x$_dev" = "x"${_dev//\/dev\/mapper/} ] && return 1 local _dm_line="$(grep -m1 -E "^${_dev}\s+/\s+type=[^0]" "$dmstate")" [ -z "$_dm_line" ] && return 1 local _dm_dev_size="$(echo "$_dm_line" | grep -Po '(?<=physical_size=|virtual_size=)\w*' )" |