Forum | Documentation | Website | Blog

Skip to content
Snippets Groups Projects
  1. Jul 28, 2024
  2. Jul 15, 2024
  3. Jul 14, 2024
  4. Jun 25, 2024
    • Masahiro Yamada's avatar
      kbuild: rpm-pkg: fix build error with CONFIG_MODULES=n · 8d1001f7
      Masahiro Yamada authored
      When CONFIG_MODULES is disabled, 'make (bin)rpm-pkg' fails:
      
        $ make allnoconfig binrpm-pkg
          [ snip ]
        error: File not found: .../linux/rpmbuild/BUILDROOT/kernel-6.10.0_rc3-1.i386/lib/modules/6.10.0-rc3/kernel
        error: File not found: .../linux/rpmbuild/BUILDROOT/kernel-6.10.0_rc3-1.i386/lib/modules/6.10.0-rc3/modules.order
      
      To make it work irrespective of CONFIG_MODULES, this commit specifies
      the directory path, /lib/modules/%{KERNELRELEASE}, instead of individual
      files.
      
      However, doing so would cause new warnings:
      
        warning: File listed twice: /lib/modules/6.10.0-rc3-dirty/modules.alias
        warning: File listed twice: /lib/modules/6.10.0-rc3-dirty/modules.alias.bin
        warning: File listed twice: /lib/modules/6.10.0-rc3-dirty/modules.builtin.alias.bin
        warning: File listed twice: /lib/modules/6.10.0-rc3-dirty/modules.builtin.bin
        warning: File listed twice: /lib/modules/6.10.0-rc3-dirty/modules.dep
        warning: File listed twice: /lib/modules/6.10.0-rc3-dirty/modules.dep.bin
        warning: File listed twice: /lib/modules/6.10.0-rc3-dirty/modules.devname
        warning: File listed twice: /lib/modules/6.10.0-rc3-dirty/modules.softdep
        warning: File listed twice: /lib/modules/6.10.0-rc3-dirty/modules.symbols
        warning: File listed twice: /lib/modules/6.10.0-rc3-dirty/modules.symbols.bin
      
      These files exist in /lib/modules/%{KERNELRELEASE} and are also explicitly
      marked as %ghost.
      
      Suppress depmod because depmod-generated files are not packaged.
      
      Fixes: 615b3a3d
      
       ("kbuild: rpm-pkg: do not include depmod-generated files")
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Reviewed-by: default avatarNathan Chancellor <nathan@kernel.org>
      8d1001f7
  5. Mar 18, 2024
    • Jose Ignacio Tornos Martinez's avatar
      kbuild: rpm-pkg: add dtb files in kernel rpm · 097f1200
      Jose Ignacio Tornos Martinez authored
      
      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: default avatarJose Ignacio Tornos Martinez <jtornosm@redhat.com>
      Tested-by: default avatarNathan Chancellor <nathan@kernel.org>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      097f1200
  6. Feb 19, 2024
  7. Jan 31, 2024
    • Jose Ignacio Tornos Martinez's avatar
      kbuild: rpm-pkg: simplify installkernel %post · 358de8b4
      Jose Ignacio Tornos Martinez authored
      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 3c9c7a14
      
      ("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: default avatarDavide Cavalca <dcavalca@meta.com>
      Signed-off-by: default avatarJose Ignacio Tornos Martinez <jtornosm@redhat.com>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      358de8b4
  8. Dec 03, 2023
  9. Oct 01, 2023
  10. Jul 24, 2023