0

I'm compiling kernel (4.14.0-115.el7a.0.1.aarch64) of Centos 7.6.1810. The source file is kernel-alt-4.14.0-115.el7a.0.1.src.rpm from centos repo. What I did:

mkdir /root/kernel
cd /root/kernel
wget http://vault.centos.org/centos/7.6.1810/os/Source/SPackages/kernel-alt-4.14.0-115.el7a.0.1.src.rpm 
rpm2cpio ./kernel-alt-4.14.0-115.el7a.0.1.src.rpm | cpio -div
tar -vxf linux-4.14.0-115.el7a.tar.xz
cd linux-4.14.0-115.el7a/
cp /boot/config-4.14.0-115.el7a.0.1.aarch64  ./.config
# comment CONFIG_MODULE_SIG_KEY and CONFIG_SYSTEM_TRUSTED_KEYS

make -j

I compared the generated file Module.symvers and symvers-4.14.0-115.el7a.0.1.aarch64.gz in /boot/. I found that there is some difference.

There are 13408 symbols in origin symvers and 13430 in recompiled symvers. In recompiled symvers, there are missed symbols acpi_device_get_match_data fwnode_get_mac_address fwnode_get_next_available_child_node fwnode_get_phy_mode fwnode_irq_get queued_spin_lock_slowpath .

Why? How can I compile kernel with the exact same symbols?

oleotiger
  • 105
  • 2
  • 11
  • source, config and applied patches al need to match to get the same number. Timestamps will still have different values. – stark Aug 12 '21 at 11:52
  • Do the instructions at [I Need the Kernel Source](https://wiki.centos.org/HowTos/I_need_the_Kernel_Source) work? – Ian Abbott Aug 12 '21 at 15:57

1 Answers1

2

May be source picked from tar does not have all config option enabled. So before compiling kernel I would recommend using spec files to get the complete source code

  1. Download kernel-alt-4.14.0-115.el7a.0.1.src.rpm
  2. rpm -ivh kernel-alt-4.14.0-115.el7a.0.1.src.rpm
  3. rpmbuild -bp /root/rpmbuild/SPECS/kernel.spec
  4. cd /root/rpmbuild/BUILD

compile the code and check symver

tej parkash
  • 137
  • 2