This commit is contained in:
Tobias Powalowski 2013-08-05 16:03:28 +00:00
parent 44ab6eda60
commit 7747868269
2 changed files with 60 additions and 4 deletions

View File

@ -2,7 +2,7 @@
# Maintainer : Ronald van Haren <ronald.archlinux.org> # Maintainer : Ronald van Haren <ronald.archlinux.org>
# Contributor: Keshav Padram (the.ridikulus.rat) (aatt) (gemmaeiil) (ddoott) (ccoomm)> # Contributor: Keshav Padram (the.ridikulus.rat) (aatt) (gemmaeiil) (ddoott) (ccoomm)>
_GRUB_BZR_REV="5043" _GRUB_BZR_REV="5086"
## grub-extras lua and gpxe fail to build with grub bzr rev 5043 ## grub-extras lua and gpxe fail to build with grub bzr rev 5043
@ -12,7 +12,7 @@ _GRUB_BZR_REV="5043"
pkgname=grub pkgname=grub
pkgdesc="GNU GRand Unified Bootloader (2)" pkgdesc="GNU GRand Unified Bootloader (2)"
pkgver=2.00.${_GRUB_BZR_REV} pkgver=2.00.${_GRUB_BZR_REV}
pkgrel=4 pkgrel=1
url="https://www.gnu.org/software/grub/" url="https://www.gnu.org/software/grub/"
arch=('x86_64' 'i686') arch=('x86_64' 'i686')
license=('GPL3') license=('GPL3')
@ -41,17 +41,18 @@ source=("grub-${pkgver}::bzr+bzr://bzr.savannah.gnu.org/grub/trunk/grub/#revisio
'60_memtest86+' '60_memtest86+'
'grub.default' 'grub.default'
'grub.cfg' 'grub.cfg'
'grub-2.00-mkinitcpio-0.15.patch') 'grub-2.00-mkinitcpio-0.15.patch'
'grub-2.00.5086-fix-lvm-parsing.patch')
md5sums=('SKIP' md5sums=('SKIP'
'ee1262cc4e20031df019779b1a4b1e39' 'ee1262cc4e20031df019779b1a4b1e39'
'be55eabc102f2c60b38ed35c203686d6' 'be55eabc102f2c60b38ed35c203686d6'
'a03ffd56324520393bf574cefccb893d' 'a03ffd56324520393bf574cefccb893d'
'c8b9511586d57d6f2524ae7898397a46' 'c8b9511586d57d6f2524ae7898397a46'
'd25d2dcf8ba708dcf768fcaea799f59c' 'd25d2dcf8ba708dcf768fcaea799f59c'
'7a0ce6aa4a23fa12e1f79ab03fe63f88'
'SKIP' 'SKIP'
'SKIP') 'SKIP')
for _DIR_ in 915resolution ntldr-img ; do for _DIR_ in 915resolution ntldr-img ; do
source+=("grub-extras-${_DIR_}::bzr+bzr://bzr.savannah.gnu.org/grub-extras/${_DIR_}/#revision=") source+=("grub-extras-${_DIR_}::bzr+bzr://bzr.savannah.gnu.org/grub-extras/${_DIR_}/#revision=")
done done
@ -59,6 +60,7 @@ done
prepare() { prepare() {
cd "${srcdir}/grub-${pkgver}" cd "${srcdir}/grub-${pkgver}"
patch -Np0 -i "${srcdir}/grub-2.00-mkinitcpio-0.15.patch" patch -Np0 -i "${srcdir}/grub-2.00-mkinitcpio-0.15.patch"
patch -Np1 -i "${srcdir}/grub-2.00.5086-fix-lvm-parsing.patch"
} }
_build_grub-common_and_bios() { _build_grub-common_and_bios() {

View File

@ -0,0 +1,54 @@
There is no explicit option to turn off alignment; it is implicitly
disabled if one of --separator or --nameprefixes option is used.
--separator was added in 2007, --nameprefixes - in 2009. So let's use
--separator to extend range of versions we are compatible with. Note that
one or another must be used, current parsing is broken otherwise.
Signed-off-by: Andrey Borzenkov <address@hidden>
---
util/getroot.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/util/getroot.c b/util/getroot.c
index 2ad8a55..3afcf96 100644
--- a/util/getroot.c
+++ b/util/getroot.c
@@ -1322,7 +1322,7 @@ grub_util_get_dev_abstraction (const char *os_dev)
static void
pull_lvm_by_command (const char *os_dev)
{
- char *argv[6];
+ char *argv[8];
int fd;
pid_t pid;
FILE *mdadm;
@@ -1351,12 +1351,17 @@ pull_lvm_by_command (const char *os_dev)
/* execvp has inconvenient types, hence the casts. None of these
strings will actually be modified. */
+ /* by default PV name is left aligned in 10 character field, meaning that
+ we do not know where name ends. Using dummy --separator disables
+ alignment. We have a single field, so separator itself is not output */
argv[0] = (char *) "vgs";
argv[1] = (char *) "--options";
argv[2] = (char *) "pv_name";
argv[3] = (char *) "--noheadings";
- argv[4] = vgname;
- argv[5] = NULL;
+ argv[4] = (char *) "--separator";
+ argv[5] = (char *) ":";
+ argv[6] = vgname;
+ argv[7] = NULL;
pid = exec_pipe (argv, &fd);
free (vgname);
@@ -1376,6 +1381,7 @@ pull_lvm_by_command (const char *os_dev)
while (getline (&buf, &len, mdadm) > 0)
{
char *ptr;
+ /* LVM adds two spaces as standard prefix */
for (ptr = buf; ptr < buf + 2 && *ptr == ' '; ptr++);
if (*ptr == '\0')
continue;