Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 522428 | Differences between
and this patch

Collapse All | Expand All

(-)a/grub-core/disk/cryptodisk.c (-9 / +10 lines)
Lines 762-786 grub_cryptodisk_cheat_insert (grub_cryptodisk_t newdev, const char *name, Link Here
762
762
763
void
763
void
764
grub_util_cryptodisk_get_abstraction (grub_disk_t disk,
764
grub_util_cryptodisk_get_abstraction (grub_disk_t disk,
765
				      void (*cb) (const char *val))
765
				      void (*cb) (const char *val, void *data),
766
				      void *data)
766
{
767
{
767
  grub_cryptodisk_t dev = (grub_cryptodisk_t) disk->data;
768
  grub_cryptodisk_t dev = (grub_cryptodisk_t) disk->data;
768
769
769
  cb ("cryptodisk");
770
  cb ("cryptodisk", data);
770
  cb (dev->modname);
771
  cb (dev->modname, data);
771
772
772
  if (dev->cipher)
773
  if (dev->cipher)
773
    cb (dev->cipher->cipher->modname);
774
    cb (dev->cipher->cipher->modname, data);
774
  if (dev->secondary_cipher)
775
  if (dev->secondary_cipher)
775
    cb (dev->secondary_cipher->cipher->modname);
776
    cb (dev->secondary_cipher->cipher->modname, data);
776
  if (dev->essiv_cipher)
777
  if (dev->essiv_cipher)
777
    cb (dev->essiv_cipher->cipher->modname);
778
    cb (dev->essiv_cipher->cipher->modname, data);
778
  if (dev->hash)
779
  if (dev->hash)
779
    cb (dev->hash->modname);
780
    cb (dev->hash->modname, data);
780
  if (dev->essiv_hash)
781
  if (dev->essiv_hash)
781
    cb (dev->essiv_hash->modname);
782
    cb (dev->essiv_hash->modname, data);
782
  if (dev->iv_hash)
783
  if (dev->iv_hash)
783
    cb (dev->iv_hash->modname);
784
    cb (dev->iv_hash->modname, data);
784
}
785
}
785
786
786
const char *
787
const char *
(-)a/grub-core/disk/diskfilter.c (-2 / +3 lines)
Lines 354-360 grub_diskfilter_memberlist (grub_disk_t disk) Link Here
354
354
355
void
355
void
356
grub_diskfilter_get_partmap (grub_disk_t disk,
356
grub_diskfilter_get_partmap (grub_disk_t disk,
357
			     void (*cb) (const char *pm))
357
			     void (*cb) (const char *pm, void *data),
358
			     void *data)
358
{
359
{
359
  struct grub_diskfilter_lv *lv = disk->data;
360
  struct grub_diskfilter_lv *lv = disk->data;
360
  struct grub_diskfilter_pv *pv;
361
  struct grub_diskfilter_pv *pv;
Lines 376-382 grub_diskfilter_get_partmap (grub_disk_t disk, Link Here
376
	    continue;
377
	    continue;
377
	  }
378
	  }
378
	for (s = 0; pv->partmaps[s]; s++)
379
	for (s = 0; pv->partmaps[s]; s++)
379
	  cb (pv->partmaps[s]);
380
	  cb (pv->partmaps[s], data);
380
      }
381
      }
381
}
382
}
382
383
(-)a/include/grub/cryptodisk.h (-1 / +2 lines)
Lines 145-151 grub_cryptodisk_cheat_insert (grub_cryptodisk_t newdev, const char *name, Link Here
145
			      grub_disk_t source, const char *cheat);
145
			      grub_disk_t source, const char *cheat);
146
void
146
void
147
grub_util_cryptodisk_get_abstraction (grub_disk_t disk,
147
grub_util_cryptodisk_get_abstraction (grub_disk_t disk,
148
				      void (*cb) (const char *val));
148
				      void (*cb) (const char *val, void *data),
149
				      void *data);
149
150
150
char *
151
char *
151
grub_util_get_geli_uuid (const char *dev);
152
grub_util_get_geli_uuid (const char *dev);
(-)a/include/grub/diskfilter.h (-1 / +2 lines)
Lines 202-208 grub_diskfilter_get_pv_from_disk (grub_disk_t disk, Link Here
202
				  struct grub_diskfilter_vg **vg);
202
				  struct grub_diskfilter_vg **vg);
203
void
203
void
204
grub_diskfilter_get_partmap (grub_disk_t disk,
204
grub_diskfilter_get_partmap (grub_disk_t disk,
205
			     void (*cb) (const char *val));
205
			     void (*cb) (const char *val, void *data),
206
			     void *data);
206
#endif
207
#endif
207
208
208
#endif /* ! GRUB_RAID_H */
209
#endif /* ! GRUB_RAID_H */
(-)a/util/grub-install.c (-4 / +10 lines)
Lines 387-393 probe_raid_level (grub_disk_t disk) Link Here
387
}
387
}
388
388
389
static void
389
static void
390
push_partmap_module (const char *map)
390
push_partmap_module (const char *map, void *data __attribute__ ((unused)))
391
{
391
{
392
  char buf[50];
392
  char buf[50];
393
393
Lines 402-407 push_partmap_module (const char *map) Link Here
402
}
402
}
403
403
404
static void
404
static void
405
push_cryptodisk_module (const char *mod, void *data __attribute__ ((unused)))
406
{
407
  grub_install_push_module (mod);
408
}
409
410
static void
405
probe_mods (grub_disk_t disk)
411
probe_mods (grub_disk_t disk)
406
{
412
{
407
  grub_partition_t part;
413
  grub_partition_t part;
Lines 412-422 probe_mods (grub_disk_t disk) Link Here
412
    grub_util_info ("no partition map found for %s", disk->name);
418
    grub_util_info ("no partition map found for %s", disk->name);
413
419
414
  for (part = disk->partition; part; part = part->parent)
420
  for (part = disk->partition; part; part = part->parent)
415
    push_partmap_module (part->partmap->name);
421
    push_partmap_module (part->partmap->name, NULL);
416
422
417
  if (disk->dev->id == GRUB_DISK_DEVICE_DISKFILTER_ID)
423
  if (disk->dev->id == GRUB_DISK_DEVICE_DISKFILTER_ID)
418
    {
424
    {
419
      grub_diskfilter_get_partmap (disk, push_partmap_module);
425
      grub_diskfilter_get_partmap (disk, push_partmap_module, NULL);
420
      have_abstractions = 1;
426
      have_abstractions = 1;
421
    }
427
    }
422
428
Lines 432-438 probe_mods (grub_disk_t disk) Link Here
432
  if (disk->dev->id == GRUB_DISK_DEVICE_CRYPTODISK_ID)
438
  if (disk->dev->id == GRUB_DISK_DEVICE_CRYPTODISK_ID)
433
    {
439
    {
434
      grub_util_cryptodisk_get_abstraction (disk,
440
      grub_util_cryptodisk_get_abstraction (disk,
435
					    grub_install_push_module);
441
					    push_cryptodisk_module, NULL);
436
      have_abstractions = 1;
442
      have_abstractions = 1;
437
      have_cryptodisk = 1;
443
      have_cryptodisk = 1;
438
    }
444
    }
(-)a/util/grub-probe.c (-25 / +22 lines)
Lines 130-142 get_targets_string (void) Link Here
130
}
130
}
131
131
132
static void
132
static void
133
do_print (const char *x)
133
do_print (const char *x, void *data)
134
{
134
{
135
  grub_printf ("%s ", x);
135
  char delim = *(const char *) data;
136
  grub_printf ("%s%c", x, delim);
136
}
137
}
137
138
138
static void
139
static void
139
probe_partmap (grub_disk_t disk)
140
probe_partmap (grub_disk_t disk, char delim)
140
{
141
{
141
  grub_partition_t part;
142
  grub_partition_t part;
142
  grub_disk_memberlist_t list = NULL, tmp;
143
  grub_disk_memberlist_t list = NULL, tmp;
Lines 147-156 probe_partmap (grub_disk_t disk) Link Here
147
    }
148
    }
