summaryrefslogtreecommitdiff
path: root/hook-functions
diff options
context:
space:
mode:
Diffstat (limited to 'hook-functions')
-rw-r--r--hook-functions9
1 files changed, 9 insertions, 0 deletions
diff --git a/hook-functions b/hook-functions
index 0ddfcec..da6ddf9 100644
--- a/hook-functions
+++ b/hook-functions
@@ -283,6 +283,15 @@ dep_add_modules()
root=${root#/dev/}
block=$(losetup -a \
| awk "/${root}/{print substr(\$3, 7, 3); exit}")
+ # Xen virtual device /dev/xvdX
+ elif [ "${root#/dev/xvd}" != "${root}" ]; then
+ block=${root#/dev/}
+ # Xen has a mode where only the individual partitions are
+ # registered with the kernel as well as the usual full disk
+ # with partition table scheme.
+ if [ ! -e /sys/block/${block} ] ; then
+ block=${block%%[0-9]*}
+ fi
# classical root device
else
block=${root#/dev/}