export SUSPENDVG=$SUSPENDVG
EOF
add_linuxrc <<-'EOF'
- # parse rootdev from kernel commandline
- if [ "$ROOT" != "$ROOTDEV" ]; then
- ROOTDEV=$ROOT
- echo "LVM: Using 'root=$ROOTDEV' from kernel commandline"
- local tmp=${ROOTDEV#/dev/}
- if [ "$tmp" != "$ROOTDEV" ]; then
- ROOTVG=${tmp%/*}
- echo "LVM: Using Volume Group '$ROOTVG' for rootfs"
+ # parse rootdev from kernel commandline if it begins with /
+ case "$ROOT" in
+ /*)
+ if [ "$ROOT" != "$ROOTDEV" ]; then
+ ROOTDEV=$ROOT
+ echo "LVM: Using 'root=$ROOTDEV' from kernel commandline"
+ local tmp=${ROOTDEV#/dev/}
+ if [ "$tmp" != "$ROOTDEV" ]; then
+ ROOTVG=${tmp%/*}
+ echo "LVM: Using Volume Group '$ROOTVG' for rootfs"
+ fi
fi
- fi
+ ;;
+ esac
# skip duplicate VG
if [ "$SUSPENDVG" = "$ROOTVG" ]; then