Commit Graph

126 Commits

Author SHA1 Message Date
Javier Martinez Canillas
8213073fa4
Only switch to BLS config for s390x / zipl
For platforms using GRUB, the switch to BLS should be done in the %post
scriptlet for the grub2-tools package. So only switch to BLS for s390x.

Related: rhbz#1652806

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2019-03-11 12:55:40 +01:00
Javier Martinez Canillas
6abeb6fc77
grubby-bls: make --update-kernel ALL to update kernelopts var in grubenv
Currently there's no way to update the kernelopts variable defined in the
grubenv by using the grubby wrapper. Updating it with grub2-editenv - set
is tedious and error prone so let's use --update-kernel=ALL option for it.

This command currently iterates over all the BLS entries and update them
individually, but makes more sense to update the kernelopts grubenv var
and only update the BLS entries that don't have the $kernelopts var in
their options field.

If after an update one of these BLS entries have exactly the same params
in their options field than the ones set in $kernelopts, set the options
field to $kernelopts again since the parameters have converged again.

That way the modified BLS entries will only have a custom options field
while its value diverged from the $kernelopts defined in grubenv.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2019-03-01 16:31:28 +01:00
Javier Martinez Canillas
40d73389b4
grubby-bls: error if args or remove-args is used without update-kernel
The --args and --remove-args options can only be used when the kernel to
update is specified using the --update-kernel option. Print an error if
the latter option is not provided.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2019-02-14 10:57:13 +01:00
Javier Martinez Canillas
ac9b25b31e
Fix build errors with GCC9 and two more grubby-bls fixes
- Fix GCC warnings about possible string truncations and buffer overflows
- grubby-bls: unset default entry if is the one being removed
- grubby-bls: show absolute path when printing error about incorrect param

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2019-02-05 20:09:52 +01:00
Fedora Release Engineering
9f336a65dd - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2019-02-01 01:38:17 +00:00
Javier Martinez Canillas
290786e606
Correctly set LDFLAGS and make grubby-bls expand all options variables
- Correctly set LDFLAGS to include hardened flags (pjones)
  Related: rhbz#1654936
- grubby-bls: expand all variables in options field when updating it
  Resolves: rhbz#1660700

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2019-01-14 09:56:05 +01:00
Javier Martinez Canillas
6b2ae0e335
grubby-bls: lookup default entry by either id or title on grub2
There is a grub2-set-default script that can be used to set the default
entry. It can take an entry id, title or index as a parameter so grubby
should be able to also lookup a default entry using the title on grub2.

Related: rhbz#1654936

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2018-12-11 16:24:22 +01:00
Javier Martinez Canillas
2ad4f485f1
Another set of mostly grubby-bls fixes
- grubby-bls: also print the absolute path in the --default-kernel option
  Resolves: rhbz#1649778
- grubby-bls: allow to specify the same kernel param multiple times
  Resolves: rhbz#1652486
- grubby-bls: expand kernel options if these are environment variables
  Resolves: rhbz#1649785
- grubby-bls: always generate the BLS snippets when adding new entries
  Resolves: rhbz#1653365
- Improve man page for --info option (jstodola)
  Resolves: rhbz#1651672
- Make the old grubby take precedence over grubby-bls if is installed
  Related: rhbz#165484

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2018-12-01 02:34:07 +01:00
Javier Martinez Canillas
e777519e08
Another batch of grubby-bls fixes
- installkernel-bls: remove unnecessary check for GRUB_ENABLE_BLSCFG=true
  Resolves: rhbz#1647721
- grubby-bls: use title field instead of version for zipl default entry
  Related: rhbz#1645200
- grubby-bls: print the absolute kernel and initramfs images paths
  Resolves: rhbz#1649778
- grubby-bls: make info print the root parameter if is present in cmdline
  Resolves: rhbz#1649791

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2018-11-21 10:49:59 +01:00
Javier Martinez Canillas
f9d8ee1b64
Switch to a BLS configuration on %%post
By default the old grubby tool isn't installed anymore and it's part of
the grubby-deprecated package. Instead the grubby wrapper that modifies
BLS config files is installed for backward compatiblity with old grubby.

So on postinstall the bootloader configuration has to be changed to BLS
since non-BLS bootloader configuration won't be updated anymore without
the old grubby tool and the new-kernel-pkg script.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2018-11-13 00:39:31 +01:00
Javier Martinez Canillas
d72135ede9
Move old grubby and new-kernel-pkg to grubby-deprecated and default to BLS
Now that Anaconda defaults to a BootLoaderSpec setup on installation, the
the grubby package should also install the grubby BLS wrapper by default.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2018-11-06 15:16:27 +01:00
Javier Martinez Canillas
7babbb04df
grubby-bls: only compare using relative paths if /boot is a mount point
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>
2018-11-06 11:48:49 +01:00
Javier Martinez Canillas
6ed71042bd
A lot of BLS fixes
- 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>
2018-11-02 01:02:09 +01:00
Peter Jones
a5e56a6e7d
Make grubby-bls sort everything correctly, including spaces.
Related: rhbz#1638103
2018-10-23 15:49:19 +02:00
Peter Jones
0f5ce5a543
Rename patches
This is just "git format-patch -7" to normalize the names.

Related: rhbz#1638103
2018-10-23 15:21:35 +02:00
Peter Jones
e4c6ac2467
Install installkernel-bls here as well, not just in the grub2 package,
since s390x doesn't have grubby packages.
  Related: rhbz#1619344

