dmsquash-live: Avoid grep and sed in this module.
strstr and variable string manipulations suffice.master
parent
e9a84e0a21
commit
a7d8fc280c
|
|
@ -18,12 +18,12 @@ fi
|
||||||
case "$liveroot" in
|
case "$liveroot" in
|
||||||
live:LABEL=*|LABEL=*) \
|
live:LABEL=*|LABEL=*) \
|
||||||
root="${root#live:}"
|
root="${root#live:}"
|
||||||
root="$(echo $root | sed 's,/,\\x2f,g')"
|
root="${root//\//\\x2f}"
|
||||||
root="live:/dev/disk/by-label/${root#LABEL=}"
|
root="live:/dev/disk/by-label/${root#LABEL=}"
|
||||||
rootok=1 ;;
|
rootok=1 ;;
|
||||||
live:CDLABEL=*|CDLABEL=*) \
|
live:CDLABEL=*|CDLABEL=*) \
|
||||||
root="${root#live:}"
|
root="${root#live:}"
|
||||||
root="$(echo $root | sed 's,/,\\x2f,g')"
|
root="${root//\//\\x2f}"
|
||||||
root="live:/dev/disk/by-label/${root#CDLABEL=}"
|
root="live:/dev/disk/by-label/${root#CDLABEL=}"
|
||||||
rootok=1 ;;
|
rootok=1 ;;
|
||||||
live:UUID=*|UUID=*) \
|
live:UUID=*|UUID=*) \
|
||||||
|
|
|
||||||
|
|
@ -109,15 +109,15 @@ do_live_overlay() {
|
||||||
|
|
||||||
if [ -z "$overlay" ]; then
|
if [ -z "$overlay" ]; then
|
||||||
pathspec="/${live_dir}/overlay-$l-$u"
|
pathspec="/${live_dir}/overlay-$l-$u"
|
||||||
elif ( echo $overlay | grep -q ":" ); then
|
elif strstr $overlay ":"; then
|
||||||
# pathspec specified, extract
|
# pathspec specified, extract
|
||||||
pathspec=$( echo $overlay | sed -e 's/^.*://' )
|
pathspec=${overlay##*:}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$pathspec" -o "$pathspec" = "auto" ]; then
|
if [ -z "$pathspec" -o "$pathspec" = "auto" ]; then
|
||||||
pathspec="/${live_dir}/overlay-$l-$u"
|
pathspec="/${live_dir}/overlay-$l-$u"
|
||||||
fi
|
fi
|
||||||
devspec=$( echo $overlay | sed -e 's/:.*$//' )
|
devspec=${overlay%%:*}
|
||||||
|
|
||||||
# need to know where to look for the overlay
|
# need to know where to look for the overlay
|
||||||
if [ -z "$setup" -a -n "$devspec" -a -n "$pathspec" -a -n "$overlay" ]; then
|
if [ -z "$setup" -a -n "$devspec" -a -n "$pathspec" -a -n "$overlay" ]; then
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@ installkernel() {
|
||||||
|
|
||||||
# called by dracut
|
# called by dracut
|
||||||
install() {
|
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_multiple -o checkisomd5
|
||||||
inst_hook cmdline 30 "$moddir/parse-dmsquash-live.sh"
|
inst_hook cmdline 30 "$moddir/parse-dmsquash-live.sh"
|
||||||
inst_hook cmdline 31 "$moddir/parse-iso-scan.sh"
|
inst_hook cmdline 31 "$moddir/parse-iso-scan.sh"
|
||||||
|
|
|
||||||
|
|
@ -20,12 +20,12 @@ modprobe -q loop
|
||||||
case "$liveroot" in
|
case "$liveroot" in
|
||||||
live:LABEL=*|LABEL=*) \
|
live:LABEL=*|LABEL=*) \
|
||||||
root="${root#live:}"
|
root="${root#live:}"
|
||||||
root="$(echo $root | sed 's,/,\\x2f,g')"
|
root="${root//\//\\x2f}"
|
||||||
root="live:/dev/disk/by-label/${root#LABEL=}"
|
root="live:/dev/disk/by-label/${root#LABEL=}"
|
||||||
rootok=1 ;;
|
rootok=1 ;;
|
||||||
live:CDLABEL=*|CDLABEL=*) \
|
live:CDLABEL=*|CDLABEL=*) \
|
||||||
root="${root#live:}"
|
root="${root#live:}"
|
||||||
root="$(echo $root | sed 's,/,\\x2f,g')"
|
root="${root//\//\\x2f}"
|
||||||
root="live:/dev/disk/by-label/${root#CDLABEL=}"
|
root="live:/dev/disk/by-label/${root#CDLABEL=}"
|
||||||
rootok=1 ;;
|
rootok=1 ;;
|
||||||
live:UUID=*|UUID=*) \
|
live:UUID=*|UUID=*) \
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue