Fix partmap, cryptodisk, and abstraction handling in grub-mkconfig.

Commit 588744d0dc caused grub-mkconfig
no longer to be forgiving of trailing spaces on grub-probe output
lines, which among other things means that util/grub.d/10_linux.in
no longer detects LVM.  To fix this, make grub-probe's output
delimiting more consistent.  As a bonus, this improves the coverage
of the -0 option.

Fixes Debian bug #735935.

* grub-core/disk/cryptodisk.c
(grub_util_cryptodisk_get_abstraction): Add a user-data argument.
* grub-core/disk/diskfilter.c (grub_diskfilter_get_partmap):
Likewise.
* include/grub/cryptodisk.h (grub_util_cryptodisk_get_abstraction):
Update prototype.
* include/grub/diskfilter.h (grub_diskfilter_get_partmap): Likewise.
* util/grub-install.c (push_partmap_module, push_cryptodisk_module,
probe_mods): Adjust for extra user-data arguments.
* util/grub-probe.c (do_print, probe_partmap, probe_cryptodisk_uuid,
probe_abstraction): Use configured delimiter.  Update callers.
This commit is contained in:
Colin Watson 2014-03-31 14:48:33 +01:00
parent 9b35fe819f
commit 24024dac7f
7 changed files with 74 additions and 41 deletions

View file

@ -762,25 +762,26 @@ grub_cryptodisk_cheat_insert (grub_cryptodisk_t newdev, const char *name,
void
grub_util_cryptodisk_get_abstraction (grub_disk_t disk,
void (*cb) (const char *val))
void (*cb) (const char *val, void *data),
void *data)
{
grub_cryptodisk_t dev = (grub_cryptodisk_t) disk->data;
cb ("cryptodisk");
cb (dev->modname);
cb ("cryptodisk", data);
cb (dev->modname, data);
if (dev->cipher)
cb (dev->cipher->cipher->modname);
cb (dev->cipher->cipher->modname, data);
if (dev->secondary_cipher)
cb (dev->secondary_cipher->cipher->modname);
cb (dev->secondary_cipher->cipher->modname, data);
if (dev->essiv_cipher)
cb (dev->essiv_cipher->cipher->modname);
cb (dev->essiv_cipher->cipher->modname, data);
if (dev->hash)
cb (dev->hash->modname);
cb (dev->hash->modname, data);
if (dev->essiv_hash)
cb (dev->essiv_hash->modname);
cb (dev->essiv_hash->modname, data);
if (dev->iv_hash)
cb (dev->iv_hash->modname);
cb (dev->iv_hash->modname, data);
}
const char *

View file

@ -354,7 +354,8 @@ grub_diskfilter_memberlist (grub_disk_t disk)
void
grub_diskfilter_get_partmap (grub_disk_t disk,
void (*cb) (const char *pm))
void (*cb) (const char *pm, void *data),
void *data)
{
struct grub_diskfilter_lv *lv = disk->data;
struct grub_diskfilter_pv *pv;
@ -376,7 +377,7 @@ grub_diskfilter_get_partmap (grub_disk_t disk,
continue;
}
for (s = 0; pv->partmaps[s]; s++)
cb (pv->partmaps[s]);
cb (pv->partmaps[s], data);
}
}