tizen: Do not generate nor use ksyms Requires/Provides for kernel & modules package(s) 46/307846/2 accepted/tizen_base accepted/tizen/base/20240502.113325
authorKarol Lewandowski <k.lewandowsk@samsung.com>
Wed, 13 Mar 2024 15:44:39 +0000 (16:44 +0100)
committerKarol Lewandowski <k.lewandowsk@samsung.com>
Thu, 14 Mar 2024 13:06:32 +0000 (14:06 +0100)
commitf27241ce6c9fb6f7b8b6f3426dc366dc1c051b1d
tree990356500dd834fd82fc1b683907564e655573d8
parentbe0ba8d1741898ea3388c9f9008edbcbc620fe66
tizen: Do not generate nor use ksyms Requires/Provides for kernel & modules package(s)

RPM currently do not properly generate ksyms Provides for kernel image in EFI COFF/uImage
formats.  However, the Requires ksyms generation simply extracts symbols from ELF .ko,
resulting in uninstallable modules package (as it has Requires to ksyms that is not
provided by kernel image, see example at the end).

The problem appears not for regular modules package but for modules package that
are handled via baselibs.conf.  Preciesely, it looks like RPM uses host-native
macro scripts in /usr/lib/rpms/fileattrs/* for regular packages, while packages
converted according to baselibs.conf use macros from GBS-ROOT chroot.

Regular packages:

    $ rpm -qp --requires linux-tizen-modules-rpi4-7.5.0-0.aarch64.rpm
    /bin/sh
    arm64-rpi4-linux-kernel-modules
    bash
    coreutils
    findutils
    kmod-compat
    rpmlib(CompressedFileNames) <= 3.0.4-1
    rpmlib(FileDigests) <= 4.6.0-1
    rpmlib(PayloadFilesHavePrefix) <= 4.0-1
    rpmlib(PayloadIsXz) <= 5.2-1

    $ rpm -qp --provides arm64-rpi4-linux-kernel-5.15.92-0.aarch64.rpm
    arm64-rpi4-kernel-uname-r = 5.15.92-arm64-rpi4
    arm64-rpi4-linux-kernel = 5.15.92-0
    arm64-rpi4-linux-kernel(aarch-64) = 5.15.92-0
    kernel-uname-r = 5.15.92-arm64-rpi4-v8
    linux-kernel = 5.15.92-0

Packaged generated using baselibs.conf:

    $ rpm -qp --provides arm64-rpi4-linux-kernel-aarch64-5.15.92-0.armv7l.rpm
    arm64-rpi4-linux-kernel-aarch64 = 5.15.92-0
    arm64-rpi4-linux-kernel-aarch64(x86-64) = 5.15.92-0

    $ rpm -qpl --requires linux-tizen-modules-rpi4-aarch64-7.5.0-0.armv7l.rpm
    /bin/sh
    bash
    coreutils
    findutils
    kmod-compat
    ksym(v8:__arch_copy_from_user) = 12a4e128
    ksym(v8:__arch_copy_to_user) = 6cbbfc54
    ksym(v8:__bitmap_or) = a084749a
    ksym(v8:__get_free_pages) = 6a5cb5ee
    ksym(v8:__get_task_comm) = 451222
    ksym(v8:__init_rwsem) = c22d4503
    ksym(v8:__init_waitqueue_head) = 3bf4d690
    ksym(v8:__kmalloc) = eb233a45
    ...

The ksyms() are generated by find-requires.ksyms, causing linux-tizen-modules-rpi4-aarch
package to be uninstallable.

This commit drops find-requires.ksyms and find-provides.ksyms making baselibs and
regular packages to have same set of dependencies generated automatically.

Change-Id: Ib4c16064a11f8693d5558baec49ed85e8c2d776b
packaging/rpm.spec