Commit Graph

9 Commits

Author SHA1 Message Date
Peter Jones a5e56a6e7d
Make grubby-bls sort everything correctly, including spaces.
Related: rhbz#1638103
2018-10-23 15:49:19 +02:00
Javier Martinez Canillas b40ea5be18
grubby-bls: check if entry exists before attempting to print its info
The grubby --info option didn't check if an entry existed for a kernel and
printed wrong information about it. Fix this and also for --update-kernel
and --set-default options that have the same issue.

Resolves: rhbz#1634712

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2018-10-23 15:35:52 +02:00
Javier Martinez Canillas cf425061aa
grubby-bls: set saved_entry to id instead of title on set-default
The grubby wrapper sets the saved_entry in grubenv to the entry title
field since that's done by grubby. But for BLS the id is the filename
without the .conf extension, this saved_entry is set to this when a
new kernel is installed.

So for consistency also use the entry id for the --set-default option.

Related: rhbz#1638103

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2018-10-23 15:35:13 +02:00
Peter Jones 4aa091811b
grubby-bls: make "id" be the filename, and include it in --info=ALL
Related: rhbz#1638103
Signed-off-by: Peter Jones <pjones@redhat.com>
2018-10-23 15:08:30 +02:00
Javier Martinez Canillas 33ab171b28
Print information about the entry set as default by grubby-bls script
This information can be useful for users to know what's the BLS entry
that was set as the default.

Resolves: rhbz#1636180

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2018-10-23 15:06:54 +02:00
Javier Martinez Canillas 28952a66c8
Use ! instead of , as sed delimiter in grubby-bls script
The script uses sed to modify the options field in the BLS entries, but it
is using a ',' character as the sed delimiter. It's total valid to have a
kernel command line parameter that contains that character, for example:

$ grubby --add-kernel=/boot/vmlinuz --args="console=ttyS0,115200n81" \
  --initrd=/boot/initrd.img --make-default --title=install
sed: -e expression #1, char 42: unknown option to `s'

Fix this by using a different delimiter that won't be present in a cmdline.

Resolves: rhbz#1634744

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2018-10-23 15:06:49 +02:00
Javier Martinez Canillas f9880644e6
grubby-bls should only check if kernel exists and not if was installed
When a new BLS entry is added, the script checks if the kernel image exists
and also if it was installed from a rpm package. But the latter isn't really
needed, it should be valid to just copy a kernel image and add a BLS entry.

Resolves: rhbz#1634740

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2018-10-23 15:06:45 +02:00
Javier Martinez Canillas b8c8cdcf6c
Make grubby-bls execute grub2-mkconfig on ppc64
When booting an ppc64 machine on bare-metal (PowerNV) the OPAL firmware
interface is used. The firmware contains the Petitboot boot-loader that
can be used to parse the BootLoaderSpec (BLS) snippets in a BLS setup.

But machines could have an older version of Petitboot that doesn't have
BLS support, so on ppc64 machines can't be assumed that just modifying
the BLS files is enough for those changes to be reflected in the boot
menu. Instead, grub2-mkconfig is executed so the BLS can be parsed and
produce a grub config file that can be used by any Petitboot version.

Resolves: rhbz#1636039

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2018-10-23 15:06:40 +02:00
Javier Martinez Canillas 19db5c489a
Add grubby-bls package
Add a grubby wrapper script that allows to manage BootLoaderSpec files by
using the same command line options supported by the grubby tool. This is
provided for backward compatibility for grubby users that swtich to BLS.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2018-07-13 20:05:41 +02:00