strstr and variable string manipulations suffice.
case "$liveroot" in
live:LABEL=*|LABEL=*) \
root="${root#live:}"
- root="$(echo $root | sed 's,/,\\x2f,g')"
+ root="${root//\//\\x2f}"
root="live:/dev/disk/by-label/${root#LABEL=}"
rootok=1 ;;
live:CDLABEL=*|CDLABEL=*) \
root="${root#live:}"
- root="$(echo $root | sed 's,/,\\x2f,g')"
+ root="${root//\//\\x2f}"
root="live:/dev/disk/by-label/${root#CDLABEL=}"
rootok=1 ;;
live:UUID=*|UUID=*) \
if [ -z "$overlay" ]; then
pathspec="/${live_dir}/overlay-$l-$u"
- elif ( echo $overlay | grep -q ":" ); then
+ elif strstr $overlay ":"; then
# pathspec specified, extract
- pathspec=$( echo $overlay | sed -e 's/^.*://' )
+ pathspec=${overlay##*:}
fi
if [ -z "$pathspec" -o "$pathspec" = "auto" ]; then
pathspec="/${live_dir}/overlay-$l-$u"
fi
- devspec=$( echo $overlay | sed -e 's/:.*$//' )
+ devspec=${overlay%%:*}
# need to know where to look for the overlay
if [ -z "$setup" -a -n "$devspec" -a -n "$pathspec" -a -n "$overlay" ]; then
# called by dracut
install() {
- inst_multiple umount dmsetup blkid dd losetup grep blockdev find
+ inst_multiple umount dmsetup blkid dd losetup blockdev find
inst_multiple -o checkisomd5
inst_hook cmdline 30 "$moddir/parse-dmsquash-live.sh"
inst_hook cmdline 31 "$moddir/parse-iso-scan.sh"
case "$liveroot" in
live:LABEL=*|LABEL=*) \
root="${root#live:}"
- root="$(echo $root | sed 's,/,\\x2f,g')"
+ root="${root//\//\\x2f}"
root="live:/dev/disk/by-label/${root#LABEL=}"
rootok=1 ;;
live:CDLABEL=*|CDLABEL=*) \
root="${root#live:}"
- root="$(echo $root | sed 's,/,\\x2f,g')"
+ root="${root//\//\\x2f}"
root="live:/dev/disk/by-label/${root#CDLABEL=}"
rootok=1 ;;
live:UUID=*|UUID=*) \