~ubuntu-branches/ubuntu/utopic/grub2/utopic

« back to all changes in this revision

Viewing changes to debian/patches/probe-delimiter.patch

  • Committer: Package Import Robot
  • Author(s): Colin Watson, Colin Watson, Jon Severinsson
  • Date: 2014-03-31 16:30:37 UTC
  • mfrom: (17.3.93 sid)
  • Revision ID: package-import@ubuntu.com-20140331163037-b7h7nc1lf6st1z87
Tags: 2.02~beta2-8
[ Colin Watson ]
* Backport from upstream:
  - ieee1275: check for IBM pseries emulated machine.
  - Fix partmap, cryptodisk, and abstraction handling in grub-mkconfig
    (closes: #735935).
  - btrfs: fix get_root key comparison failures due to endianness.
* Build-depend on automake (>= 1.10.1) to ensure that it meets configure's
  requirements (LP: #1299041).
* When installing an image for use with UEFI Secure Boot, generate a
  load.cfg even if there are no device abstractions in use (LP: #1298399).

[ Jon Severinsson ]
* Add Tanglu support, as in Debian except:
  - Enable splash screen by default (as Ubuntu)
  - Enable quiet and quick boot (as Ubuntu)
  - Enable the grub-common init script (as Ubuntu)
  - Enable dynamic gfxpayload (as Ubuntu)
  - Enable vt handover (as Ubuntu)
  - Use monochromatic theme by default (as Ubuntu)
  - Use Tanglu GRUB wallpaper by default.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
From d9c202af30a1989246e0878af3c67b7aa9c6f83b Mon Sep 17 00:00:00 2001
 
2
From: Colin Watson <cjwatson@ubuntu.com>
 
3
Date: Mon, 31 Mar 2014 14:48:33 +0100
 
4
Subject: Fix partmap, cryptodisk, and abstraction handling in grub-mkconfig.
 
5
 
 
6
Commit 588744d0dc655177d5883bdcb8f72ff5160109ed caused grub-mkconfig
 
7
no longer to be forgiving of trailing spaces on grub-probe output
 
8
lines, which among other things means that util/grub.d/10_linux.in
 
9
no longer detects LVM.  To fix this, make grub-probe's output
 
10
delimiting more consistent.  As a bonus, this improves the coverage
 
11
of the -0 option.
 
12
 
 
13
Fixes Debian bug #735935.
 
14
 
 
15
* grub-core/disk/cryptodisk.c
 
16
(grub_util_cryptodisk_get_abstraction): Add a user-data argument.
 
17
* grub-core/disk/diskfilter.c (grub_diskfilter_get_partmap):
 
18
Likewise.
 
19
* include/grub/cryptodisk.h (grub_util_cryptodisk_get_abstraction):
 
20
Update prototype.
 
21
* include/grub/diskfilter.h (grub_diskfilter_get_partmap): Likewise.
 
22
* util/grub-install.c (push_partmap_module, push_cryptodisk_module,
 
23
probe_mods): Adjust for extra user-data arguments.
 
24
* util/grub-probe.c (do_print, probe_partmap, probe_cryptodisk_uuid,
 
25
probe_abstraction): Use configured delimiter.  Update callers.
 
26
 
 
27
Origin: upstream, http://git.savannah.gnu.org/gitweb/?p=grub.git;a=commitdiff;h=24024dac7f51d3c0df8e1bec63c02d52828de534
 
28
Bug-Debian: http://bugs.debian.org/735935
 
29
Forwarded: not-needed
 
30
Last-Update: 2014-03-31
 
31
 
 
32
Patch-Name: probe-delimiter.patch
 
33
---
 
34
 grub-core/disk/cryptodisk.c | 19 ++++++++++---------
 
35
 grub-core/disk/diskfilter.c |  5 +++--
 
36
 include/grub/cryptodisk.h   |  3 ++-
 
37
 include/grub/diskfilter.h   |  3 ++-
 
38
 util/grub-install.c         | 14 ++++++++++----
 
39
 util/grub-probe.c           | 46 ++++++++++++++++++++++-----------------------
 
40
 6 files changed, 49 insertions(+), 41 deletions(-)
 
41
 
 
42
diff --git a/grub-core/disk/cryptodisk.c b/grub-core/disk/cryptodisk.c
 
43
index 75c6e1f..f0e3a90 100644
 
44
--- a/grub-core/disk/cryptodisk.c
 
45
+++ b/grub-core/disk/cryptodisk.c
 
46
@@ -762,25 +762,26 @@ grub_cryptodisk_cheat_insert (grub_cryptodisk_t newdev, const char *name,
 
47
 
 
48
 void
 
49
 grub_util_cryptodisk_get_abstraction (grub_disk_t disk,
 
50
-                                     void (*cb) (const char *val))
 
51
+                                     void (*cb) (const char *val, void *data),
 
52
+                                     void *data)
 
53
 {
 
54
   grub_cryptodisk_t dev = (grub_cryptodisk_t) disk->data;
 
55
 
 
56
-  cb ("cryptodisk");
 
57
-  cb (dev->modname);
 
58
+  cb ("cryptodisk", data);
 
59
+  cb (dev->modname, data);
 
60
 
 
61
   if (dev->cipher)
 
62
-    cb (dev->cipher->cipher->modname);
 
63
+    cb (dev->cipher->cipher->modname, data);
 
64
   if (dev->secondary_cipher)
 
65
-    cb (dev->secondary_cipher->cipher->modname);
 
66
+    cb (dev->secondary_cipher->cipher->modname, data);
 
67
   if (dev->essiv_cipher)
 
68
-    cb (dev->essiv_cipher->cipher->modname);
 
69
+    cb (dev->essiv_cipher->cipher->modname, data);
 
70
   if (dev->hash)
 
71
-    cb (dev->hash->modname);
 
72
+    cb (dev->hash->modname, data);
 
73
   if (dev->essiv_hash)
 
74
-    cb (dev->essiv_hash->modname);
 
75
+    cb (dev->essiv_hash->modname, data);
 
76
   if (dev->iv_hash)
 
77
-    cb (dev->iv_hash->modname);
 
78
+    cb (dev->iv_hash->modname, data);
 
79
 }
 
80
 
 
81
 const char *
 
82
diff --git a/grub-core/disk/diskfilter.c b/grub-core/disk/diskfilter.c
 
83
index 28b70c6..e8a3bcb 100644
 
84
--- a/grub-core/disk/diskfilter.c
 
85
+++ b/grub-core/disk/diskfilter.c
 
86
@@ -354,7 +354,8 @@ grub_diskfilter_memberlist (grub_disk_t disk)
 
87
 
 
88
 void
 
89
 grub_diskfilter_get_partmap (grub_disk_t disk,
 
90
-                            void (*cb) (const char *pm))
 
91
+                            void (*cb) (const char *pm, void *data),
 
92
+                            void *data)
 
93
 {
 
94
   struct grub_diskfilter_lv *lv = disk->data;
 
95
   struct grub_diskfilter_pv *pv;
 
96
@@ -376,7 +377,7 @@ grub_diskfilter_get_partmap (grub_disk_t disk,
 
97
            continue;
 
98
          }
 
99
        for (s = 0; pv->partmaps[s]; s++)
 
100
-         cb (pv->partmaps[s]);
 
101
+         cb (pv->partmaps[s], data);
 
102
       }
 
103
 }
 
104
 
 
105
diff --git a/include/grub/cryptodisk.h b/include/grub/cryptodisk.h
 
106
index 66f3e1e..f2ad2a7 100644
 
107
--- a/include/grub/cryptodisk.h
 
108
+++ b/include/grub/cryptodisk.h
 
109
@@ -145,7 +145,8 @@ grub_cryptodisk_cheat_insert (grub_cryptodisk_t newdev, const char *name,
 
110
                              grub_disk_t source, const char *cheat);
 
111
 void
 
112
 grub_util_cryptodisk_get_abstraction (grub_disk_t disk,
 
113
-                                     void (*cb) (const char *val));
 
114
+                                     void (*cb) (const char *val, void *data),
 
115
+                                     void *data);
 
