dracut
dracut copied to clipboard
dracut-install should parse AT_PLATFORM and AT_HWCAP
❯ LD_SHOW_AUXV="" ldd /bin/bash | fgrep AT_PLATFORM
AT_PLATFORM: x86_64
AT_PLATFORM: x86_64
AT_PLATFORM together with AT_HWCAP should give information on what libraries to install additionally in generic images.
# ldconfig -p|grep -F libc.so
libc.so.6 (libc6,64bit, hwcap: 0x0000001000000000, OS ABI: Linux 2.6.32) => /lib64/power6/libc.so.6
libc.so.6 (libc6,64bit, hwcap: 0x0000000000000200, OS ABI: Linux 2.6.32) => /lib64/power6x/libc.so.6
libc.so.6 (libc6,64bit, OS ABI: Linux 2.6.32) => /lib64/libc.so.6
We have received a different suggestion downstream: always use the generic library. There is a kludge that handles legacy hwcaps subdirectories:
/* Also try to install the same library from one directory above.
This fixes the case, where only the HWCAP lib would be installed
# ldconfig -p|grep -F libc.so
libc.so.6 (libc6,64bit, hwcap: 0x0000001000000000, OS ABI: Linux 2.6.32) => /lib64/power6/libc.so.6
libc.so.6 (libc6,64bit, hwcap: 0x0000000000000200, OS ABI: Linux 2.6.32) => /lib64/power6x/libc.so.6
libc.so.6 (libc6,64bit, OS ABI: Linux 2.6.32) => /lib64/libc.so.6
*/
But it does not work for glibc-hwcaps
subdirectories. These are copied into the initramfs as-is, under their glibc-hwcaps
paths, for example:
usr/lib64/glibc-hwcaps/power9/libc-2.28.so
usr/lib64/glibc-hwcaps/power9/libm-2.28.so
usr/lib64/glibc-hwcaps/power9/libpthread-2.28.so
usr/lib64/glibc-hwcaps/power9/librt-2.28.so
This causes guest build failures if the hypervisor changes processor feature flags.