Fix failures with grub 2.00~beta2 and 8.10, and add a test case.

https://bugzilla.redhat.com/show_bug.cgi?id=805310
Update version to 8.11
Preserve "trailing indentation" when splitting line elements (#742720)
Pick the last / device (#826537)

When there are multiple devices mounted on /, as there can
be during a preupgrade, the last device is the one that should
match the grub.cfg entry. This was preventing preupgrade from
installing the new f17 kernel.

Related: rhbz#820340
Related: rhbz#820351
Update version to 8.12
Support UBOOT_IMGADDR override

Support UBOOT_IMGADDR override

Signed-off-by: Brendan <blc@redhat.com>
Add "const" specifier to function arguments

Functions addNewKernel() and getInitrdVal() do not modify their arguments,
so it is safe to mark them as "const". Also, the compiler can make extra
checks and optimizations this way.
Avoid string duplication calling dirname()

The dirname() function does not modify its argument, so it is uneeded to
duplicate the string passed to it.
Convert to c99 loop initializations.
Update the ubootDir default.

 Make "/boot" the default uboot directory.
 Make the kernel version an exact match to
 avoid removing the wrong uImage and
 uInitrd files, in case the baseline
 kernel is installed.

Signed-off-by: David A. Marlin <dmarlin@redhat.com>
Update the code to set the ubootAddress.

Add support for IMX-based systems.
Use regular expression pattern matching to improve flexibility.
Allow the machine value to be defaulted.

Signed-off-by: David A. Marlin <dmarlin@redhat.com>
Support systems that do not have /boot as a separate filesystem

While testing grubby on systems with a root (/) filesystem that includes
the /boot directory, it was noticed that grubby displayed the prefix (/boot)
twice.  This patch prevents printing the prefix twice on kernel and initrd
lines.

This situation was found while testing the patch "Fix for grub on SuSE
systems: lba and boot information", so this fix is also covered by the
the test on patch "Fix for grub on SuSE systems: test lba and boot info".

Signed-off-by: Cleber Rosa <crosa@redhat.com>
Fix for grub on SuSE systems: lba and boot information

This patch adds code that gets lba and boot device information on
SuSE systems, which is done by looking at the commands that were
used to install grub on that system, and match information with
grub's device.map file.

Changes from v1:
 * Fixes for issues pointed by Peter Jones <pjones@redhat.com>
 * Add support for specifying paths for SuSE configuration files
   on environment variables, to make it possible to test this

Signed-off-by: Cleber Rosa <crosa@redhat.com>
Invert "isSuseSystem()" test so the suse code is nearer the test.
Fix grub detection on SuSE systems: config file order

SuSE sytems ship with a /etc/grub.conf that is not your regular grub
configuration file, but instead a sequence of grub commands. Example:

setup --stage2=/boot/grub/stage2 --force-lba (hd0,1) (hd0,1)
quit

Because of that, the parsing of the config fails. So, try to first
use the grub config file at /boot/grub/menu.lst.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
ppc64/yaboot: add support for probing the currently installed bootloader

Changes from v1:
 * Settled on simplistic check for yaboot, but left comment on how to
   do an installation check.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
ia64/elilo: add support for probing the currently installed bootloader

Signed-off-by: Cleber Rosa <crosa@redhat.com>
Fix minor style issue.
test.sh: revert bash 4 only syntax change

The "|&" syntax is bash version 4 specific, and thus fails on
systems running older versions. This change was introduced by
commit af5a11b0051e53a33e20ecac0b8d73da8d33348c.

Tested on RHEL 5 system with bash-3.2-32.el5.

Signed-off-by: Cleber Rosa <crosa@redhat.com>
test.sh: enable the use of MALLOC_PERTURB_

MALLOC_CHECK_ is already set, so MALLOC_PERTURB_ makes a nice complement
to it.

For more info on MALLOC_PERTURB_: http://udrepper.livejournal.com/11429.html

Signed-off-by: Cleber Rosa <crosa@redhat.com>