116
 
 
117
 char *
 
118
 grub_util_get_geli_uuid (const char *dev);
 
119
diff --git a/include/grub/diskfilter.h b/include/grub/diskfilter.h
 
120
index 042fe04..1aedcd3 100644
 
121
--- a/include/grub/diskfilter.h
 
122
+++ b/include/grub/diskfilter.h
 
123
@@ -202,7 +202,8 @@ grub_diskfilter_get_pv_from_disk (grub_disk_t disk,
 
124
                                  struct grub_diskfilter_vg **vg);
 
125
 void
 
126
 grub_diskfilter_get_partmap (grub_disk_t disk,
 
127
-                            void (*cb) (const char *val));
 
128
+                            void (*cb) (const char *val, void *data),
 
129
+                            void *data);
 
130
 #endif
 
131
 
 
132
 #endif /* ! GRUB_RAID_H */
 
133
diff --git a/util/grub-install.c b/util/grub-install.c
 
134
index f6a70dd..34f3db2 100644
 
135
--- a/util/grub-install.c
 
136
+++ b/util/grub-install.c
 
137
@@ -402,7 +402,7 @@ probe_raid_level (grub_disk_t disk)
 
138
 }
 
139
 
 
140
 static void
 
141
-push_partmap_module (const char *map)
 