148
149
149
  for (part = disk->partition; part; part = part->parent)
150
  for (part = disk->partition; part; part = part->parent)
150
    printf ("%s ", part->partmap->name);
151
    printf ("%s%c", part->partmap->name, delim);
151
152
152
  if (disk->dev->id == GRUB_DISK_DEVICE_DISKFILTER_ID)
153
  if (disk->dev->id == GRUB_DISK_DEVICE_DISKFILTER_ID)
153
    grub_diskfilter_get_partmap (disk, do_print);
154
    grub_diskfilter_get_partmap (disk, do_print, &delim);
154
155
155
  /* In case of LVM/RAID, check the member devices as well.  */
156
  /* In case of LVM/RAID, check the member devices as well.  */
156
  if (disk->dev->memberlist)
157
  if (disk->dev->memberlist)
Lines 159-165 probe_partmap (grub_disk_t disk) Link Here
159
    }
160
    }
160
  while (list)
161
  while (list)
161
    {
162
    {
162
      probe_partmap (list->disk);
163
      probe_partmap (list->disk, delim);
163
      tmp = list->next;
164
      tmp = list->next;
164
      free (list);
165
      free (list);
165
      list = tmp;
166
      list = tmp;
Lines 167-173 probe_partmap (grub_disk_t disk) Link Here
167
}
168
}
168
169
169
static void
170
static void
170
probe_cryptodisk_uuid (grub_disk_t disk)
171
probe_cryptodisk_uuid (grub_disk_t disk, char delim)
171
{
172
{
172
  grub_disk_memberlist_t list = NULL, tmp;
173
  grub_disk_memberlist_t list = NULL, tmp;
173
174
Lines 178-184 probe_cryptodisk_uuid (grub_disk_t disk) Link Here
178
    }
179
    }
179
  while (list)
180
  while (list)
