Browse Source

dmsquash-live: Avoid grep and sed in this module.

strstr and variable string manipulations suffice.
master
Frederick Grose 7 years ago committed by Harald Hoyer
parent
commit
a7d8fc280c
  1. 4
      modules.d/90dmsquash-live/dmsquash-generator.sh
  2. 6
      modules.d/90dmsquash-live/dmsquash-live-root.sh
  3. 2
      modules.d/90dmsquash-live/module-setup.sh
  4. 4
      modules.d/90dmsquash-live/parse-dmsquash-live.sh

4
modules.d/90dmsquash-live/dmsquash-generator.sh

@ -18,12 +18,12 @@ fi @@ -18,12 +18,12 @@ fi
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=*) \

6
modules.d/90dmsquash-live/dmsquash-live-root.sh

@ -109,15 +109,15 @@ do_live_overlay() { @@ -109,15 +109,15 @@ do_live_overlay() {

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

2
modules.d/90dmsquash-live/module-setup.sh

@ -22,7 +22,7 @@ installkernel() { @@ -22,7 +22,7 @@ installkernel() {

# 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"

4
modules.d/90dmsquash-live/parse-dmsquash-live.sh

@ -20,12 +20,12 @@ modprobe -q loop @@ -20,12 +20,12 @@ modprobe -q loop
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=*) \

Loading…
Cancel
Save