+if [ -n "$INITRD" ] ; then
+ ## initrd must be on same device as kernel.
+ if [ "$IRDDEV" != "$KERNDEV" -o "$IRDPARTITION" != "$IRDPARTITION" -o "$INITRDDISK" != "$KERNELDISK" ] ; then
+ echo 1>&2 "$PRG: Initrd image must be on same device as kernel image."
+ exit 1
+ fi
+
+ ## check for cross device symlink
+ if [ -L "$INITRD" ] ; then
+ if [ "$IRDDEV" != "$IRDLINKDEV" ] ; then
+ echo 1>&2 "$PRG: Warning: Cross device symlink $INITRD, using it's target instead"
+ INITRD="$(readlink -f "$INITRD" 2>/dev/null)"
+ if [ ! -f "$INITRD" ] ; then
+ echo 1>&2 "$PRG: Unable to canonicalize symlink's target. Do not create cross device symlinks."
+ exit 1
+ fi
+ fi
+ fi
+fi
+