180
    {
181
    {
181
      probe_cryptodisk_uuid (list->disk);
182
      probe_cryptodisk_uuid (list->disk, delim);
182
      tmp = list->next;
183
      tmp = list->next;
183
      free (list);
184
      free (list);
184
      list = tmp;
185
      list = tmp;
Lines 186-192 probe_cryptodisk_uuid (grub_disk_t disk) Link Here
186
  if (disk->dev->id == GRUB_DISK_DEVICE_CRYPTODISK_ID)
187
  if (disk->dev->id == GRUB_DISK_DEVICE_CRYPTODISK_ID)
187
    {
188
    {
188
      const char *uu = grub_util_cryptodisk_get_uuid (disk);
189
      const char *uu = grub_util_cryptodisk_get_uuid (disk);
189
      grub_printf ("%s ", uu);
190
      grub_printf ("%s%c", uu, delim);
190
    }
191
    }
191
}
192
}
192
193
Lines 210-216 probe_raid_level (grub_disk_t disk) Link Here
210
}
211
}
211
212
212
static void
213
static void
213
probe_abstraction (grub_disk_t disk)
214
probe_abstraction (grub_disk_t disk, char delim)
214
{
215
{
215
  grub_disk_memberlist_t list = NULL, tmp;
216
  grub_disk_memberlist_t list = NULL, tmp;
216
  int raid_level;
217
  int raid_level;
Lines 219-225 probe_abstraction (grub_disk_t disk) Link Here
219
    list = disk->dev->memberlist (disk);
220
    list = disk->dev->memberlist (disk);
220
  while (list)
221
  while (list)
221
    {
222
    {
222
      probe_abstraction (list->disk);
223
      probe_abstraction (list->disk, delim);
223
224
224
      tmp = list->next;
225
      tmp = list->next;
225
      free (list);
226
      free (list);
Lines 229-254 probe_abstraction (grub_disk_t disk) Link Here
229
  if (disk->dev->id == GRUB_DISK_DEVICE_DISKFILTER_ID
230
  if (disk->dev->id == GRUB_DISK_DEVICE_DISKFILTER_ID
230
      && (grub_memcmp (disk->name, "lvm/", sizeof ("lvm/") - 1) == 0 ||
231
      && (grub_memcmp (disk->name, "lvm/", sizeof ("lvm/") - 1) == 0 ||
231
	  grub_memcmp (disk->name, "lvmid/", sizeof ("lvmid/") - 1) == 0))
232
	  grub_memcmp (disk->name, "lvmid/", sizeof ("lvmid/") - 1) == 0))
232
    printf ("lvm ");
233
    printf ("lvm%c", delim);
233
234
234
  if (disk->dev->id == GRUB_DISK_DEVICE_DISKFILTER_ID
235
  if (disk->dev->id == GRUB_DISK_DEVICE_DISKFILTER_ID
235
      && grub_memcmp (disk->name, "ldm/", sizeof ("ldm/") - 1) == 0)
236
      && grub_memcmp (disk->name, "ldm/", sizeof ("ldm/") - 1) == 0)
236
    printf ("ldm ");
237
    printf ("ldm%c", delim);
237
238
238
  if (disk->dev->id == GRUB_DISK_DEVICE_CRYPTODISK_ID)
239
  if (disk->dev->id == GRUB_DISK_DEVICE_CRYPTODISK_ID)
239
    grub_util_cryptodisk_get_abstraction (disk, do_print);
240
    grub_util_cryptodisk_get_abstraction (disk, do_print, &delim);
240
241
241
  raid_level = probe_raid_level (disk);
242
  raid_level = probe_raid_level (disk);
242
  if (raid_level >= 0)
243
  if (raid_level >= 0)
243
    {
244
    {
244
      printf ("diskfilter ");
245
      printf ("diskfilter%c", delim);
245
      if (disk->dev->raidname)
246
      if (disk->dev->raidname)
246
	printf ("%s ", disk->dev->raidname (disk));
247
	printf ("%s%c", disk->dev->raidname (disk), delim);
247
    }
248
    }
248
  if (raid_level == 5)
249
  if (raid_level == 5)
249
    printf ("raid5rec ");
250
    printf ("raid5rec%c", delim);
250
  if (raid_level == 6)
251
  if (raid_level == 6)
251
    printf ("raid6rec ");
252
    printf ("raid6rec%c", delim);
252
}
253
}
253
254
254
static void
255
static void
Lines 630-645 probe (const char *path, char **device_names, char delim) Link Here
630
631
631
      if (print == PRINT_ABSTRACTION)
632
      if (print == PRINT_ABSTRACTION)
632
	{
633
	{
633
	  probe_abstraction (dev->disk);
634
	  probe_abstraction (dev->disk, delim);
634
	  putchar (delim);
635
	  grub_device_close (dev);
635
	  grub_device_close (dev);
636
	  continue;
636
	  continue;
637
	}
637
	}
638
638
639
      if (print == PRINT_CRYPTODISK_UUID)
639
      if (print == PRINT_CRYPTODISK_UUID)
640
	{
640
	{
641
	  probe_cryptodisk_uuid (dev->disk);
641
	  probe_cryptodisk_uuid (dev->disk, delim);
642
	  putchar (delim);
643
	  grub_device_close (dev);
642
	  grub_device_close (dev);
644
	  continue;
643
	  continue;
645
	}
644
	}
Lines 647-654 probe (const char *path, char **device_names, char delim) Link Here
647
      if (print == PRINT_PARTMAP)
646
      if (print == PRINT_PARTMAP)
648
	{
647
	{
649
	  /* Check if dev->disk itself is contained in a partmap.  */
648
	  /* Check if dev->disk itself is contained in a partmap.  */
650
	  probe_partmap (dev->disk);
649
	  probe_partmap (dev->disk, delim);
651
	  putchar (delim);
652
	  grub_device_close (dev);
650
	  grub_device_close (dev);
653
	  continue;
651
	  continue;
654
	}
652
	}
655
- 

Return to bug 522428