summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Vignaud <tv@mageia.org>2012-05-23 18:28:24 +0000
committerThierry Vignaud <tv@mageia.org>2012-05-23 18:28:24 +0000
commita2164f535fbeef5e5e197f81bf897423d43349b1 (patch)
tree98e015c786e4aa0980fd43ea1f8ef90144a96933
parent57be1bfedfe82267fac3bea3a5ae6d59e4bcb8c4 (diff)
downloaddrakx-a2164f535fbeef5e5e197f81bf897423d43349b1.tar
drakx-a2164f535fbeef5e5e197f81bf897423d43349b1.tar.gz
drakx-a2164f535fbeef5e5e197f81bf897423d43349b1.tar.bz2
drakx-a2164f535fbeef5e5e197f81bf897423d43349b1.tar.xz
drakx-a2164f535fbeef5e5e197f81bf897423d43349b1.zip
(ensure_dev_exists,getXenBlk,simple_partition_scan,should_prefer_UUID) add support for XenBlk discs
needs testing
-rw-r--r--mdk-stage1/NEWS1
-rw-r--r--mdk-stage1/mount.c12
-rw-r--r--perl-install/detect_devices.pm10
-rw-r--r--perl-install/devices.pm4
-rw-r--r--perl-install/install/NEWS2
5 files changed, 26 insertions, 3 deletions
diff --git a/mdk-stage1/NEWS b/mdk-stage1/NEWS
index 7b0918ce6..816a92452 100644
--- a/mdk-stage1/NEWS
+++ b/mdk-stage1/NEWS
@@ -1,4 +1,5 @@
- do not advice long dead pcmcia.img & network.img images (mga#5466)
+- first attempt at supporting XenBlk discs
1.65
- load btrfs module to mount btrfs
diff --git a/mdk-stage1/mount.c b/mdk-stage1/mount.c
index 6c180d8e6..918f5d1a2 100644
--- a/mdk-stage1/mount.c
+++ b/mdk-stage1/mount.c
@@ -72,6 +72,18 @@ int ensure_dev_exists(const char * dev)
}
} else if (name[3])
minor += (name[3] - '0');
+ } else if (ptr_begins_static_str(name, "xvd")) {
+ /* Virtual disks */
+ major = 202;
+ minor = (name[2] - 'a') << 4;
+ if (name[4] && name[5]) {
+ minor += 10 + (name[5] - '0');
+ if (name[4] > 1 || name[5] > 5) {
+ log_message("I don't know how to create device %s, please post bugreport to me!", dev);
+ return -1;
+ }
+ } else if (name[4])
+ minor += (name[4] - '0');
} else if (ptr_begins_static_str(name, "hd")) {
/* IDE disks/cd's */
if (name[2] == 'a')
diff --git a/perl-install/detect_devices.pm b/perl-install/detect_devices.pm
index d56032284..cafc82e03 100644
--- a/perl-install/detect_devices.pm
+++ b/perl-install/detect_devices.pm
@@ -33,7 +33,7 @@ sub get() {
#- 2. The first SCSI device if SCSI exists. Or
#- 3. The first RAID device if RAID exists.
- getIDE(), getSCSI(), getVirtIO(), getDAC960(), getCompaqSmartArray(), getATARAID();
+ getIDE(), getSCSI(), getXenBlk(), getVirtIO(), getDAC960(), getCompaqSmartArray(), getATARAID();
}
sub hds() { grep { may_be_a_hd($_) } get() }
sub tapes() { grep { $_->{media_type} eq 'tape' } get() }
@@ -386,6 +386,14 @@ sub getATARAID() {
values %l;
}
+sub getXenBlk() {
+ -d '/sys/bus/xen/devices' or return;
+ map {
+ s/block://;
+ { device => basename($_), info => "Xen block device", media_type => 'xvd', bus => 'xen' };
+ } glob("/sys/bus/xen/devices/*/block*");
+}
+
sub getVirtIO() {
-d '/sys/bus/virtio/devices' or return;
map {
diff --git a/perl-install/devices.pm b/perl-install/devices.pm
index 3810f1f05..9e67042e4 100644
--- a/perl-install/devices.pm
+++ b/perl-install/devices.pm
@@ -212,7 +212,7 @@ sub make($) {
sub simple_partition_scan {
my ($part) = @_;
- $part->{device} =~ /([hsv]d[a-z])(\d+)$/;
+ $part->{device} =~ /((?:[hsv]|xv)d[a-z])(\d+)$/;
}
sub part_number {
my ($part) = @_;
@@ -230,7 +230,7 @@ sub prefix_for_dev {
sub should_prefer_UUID {
my ($dev) = @_;
- $dev =~ /^([hsv]d)/;
+ $dev =~ /^((?:[hsv]|xv)d)/;
}
sub symlink_now_and_register {
diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS
index 61f0982b0..d8612b89e 100644
--- a/perl-install/install/NEWS
+++ b/perl-install/install/NEWS
@@ -5,6 +5,8 @@
- packages installation:
o add support for 'justdb' option
o enable to go fast with 'tune-rpm'...
+- partitionning:
+ o first attempt at supporting XenBlk discs
- refactoring
Version 14.22 - 15 May 2012