All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dryden Personalis <list@xenhideout.nl>
To: The development of GNU GRUB <grub-devel@gnu.org>
Subject: Re: [PATCH] Install to LVM PVs
Date: Sun, 08 May 2016 19:16:29 +0200	[thread overview]
Message-ID: <f4fb4e60a6b6a1488d919ca9fbae4e44@dds.nl> (raw)
In-Reply-To: <572EFD18.5070009@gmail.com>

Andrei Borzenkov schreef op 08-05-2016 10:47:
> 08.05.2016 09:05, Andrei Borzenkov пишет:
>>> 
>>> +#ifdef GRUB_UTIL
>>> +int
>>> +grub_util_is_lvm(grub_disk_t disk)
>>> +{
>>> +  struct grub_diskfilter_pv_id id;
>>> +  struct grub_diskfilter_vg *vg;
>>> +  grub_disk_addr_t start_sector;
>>> +  vg = grub_lvm_detect(disk, &id, &start_sector);
>>> +  if (! vg)
>>> +    return 0;
>>> +  /* don't free the vg, it's held by grub_diskfilter_vg_register */
>>> +  grub_free(id.uuid);
>>> +  return 1;
>>> +}
>>> +
>> 
>> This has side effect of adding duplicate VG definitions; this may 
>> later
>> confuse grub. What about just checking array->driver for LVM? Go 
>> through
>> registered arrays, find disk match and check array driver. See
>> scan_disk_partition_iter () for example.
>> 
> 
> Which is basically call grub_diskfilter_get_pv_from_disk() and check
> vg_out->driver.

This method also has the downside that is_lvm will fail without any 
indication as to why, when no volume group has been created. lvm_detect 
will return null because it can only return a VG. And, you cannot error 
out on that if a non-existing LVM should be okay.

So this call to lvm_detect is pretty annoying.

If it had more info, I could at least give an error in setup.c.

I am not sure whether installation is *possible* without a VG but it 
would be odd if it couldn't?

Anyway I would like a better error message on this because I just wasted 
2 hours trying to get GRUB_UTIL to work and failing. That means as per 
your method I can probably distinguish between PV present and VG present 
(or not present).

Then the only way I know how to report back is to give more values to 
is_lvm, but do we need a VG? Why error out on no VG? I will test.


  parent reply	other threads:[~2016-05-08 17:16 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-08  4:53 [PATCH] Install to LVM PVs Dryden Personalis
2016-05-08  6:05 ` Andrei Borzenkov
2016-05-08  8:47   ` Andrei Borzenkov
2016-05-08 13:10     ` Dryden Personalis
2016-05-08 17:16     ` Dryden Personalis [this message]
2016-05-08 17:40       ` Dryden Personalis
2016-05-08 13:01   ` Dryden Personalis
2016-05-09  6:07     ` Andrei Borzenkov
2016-05-09  8:41       ` Dryden Personalis
2016-05-09 16:10       ` Dryden Personalis
2016-05-09 16:18         ` Dryden Personalis
2016-05-09 17:56           ` Dryden Personalis
2016-05-17 18:01       ` Dryden Personalis
2016-05-08  9:23 ` Andrei Borzenkov
2016-05-08 13:09   ` Dryden Personalis
2016-05-09  0:10   ` Xen
2016-05-09  0:10     ` Dryden Personalis
  -- strict thread matches above, loose matches on Subject: below --
2013-09-25 12:39 Gabriel de Perthuis
2013-09-26  8:53 ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-09-27 10:39   ` Gabriel de Perthuis
2013-09-27 10:39     ` Gabriel de Perthuis
2013-09-27 12:48     ` Vladimir 'φ-coder/phcoder' Serbinenko
2013-09-27 13:56       ` Gabriel de Perthuis
2013-09-27 13:56         ` Gabriel de Perthuis
2013-09-27 14:27       ` Andrey Borzenkov
2015-02-15 10:47       ` Andrei Borzenkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f4fb4e60a6b6a1488d919ca9fbae4e44@dds.nl \
    --to=list@xenhideout.nl \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.