summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Campbell <ijc@hellion.org.uk>2008-12-22 09:07:42 +0000
committermaximilian attems <maks@debian.org>2009-02-17 18:23:28 +0100
commit8260223ae409b3ca29e27628c5c572993dbcba76 (patch)
tree005e35e5e814b4ddeb97d0374d88c930931d0253
parent9e5ff69508479c10548e0fcf4d6f3ee043cff1fe (diff)
downloadinitramfs-tools-8260223ae409b3ca29e27628c5c572993dbcba76.tar.gz
initramfs-tools-8260223ae409b3ca29e27628c5c572993dbcba76.zip
MODULES=dep fix for Xen virtual block devices
Ferenc seems to be using the xvda1=img1,xvda2=img2 scheme of Xen disks (this is what xentools gets you) rather than the whole disk with partition scheme. In the xvda1/xvda2 scheme /sys/block contains: # ls /sys/block/ ram0 ram1 ram10 ram11 ram12 ram13 ram14 ram15 ram2 ram3 ram4 ram5 ram6 ram7 ram8 ram9 xvda1 xvda2 In the whole disk scheme it contains xvda as you would expect: # ls /sys/block/ loop0 loop1 loop2 loop3 loop4 loop5 loop6 loop7 ram0 ram1 ram10 ram11 ram12 ram13 ram14 ram15 ram2 ram3 ram4 ram5 ram6 ram7 ram8 ram9 xvda I've attached a patch which takes care of this difference. [ remove largest suffix pattern, so that we don't stumble on big minors -maks ] Signed-off-by: maximilian attems <maks@debian.org>
-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/}