The grub2 bootloader expects the BLS linux and initrd fields values to be
set to a relative path to the root of the boot partition and the zipl tool
expects these to be an absolute path to the kernel and initramfs images.
So the grubby wrapper was removing the prefixes from the kernel and initrd
paths before doing any comparision with the BLS fields. But this shouldn't
be done if the /boot directory isn't a mount point.
Resolves: rhbz#1642078
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
- Make the temporary config wrapper be what "grubby" contains, and put
traditional grubby in grubby-deprecated (pjones)
- Re-enable debuginfo generation (pjones)
Related: rhbz#1619344
- Install installkernel-bls here as well, not just in the grub2 package,
since s390x doesn't have grubby packages (pjones)
Related: rhbz#1619344
- Make grubby-bls execute grub2-mkconfig on ppc64
Resolves: rhbz#1636039
- grubby-bls should only check if kernel exists and not if was installed
Resolves: rhbz#1634740
- Use ! instead of , as sed delimiter in grubby-bls script
Resolves: rhbz#1634744
- Print information about the entry set as default
Resolves: rhbz#1636180
- grubby-bls: make "id" be the filename, and include it in --info=ALL (pjones)
Related: rhbz#1638103
- grubby-bls: Make grubby-bls sort everything the same way grub2 does (pjones)
Resolves: rhbz#1638103
- grubby-bls: Consistently use the filename as the bls id
Related: rhbz#1638103
- grubby-bls: check if entry exists before attempting to print its info
Resolves: rhbz#1634712
- grubby-bls: make a copy of the cmdline if is modified for an entry
Resolves: rhbz#1629054
- grubby-bls: escape delimiter character before replacing the options field
Resolves: rhbz#1640017
- grubby-bls: grubby-bls: use id instead of title to get the default entry
Resolves: rhbz#1638103
- grubby-bls: use ~debug instead of -debug as suffix to sort correctly
Related: rhbz#1638103
- grubby-bls: allow to add many BLS entries for the same kernel image
Resolves: rhbz#1634752
- grubby-bls: fix --default-* options for s390x
Resolves: rhbz#1644608
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
The BLS files name convention used is ${MACHINE_ID}-${KERNEL_VERSION}.conf
but this means that there can only be a single entry for a given kernel.
Allow the grubby wrapper to add many entries for the same kernel image,
since the old grubby tool was able to do that. To differentiate from the
original BLS entry and to specify that it's a customized entry, add a
[[:digit:]]~custom suffix after the kernel version number.
This will also sort the custom entries before the original entry, that's
also what the old grubby tool did.
Resolves: rhbz#1634752
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
For the debug BLS entries a -debug suffix was added so they are sorted after
the kernel entries, but that only works with version sort and not rpm sort.
So instead use ~debug prefix so rpm sort algorithm could sort it correctly.
Related: rhbz#1638103
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
The wrapper is using the title before to store the default entry, but we
are now using the entry id for grub2, so make the wrapper query the id.
Resolves: rhbz#1638103
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
The ! character was used as the delimiter, but this doesn't work when the
param uses this character, for example "memmap=1G!1G".
Resolves: rhbz#1640017
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
The BLS entries use a global kernel command line parameters that's set as
kernelopts variable in the grubenv file. But users may want to have custom
parameters for some entries, so make a copy of the current kernelopts and
set the "options" field value to the modified parameters.
Resolves: rhbz#1629054
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
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>
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>
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>
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>
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>
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>
So what's happened here is this:
- we planned on not having the grubby binary in this package at all
anymore
- when we did test builds like that, find-debuginfo.sh broke
- since it was completely inconsequential, we disabled building
debuginfo
- then we re-thought the package layout, and decided to build that
binary anyway, but forgot to turn debuginfo back on
- also we build the binary as -fPIE, which file(1) says is a "shared
object"
- brp-strip does not act on shared objects, so it didn't strip
As a result, rpmdiff noticed our binary was not stripped.
This patch re-enables debuginfo, which will cause our binary to get
stripped, as well as to have the correct debuginfo packages in the
output.
Related: rhbz#1619344
Signed-off-by: Peter Jones <pjones@redhat.com>
We need to cary this in f29 until we have the anaconda patches in and
get grubby out of the default install, so we'll have BLS configs and not
need grubby to update them.
Signed-off-by: Peter Jones <pjones@redhat.com>
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>
When grubby is not installed, the zipl configuration has to be changed
to use the BLS configuration files.
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
By default the grub2-switch-to-blscfg script uses .bak as the suffix for
saved files, but it should use .rpmsave when called from a RPM scriptlet.
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
When grubby is not installed, the GRUB 2 configuration has to be
changed to use the BLS configuration files.
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
- Fix title extraction with some config file types
Resolves: rhbz#1204353
Resolves: rhbz#1204888
Resolves: rhbz#1206943
Signed-off-by: Peter Jones <pjones@redhat.com>
- Fix title extraction with some config file types
Resolves: rhbz#1204353
Resolves: rhbz#1204888
Resolves: rhbz#1206943
Signed-off-by: Peter Jones <pjones@redhat.com>
This apparently interacts poorly with grub2-mkconfig's title generation
and causes weird errors, so it's not ready yet.
This commit also fixes some quoting errors in the dtbdir n-k-p code.
Resolves: rhbz#1153410
Resolves: rhbz#1088933
Signed-off-by: Peter Jones <pjones@redhat.com>