Signed-off-by: Peter Jones <pjones@redhat.com>
2018-10-23 14:52:47 +02:00
Peter Jones
656faab212
Re-enable debuginfo generation.
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>
2018-10-23 14:48:48 +02:00
Peter Jones
c8647003fc
Provide the correct installkenrel and grubby-bls packaging for blscfg
Resolves: rhbz#1619344

Signed-off-by: Peter Jones <pjones@redhat.com>
2018-10-23 14:29:29 +02:00
Javier Martinez Canillas
6a009b55ac
Make installkernel to use kernel-install scripts on BLS configuration
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2018-08-11 21:33:16 +02:00
Javier Martinez Canillas
5e1de1e87d
Fix grubby wrapper paths
Resolves: rhbz#1607981

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
2018-07-25 09:33:43 +02:00
Peter Jones
1f933303c9 Fix permissions on /usr/sbin/grubby
Signed-off-by: Peter Jones <pjones@redhat.com>
2018-07-24 13:44:00 -04:00
Peter Jones
87beb89e75 Make this like the f28 package.
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>
2018-07-18 13:54:22 -04:00
Peter Jones
214bb840df Move grubby-bls to grubby and obsolete the old grubby package
Signed-off-by: Peter Jones <pjones@redhat.com>
2018-07-18 13:44:06 -04: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
Fedora Release Engineering
a7316b242a - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-07-13 04:33:50 +00:00
Javier Martinez Canillas
b92599df6e Switch zipl config to BLS configuration on %postun for s390x
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>
2018-06-14 10:26:39 -04:00
Peter Jones
5d5938c58d Fix an old changelog entry rpmlint was complaining about
Signed-off-by: Peter Jones <pjones@redhat.com>
2018-06-14 10:26:21 -04:00
Rafael dos Santos
a631596958 Use Fedora standard linker flags
- Resolves rhbz#1543502

Signed-off-by: Rafael dos Santos <rdossant@redhat.com>
2018-05-29 15:21:54 +02:00
Javier Martinez Canillas
eedee25066 Use .rpmsave as backup suffix when switching to BLS configuration
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>
2018-04-11 10:10:26 -04:00
Javier Martinez Canillas
c8349748f2 Switch grub2 config to BLS configuration on %postun
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>
2018-04-06 13:50:22 -04:00
Nathaniel McCallum
8a91c9f29b Add support for /boot on btrfs 2018-03-05 13:52:23 -05:00
Fedora Release Engineering
e0fe64ca89 - Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
Signed-off-by: Fedora Release Engineering <releng@fedoraproject.org>
2018-02-07 15:30:57 +00:00
Peter Robinson
c5aefcde03 Drop u-boot uImage generation on ARMv7, Minor cleanups 2018-01-24 08:53:33 +00:00
Peter Jones
9c7b4eb905 Actually require grub2-tools-minimal, which has grub2-editenv in it.
Signed-off-by: Peter Jones <pjones@redhat.com>
2017-09-12 10:07:05 -04:00
Peter Jones
5eb64ab406 Cleanup deps for new grub2 packaging.
- Explicitly require grub2-tools on platforms that need grub2-editenv
- Minor packaging cleanups

Signed-off-by: Peter Jones <pjones@redhat.com>
2017-09-12 09:21:37 -04:00
Fedora Release Engineering
8f77e4538d - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild 2017-08-02 23:05:04 +00:00
Fedora Release Engineering
17c40dca81 - Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild 2017-07-26 12:05:52 +00:00
Adam Jackson
1ddd4fd7db Update URL, fix %description formatting 2017-02-27 13:07:26 -05:00
Fedora Release Engineering
c7f3e950d7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild 2017-02-10 12:16:16 +00:00
Dennis Gilmore
9e56840728 - Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild 2016-02-03 23:22:14 +00:00
Dennis Gilmore
796d03e956 - Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild 2015-06-17 09:51:29 +00:00
Peter Jones
2ba2a6e6aa Update to 8.40
- More work on the thing that went to testing in 8.39
  Resolves: rhbz#1211887

Signed-off-by: Peter Jones <pjones@redhat.com>
2015-04-15 15:40:01 -04:00
Peter Jones
715a4d823a Update to 8.39
- 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>
2015-04-14 14:40:14 -04:00
Peter Jones
c095884218 Update to 8.38
- 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>
2015-04-14 13:35:46 -04:00
Peter Jones
75676da88b Update to 8.37
- Fix test case from 8.35 on ppc64
  Resolves: rhbz#1202876

Signed-off-by: Peter Jones <pjones@redhat.com>
2015-03-17 14:57:25 -04:00
Peter Jones
13b3f1d5f2 Disable "make check" on arm builds; right now the test suite is broken
there and raises false positives constantly.

Signed-off-by: Peter Jones <pjones@redhat.com>
2014-11-13 09:46:21 -05:00
Peter Jones
e2a3f9ce83 Treat kernel and kernel-core as identical in terms of --make-default
Resolves: rhbz#1141414

Signed-off-by: Peter Jones <pjones@redhat.com>
2014-10-27 18:14:26 -04:00
Peter Jones
ee984748a5 Don't create "debug" entries yet.
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>
2014-10-17 18:56:25 -04:00
Peter Jones
635a3b8d37 Update grubby to support device tree options for arm. Again.
Resolves: rhbz#1088933

Signed-off-by: Peter Jones <pjones@redhat.com>
2014-10-17 18:56:25 -04:00
Peter Jones
ac7dcc0da0 Fix a typo. 2014-10-17 18:56:25 -04:00