From b8e00c5a84bcd75a1e2c491b6de601278e1572c7 Mon Sep 17 00:00:00 2001 From: Michal Suchanek Date: May 29 2023 11:43:56 +0000 Subject: Remove usrmerge compatibility symlink in buildroot (boo#1211796) Besides Makefile depmod.sh needs to be patched to prefix /lib/modules. Requires corresponding patch to kmod. Signed-off-by: Michal Suchanek --- diff --git a/rpm/kernel-binary.spec.in b/rpm/kernel-binary.spec.in index ce68ca4..b0384de 100644 --- a/rpm/kernel-binary.spec.in +++ b/rpm/kernel-binary.spec.in @@ -401,6 +401,10 @@ cd linux-%srcversion --vanilla \ %endif %_sourcedir/series.conf .. $SYMBOLS +%if 0%{?usrmerged} +# fix MODLIB so kmps install to /usr +sed -ie 's,/lib/modules/,%{kernel_module_directory}/,' linux-%kernelrelease%variant/Makefile scripts/depmod.sh +%endif cd %kernel_build_dir @@ -602,14 +606,6 @@ done %install -%if 0%{?usrmerged} -# add symlink for usrmerge so install scripts will just follow the -# link and end up placing files in /usr/lib. The link will be -# removed later and is not packaged here. -mkdir -p %{buildroot}/usr/lib -ln -s usr/lib %{buildroot}/lib -%endif - # get rid of /usr/lib/rpm/brp-strip-debug # strip removes too much from the vmlinux ELF binary export NO_BRP_STRIP_DEBUG=true @@ -934,10 +930,6 @@ if [ %CONFIG_MODULES = y ]; then fi rm -rf %{buildroot}/lib/firmware -%if 0%{?usrmerged} -# remove usrmerge aid -rm %{buildroot}/lib -%endif add_dirs_to_filelist() { sed -rn ' diff --git a/rpm/kernel-source.spec.in b/rpm/kernel-source.spec.in index 035623d..edd0690 100644 --- a/rpm/kernel-source.spec.in +++ b/rpm/kernel-source.spec.in @@ -223,10 +223,6 @@ find . -xtype l -delete -printf "deleted '%f'\n" if test "%srcversion" != "%kernelrelease%variant"; then mv linux-%srcversion linux-%kernelrelease%variant fi -%if 0%{?usrmerged} -# fix MODLIB so kmps install to /usr -sed -ie 's,/lib/modules/,%{kernel_module_directory}/,' linux-%kernelrelease%variant/Makefile -%endif %if %do_vanilla cp -al \ @@ -234,6 +230,10 @@ sed -ie 's,/lib/modules/,%{kernel_module_directory}/,' linux-%kernelrelease%vari cd linux-%kernelrelease-vanilla %_sourcedir/apply-patches --vanilla %_sourcedir/series.conf %my_builddir %symbols rm -f $(find . -name ".gitignore") +%if 0%{?usrmerged} +# fix MODLIB so kmps install to /usr +sed -ie 's,/lib/modules/,%{kernel_module_directory}/,' linux-%kernelrelease%variant/Makefile scripts/depmod.sh +%endif # Hardlink duplicate files automatically (from package fdupes). %fdupes $PWD cd .. @@ -246,6 +246,10 @@ rm -f $(find . -name ".gitignore") if [ -f %_sourcedir/localversion ] ; then cat %_sourcedir/localversion > localversion fi +%if 0%{?usrmerged} +# fix MODLIB so kmps install to /usr +sed -ie 's,/lib/modules/,%{kernel_module_directory}/,' linux-%kernelrelease%variant/Makefile scripts/depmod.sh +%endif # Hardlink duplicate files automatically (from package fdupes). %fdupes $PWD cd ..