142
+push_partmap_module (const char *map, void *data __attribute__ ((unused)))
 
143
 {
 
144
   char buf[50];
 
145
 
 
146
@@ -417,6 +417,12 @@ push_partmap_module (const char *map)
 
147
 }
 
148
 
 
149
 static void
 
150
+push_cryptodisk_module (const char *mod, void *data __attribute__ ((unused)))
 
151
+{
 
152
+  grub_install_push_module (mod);
 
153
+}
 
154
+
 
155
+static void
 
156
 probe_mods (grub_disk_t disk)
 
157
 {
 
158
   grub_partition_t part;
 
159
@@ -427,11 +433,11 @@ probe_mods (grub_disk_t disk)
 
160
     grub_util_info ("no partition map found for %s", disk->name);
 
161
 
 
162
   for (part = disk->partition; part; part = part->parent)
 
163
-    push_partmap_module (part->partmap->name);
 
164
+    push_partmap_module (part->partmap->name, NULL);
 
165
 
 
166
   if (disk->dev->id == GRUB_DISK_DEVICE_DISKFILTER_ID)
 
167
     {
 
168
-      grub_diskfilter_get_partmap (disk, push_partmap_module);
 
169
+      grub_diskfilter_get_partmap (disk, push_partmap_module, NULL);
 
170
       have_abstractions = 1;
 
171
     }
 
172
 
 
173
@@ -447,7 +453,7 @@ probe_mods (grub_disk_t disk)
 
174
   if (disk->dev->id == GRUB_DISK_DEVICE_CRYPTODISK_ID)
 
175
     {
 
176
       grub_util_cryptodisk_get_abstraction (disk,
 
177
-                                           grub_install_push_module);
 
178
+                                           push_cryptodisk_module, NULL);
 
179
       have_abstractions = 1;
 
180
       have_cryptodisk = 1;
 
181
     }
 
182
diff --git a/util/grub-probe.c b/util/grub-probe.c
 
183
index 1f3b59f..e4b5729 100644
 
184
--- a/util/grub-probe.c
 
185
+++ b/util/grub-probe.c
 
186
@@ -130,13 +130,14 @@ get_targets_string (void)
 
187
 }
 
188
 
 
189
 static void
 
190
-do_print (const char *x)
 
191
+do_print (const char *x, void *data)
 
192
 {
 
193
-  grub_printf ("%s ", x);
 
194
+  char delim = *(const char *) data;
 
195
+  grub_printf ("%s%c", x, delim);
 
196
 }
 
197
 
 
198
 static void
 
199
-probe_partmap (grub_disk_t disk)
 
200
+probe_partmap (grub_disk_t disk, char delim)
 
201
 {
 
202
   grub_partition_t part;
 
203
   grub_disk_memberlist_t list = NULL, tmp;
 
204
@@ -147,10 +148,10 @@ probe_partmap (grub_disk_t disk)
 
205
     }
 
206
 
 
207
   for (part = disk->partition; part; part = part->parent)
 
208
-    printf ("%s ", part->partmap->name);
 
209
+    printf ("%s%c", part->partmap->name, delim);
 
210
 
 
211
   if (disk->dev->id == GRUB_DISK_DEVICE_DISKFILTER_ID)
 
212
-    grub_diskfilter_get_partmap (disk, do_print);
 
213
+    grub_diskfilter_get_partmap (disk, do_print, &delim);
 
214
 
 
215
   /* In case of LVM/RAID, check the member devices as well.  */
 
216
   if (disk->dev->memberlist)
 
217
@@ -159,7 +160,7 @@ probe_partmap (grub_disk_t disk)
 
218
     }
 
219
   while (list)
 
220
     {
 
221
-      probe_partmap (list->disk);
 
222
+      probe_partmap (list->disk, delim);
 
223
       tmp = list->next;
 
224
       free (list);
 
225
       list = tmp;
 
226
@@ -167,7 +168,7 @@ probe_partmap (grub_disk_t disk)
 
227
 }
 
228
 
 
229
 static void
 
230
-probe_cryptodisk_uuid (grub_disk_t disk)
 
231
+probe_cryptodisk_uuid (grub_disk_t disk, char delim)
 
232
 {
 
233
   grub_disk_memberlist_t list = NULL, tmp;
 
234
 
 
235
@@ -178,7 +179,7 @@ probe_cryptodisk_uuid (grub_disk_t disk)
 
236
     }
 
237
   while (list)
 
