History log of /linux-master/scripts/package/kernel.spec
Revision Date Author Comments
# 097f1200 11-Mar-2024 Jose Ignacio Tornos Martinez <jtornosm@redhat.com>

kbuild: rpm-pkg: add dtb files in kernel rpm

Some architectures, like aarch64 ones, need a dtb file to configure the
hardware. The default dtb file can be preloaded from u-boot, but the final
and/or more complete dtb file needs to be able to be loaded later from
rootfs.

Add the possible dtb files to the kernel rpm and mimic Fedora shipping
process, storing the dtb files in the module directory. These dtb files
will be copied to /boot directory by the install scripts, but add fallback
just in case, checking if the content in /boot directory is correct.

Mark the files installed to /boot as %ghost to make sure they will be
removed when the package is uninstalled.

Tested with Fedora Rawhide (x86_64 and aarch64) with dnf and rpm tools.
In addition, fallback was also tested after modifying the install scripts.

Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
Tested-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# fee9b6d1 02-Feb-2024 Masahiro Yamada <masahiroy@kernel.org>

Revert "kbuild/mkspec: clean boot loader configuration on rpm removal"

This reverts commit 6ef41e22a320d95a246d45b673aa7247cc1bbf7b.

If this is still needed, we can bring it back.

However, I'd like to understand why 'new-kernel-pkg --remove' is
needed for uninstallation, while 'new-kernel-pkg --install' was not
called during the installation.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# 435e8699 02-Feb-2024 Masahiro Yamada <masahiroy@kernel.org>

Revert "kbuild/mkspec: support 'update-bootloader'-based systems"

This reverts commit 27c3bffd230abd0a598586aed0fe0ba7b61e0e2e.

If this is still needed, we can bring it back.

However, I'd like to understand why 'update-bootloader --remove' is
needed for uninstallation, while 'update-bootloader --add' was not
called during the installation.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# bca17edb 02-Feb-2024 Masahiro Yamada <masahiroy@kernel.org>

kbuild: rpm-pkg: mark installed files in /boot as %ghost

Mark the files installed to /boot as %ghost to make sure they will be
removed when the package is uninstalled.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Tested-by: Nathan Chancellor <nathan@kernel.org>


# 615b3a3d 02-Feb-2024 Masahiro Yamada <masahiroy@kernel.org>

kbuild: rpm-pkg: do not include depmod-generated files

Installing the kernel package is fine, but when uninstalling it, the
following warnings are shown:

warning: file modules.symbols.bin: remove failed: No such file or directory
warning: file modules.symbols: remove failed: No such file or directory
warning: file modules.softdep: remove failed: No such file or directory
warning: file modules.devname: remove failed: No such file or directory
warning: file modules.dep.bin: remove failed: No such file or directory
warning: file modules.dep: remove failed: No such file or directory
warning: file modules.builtin.bin: remove failed: No such file or directory
warning: file modules.builtin.alias.bin: remove failed: No such file or directory
warning: file modules.alias.bin: remove failed: No such file or directory
warning: file modules.alias: remove failed: No such file or directory

The %preun scriptlet runs 'kernel-install remove', which in turn invokes
/usr/lib/kernel/install.d/50-depmod.install to remove those files before
the actual package removal.

RPM-based distributions do not ship files generated by depmod. Mark them
as %ghost in order to exclude them from the package, but still claim the
ownership on them.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Tested-by: Nathan Chancellor <nathan@kernel.org>


# 358de8b4 29-Jan-2024 Jose Ignacio Tornos Martinez <jtornosm@redhat.com>

kbuild: rpm-pkg: simplify installkernel %post

The new installkernel application that is now included in systemd-udev
package allows installation although destination files are already present
in the boot directory of the kernel package, but is failing with the
implemented workaround for the old installkernel application from grubby
package.

For the new installkernel application, as Davide says:
<<The %post currently does a shuffling dance before calling installkernel.
This isn't actually necessary afaict, and the current implementation
ends up triggering downstream issues such as
https://github.com/systemd/systemd/issues/29568
This commit simplifies the logic to remove the shuffling. For reference,
the original logic was added in commit 3c9c7a14b627("rpm-pkg: add %post
section to create initramfs and grub hooks").>>

But we need to keep the old behavior as well, because the old installkernel
application from grubby package, does not allow this simplification and
we need to be backward compatible to avoid issues with the different
packages.

Mimic Fedora shipping process and store vmlinuz, config amd System.map
in the module directory instead of the boot directory. In this way, we will
avoid the commented problem for all the cases, because the new destination
files are not going to exist in the boot directory of the kernel package.

Replace installkernel tool with kernel-install tool, because the latter is
more complete.

Besides, after installkernel tool execution, check to complete if the
correct package files vmlinuz, System.map and config files are present
in /boot directory, and if necessary, copy manually for install operation.
In this way, take into account if files were not previously copied from
/usr/lib/kernel/install.d/* scripts and if the suitable files for the
requested package are present (it could be others if the rpm files were
replace with a new pacakge with the same release and a different build).

Tested with Fedora 38, Fedora 39, RHEL 9, Oracle Linux 9.3,
openSUSE Tumbleweed and openMandrive ROME, using dnf/zypper and rpm tools.

cc: stable@vger.kernel.org
Co-Developed-by: Davide Cavalca <dcavalca@meta.com>
Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# 0df8e970 24-Nov-2023 Masahiro Yamada <masahiroy@kernel.org>

scripts: clean up IA-64 code

A little more janitorial work after commit cf8e8658100d ("arch: Remove
Itanium (IA-64) architecture").

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>


# 2d7d1bc1 01-Oct-2023 Masahiro Yamada <masahiroy@kernel.org>

kbuild: remove stale code for 'source' symlink in packaging scripts

Since commit d8131c2965d5 ("kbuild: remove $(MODLIB)/source symlink"),
modules_install does not create the 'source' symlink.

Remove the stale code from builddeb and kernel.spec.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>


# 49c803cd 21-Jul-2023 Masahiro Yamada <masahiroy@kernel.org>

kbuild: rpm-pkg: split out the body of spec file

Most of the lines in the spec file are independent of any build
condition.

Split the body of the spec file into scripts/package/kernel.spec.
scripts/package/mkspec will prepend some env-dependent variables.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>