~ubuntu-branches/ubuntu/wily/devmapper/wily

« back to all changes in this revision

Viewing changes to debian/patches/dmsetup-export.patch

  • Committer: Bazaar Package Importer
  • Author(s): James Westby
  • Date: 2008-08-27 02:46:35 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20080827024635-x8xqn7ybx4b25747
Tags: 2:1.02.27-3ubuntu1
* Merge from Debian unstable. Remaining Ubuntu changes (LP: #244584):
  - Support udev-controlled devmapper in initramfs, for consistent device
    discovery/naming during boot and hotplug:
    + Add debian/dmsetup.initramfs: Hook for copying dmsetup and udev rules
      to the initramfs.
    + debian/rules: Copy hook to build directory.
    + debian/dmsetup.install: Install above file from build directory.
    + debian/dmsetup.postinst: Call update-initramfs.
  - debian/rules: Copy po/device-mapper.po to device-mapper.pot so Rosetta
    has a POT file to import.
  - Empty DH_OPTIONS while running dh_makeshlibs so that the -p option works
    properly, so that we get proper udeb shlibs again.
  - Create two new packages, libdevmapper-event1.02.1 and dmeventd. These
    packages will be used to help monitor dmraid events and log them to
    syslog.
  - debian/libdevmapper-dev.install: Add libdevmapper-event.h and
    libdevmapper-event.a to the dev package.
  - debian/dmsetup.udev: Set link priority to 100 for devmapper devices
    that have an UUID starting with DMRAID- for dmraid devmapper devices,
    to prevent UUIDs being used to mount hard disk partitions rather than
    the array itself.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
Index: devmapper-1.02.25/dmsetup/dmsetup.c
2
 
===================================================================
3
 
--- devmapper-1.02.25.orig/dmsetup/dmsetup.c    2008-06-17 21:41:18.000000000 -0700
4
 
+++ devmapper-1.02.25/dmsetup/dmsetup.c 2008-06-17 21:48:59.000000000 -0700
5
 
@@ -1073,6 +1073,78 @@
 
1
--- a/dmsetup/dmsetup.c
 
2
+++ b/dmsetup/dmsetup.c
 
3
@@ -1076,6 +1076,82 @@
6
4
        return r;
7
5
 }
8
6
 
18
16
+       struct dm_info info;
19
17
+       void *next = NULL;
20
18
+       uint64_t start, length;
21
 
+       char *target_type = NULL;
 
19
+       char *target_type;
22
20
+       char *params;
23
21
+
24
22
+       if (argc == 1 && !_switches[UUID_ARG] && !_switches[MAJOR_ARG])
44
42
+       printf("DM_NAME=\"%s\"\n", dm_task_get_name(dmt));
45
43
+
46
44
+       printf("DM_STATE=%s\n", info.suspended ? "SUSPENDED" : "ACTIVE");
47
 
+       printf("DM_STATE_RO=%s\n", info.read_only ? "READ-ONLY" : "");
 
45
+       if (!info.suspended)
 
46
+               printf("DM_STATE_ACTIVE=1\n");
 
47
+       if (info.read_only)
 
48
+               printf("DM_STATE_READONLY=1\n");
 
49
+       if (info.live_table)
 
50
+               printf("DM_TABLE_LIVE=1\n");
 
51
+       if (info.inactive_table)
 
52
+               printf("DM_TABLE_INACTIVE=1\n");
48
53
+
49
54
+       printf("DM_LAST_EVENT_NR=%" PRIu32 "\n", info.event_nr);
50
55
+       printf("DM_MAJOR=%d\n", info.major);
51
56
+       printf("DM_MINOR=%d\n", info.minor);
52
57
+
53
 
+        /* export all table types */
54
58
+       if (info.target_count != -1)
55
 
+                printf("DM_TARGET_COUNT=%d\n", info.target_count);
56
 
+
57
 
+        next = dm_get_next_target(dmt, next, &start, &length,
58
 
+                                  &target_type, &params);
59
 
+        if (target_type) {
60
 
+                printf("DM_TARGET_TYPES=%s", target_type);
61
 
+                while (next) {
62
 
+                        next = dm_get_next_target(dmt, next, &start, &length,
63
 
+                                                  &target_type, &params);
64
 
+                        if (target_type)
65
 
+                                printf(",%s", target_type);
66
 
+                }
67
 
+                printf("\n");
68
 
+        }
69
 
+
70
 
+       if (!(uuid = dm_task_get_uuid(dmt)))
71
 
+               uuid = "";
72
 
+       printf("DM_UUID=\"%s\"\n", uuid);
 
59
+               printf("DM_TARGET_COUNT=%d\n", info.target_count);
 
60
+
 
61
+       next = dm_get_next_target(dmt, next, &start, &length, &target_type, &params);
 
62
+       if (target_type) {
 
63
+               printf("DM_TARGET_TYPES=%s", target_type);
 
64
+               while (next) {
 
65
+                       next = dm_get_next_target(dmt, next, &start, &length,
 
66
+                                                 &target_type, &params);
 
67
+                       if (target_type)
 
68
+                               printf(",%s", target_type);
 
69
+               }
 
70
+               printf("\n");
 
71
+       }
 
72
+
 
73
+       if ((uuid = dm_task_get_uuid(dmt)) && *uuid)
 
74
+               printf("DM_UUID=\"%s\"\n", uuid);
73
75
+
74
76
+       r = 1;
75
77
+
81
83
 /* Show target names and their version numbers */
82
84
 static int _targets(int argc __attribute((unused)), char **argv __attribute((unused)), void *data __attribute((unused)))
83
85
 {
84
 
@@ -2035,6 +2107,7 @@
 
86
@@ -2122,6 +2198,7 @@
85
87
        {"targets", "", 0, 0, _targets},
86
88
        {"version", "", 0, 0, _version},
87
89
        {"setgeometry", "<device> <cyl> <head> <sect> <start>", 5, 5, _setgeometry},