238
     {
 
239
-      probe_cryptodisk_uuid (list->disk);
 
240
+      probe_cryptodisk_uuid (list->disk, delim);
 
241
       tmp = list->next;
 
242
       free (list);
 
243
       list = tmp;
 
244
@@ -186,7 +187,7 @@ probe_cryptodisk_uuid (grub_disk_t disk)
 
245
   if (disk->dev->id == GRUB_DISK_DEVICE_CRYPTODISK_ID)
 
246
     {
 
247
       const char *uu = grub_util_cryptodisk_get_uuid (disk);
 
248
-      grub_printf ("%s ", uu);
 
249
+      grub_printf ("%s%c", uu, delim);
 
250
     }
 
251
 }
 
252
 
 
253
@@ -210,7 +211,7 @@ probe_raid_level (grub_disk_t disk)
 
254
 }
 
255
 
 
256
 static void
 
257
-probe_abstraction (grub_disk_t disk)
 
258
+probe_abstraction (grub_disk_t disk, char delim)
 
259
 {
 
260
   grub_disk_memberlist_t list = NULL, tmp;
 
261
   int raid_level;
 
262
@@ -219,7 +220,7 @@ probe_abstraction (grub_disk_t disk)
 
263
     list = disk->dev->memberlist (disk);
 
264
   while (list)
 
265
     {
 
266
-      probe_abstraction (list->disk);
 
267
+      probe_abstraction (list->disk, delim);
 
268
 
 
269
       tmp = list->next;
 
270
       free (list);
 
271
@@ -229,26 +230,26 @@ probe_abstraction (grub_disk_t disk)
 
272
   if (disk->dev->id == GRUB_DISK_DEVICE_DISKFILTER_ID
 
273
       && (grub_memcmp (disk->name, "lvm/", sizeof ("lvm/") - 1) == 0 ||
 
274
          grub_memcmp (disk->name, "lvmid/", sizeof ("lvmid/") - 1) == 0))
 
275
-    printf ("lvm ");
 
276
+    printf ("lvm%c", delim);
 
277
 
 
278
   if (disk->dev->id == GRUB_DISK_DEVICE_DISKFILTER_ID
 
279
       && grub_memcmp (disk->name, "ldm/", sizeof ("ldm/") - 1) == 0)
 
280
-    printf ("ldm ");
 
281
+    printf ("ldm%c", delim);
 
282
 
 
283
   if (disk->dev->id == GRUB_DISK_DEVICE_CRYPTODISK_ID)
 
284
-    grub_util_cryptodisk_get_abstraction (disk, do_print);
 
285
+    grub_util_cryptodisk_get_abstraction (disk, do_print, &delim);
 
286
 
 
287
   raid_level = probe_raid_level (disk);
 
288
   if (raid_level >= 0)
 
289
     {
 
290
-      printf ("diskfilter ");
 
291
+      printf ("diskfilter%c", delim);
 
292
       if (disk->dev->raidname)
 
293
-       printf ("%s ", disk->dev->raidname (disk));
 
294
+       printf ("%s%c", disk->dev->raidname (disk), delim);
 
295
     }
 
296
   if (raid_level == 5)
 
297
-    printf ("raid5rec ");
 
298
+    printf ("raid5rec%c", delim);
 
299
   if (raid_level == 6)
 
300
-    printf ("raid6rec ");
 
301
+    printf ("raid6rec%c", delim);
 
302
 }
 
303
 
 
304
 static void
 
305
@@ -630,16 +631,14 @@ probe (const char *path, char **device_names, char delim)
 
306
 
 
307
       if (print == PRINT_ABSTRACTION)
 
308
        {
 
309
-         probe_abstraction (dev->disk);
 
310
-         putchar (delim);
 
311
+         probe_abstraction (dev->disk, delim);
 
312
          grub_device_close (dev);
 
313
          continue;
 
314
        }
 
315
 
 
316
       if (print == PRINT_CRYPTODISK_UUID)
 
317
        {
 
318
-         probe_cryptodisk_uuid (dev->disk);
 
319
-         putchar (delim);
 
320
+         probe_cryptodisk_uuid (dev->disk, delim);
 
321
          grub_device_close (dev);
 
322
          continue;
 
323
        }
 
324
@@ -647,8 +646,7 @@ probe (const char *path, char **device_names, char delim)
 
325
       if (print == PRINT_PARTMAP)
 
326
        {
 
327
          /* Check if dev->disk itself is contained in a partmap.  */
 
328
-         probe_partmap (dev->disk);
 
329
-         putchar (delim);
 
330
+         probe_partmap (dev->disk, delim);
 
331
          grub_device_close (dev);
 
332
          continue;
 
333
        }