commit 2e9639bdfc7b044b86e3953792abd84a679e7ddb

OBS-URL: https://build.opensuse.org/package/show/Kernel:stable/kernel-source?expand=0&rev=1552
This commit is contained in:
Jiri Slaby 2021-08-11 07:09:40 +00:00 committed by Git OBS Bridge
parent 5d7de1c333
commit d8d5add629
43 changed files with 1093 additions and 225 deletions

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Wed Aug 11 06:36:51 CEST 2021 - jslaby@suse.cz
- Revert "Revert "UsrMerge the kernel (boo#1184804)""
This reverts commit b6ab3ded319fca797d007c541a190a308f940cf7. By that,
we reverted the original commit 6f5ed044f52a. But the two problems were
adressed in the meantime, so it's time to try UsrMerge for kernel again.
- commit 2e9639b
-------------------------------------------------------------------
Sun Aug 8 12:50:22 CEST 2021 - jslaby@suse.cz

View File

@ -31,7 +31,7 @@
Name: dtb-aarch64
Version: 5.13.9
%if 0%{?is_kotd}
Release: <RELEASE>.g19b1d90
Release: <RELEASE>.g2e9639b
%else
Release: 0
%endif

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Wed Aug 11 06:36:51 CEST 2021 - jslaby@suse.cz
- Revert "Revert "UsrMerge the kernel (boo#1184804)""
This reverts commit b6ab3ded319fca797d007c541a190a308f940cf7. By that,
we reverted the original commit 6f5ed044f52a. But the two problems were
adressed in the meantime, so it's time to try UsrMerge for kernel again.
- commit 2e9639b
-------------------------------------------------------------------
Sun Aug 8 12:50:22 CEST 2021 - jslaby@suse.cz

View File

@ -31,7 +31,7 @@
Name: dtb-armv6l
Version: 5.13.9
%if 0%{?is_kotd}
Release: <RELEASE>.g19b1d90
Release: <RELEASE>.g2e9639b
%else
Release: 0
%endif

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Wed Aug 11 06:36:51 CEST 2021 - jslaby@suse.cz
- Revert "Revert "UsrMerge the kernel (boo#1184804)""
This reverts commit b6ab3ded319fca797d007c541a190a308f940cf7. By that,
we reverted the original commit 6f5ed044f52a. But the two problems were
adressed in the meantime, so it's time to try UsrMerge for kernel again.
- commit 2e9639b
-------------------------------------------------------------------
Sun Aug 8 12:50:22 CEST 2021 - jslaby@suse.cz

View File

@ -31,7 +31,7 @@
Name: dtb-armv7l
Version: 5.13.9
%if 0%{?is_kotd}
Release: <RELEASE>.g19b1d90
Release: <RELEASE>.g2e9639b
%else
Release: 0
%endif

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Wed Aug 11 06:36:51 CEST 2021 - jslaby@suse.cz
- Revert "Revert "UsrMerge the kernel (boo#1184804)""
This reverts commit b6ab3ded319fca797d007c541a190a308f940cf7. By that,
we reverted the original commit 6f5ed044f52a. But the two problems were
adressed in the meantime, so it's time to try UsrMerge for kernel again.
- commit 2e9639b
-------------------------------------------------------------------
Sun Aug 8 12:50:22 CEST 2021 - jslaby@suse.cz

View File

@ -31,7 +31,7 @@
Name: dtb-riscv64
Version: 5.13.9
%if 0%{?is_kotd}
Release: <RELEASE>.g19b1d90
Release: <RELEASE>.g2e9639b
%else
Release: 0
%endif

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Wed Aug 11 06:36:51 CEST 2021 - jslaby@suse.cz
- Revert "Revert "UsrMerge the kernel (boo#1184804)""
This reverts commit b6ab3ded319fca797d007c541a190a308f940cf7. By that,
we reverted the original commit 6f5ed044f52a. But the two problems were
adressed in the meantime, so it's time to try UsrMerge for kernel again.
- commit 2e9639b
-------------------------------------------------------------------
Sun Aug 8 12:50:22 CEST 2021 - jslaby@suse.cz

View File

@ -68,13 +68,27 @@
%define install_vdso 0
%endif
# TW is usrmerged
%if %{undefined usrmerged} && 0%{?suse_version} >= 1550
%define usrmerged 1
%endif
%if 0%{?usrmerged}
%define modules_dir /usr/lib/modules/%kernelrelease-%build_flavor
%define systemmap %{modules_dir}/System.map
%else
%define modules_dir /lib/modules/%kernelrelease-%build_flavor
%define systemmap /boot/System.map-%kernelrelease-%build_flavor
%endif
Name: kernel-64kb
Summary: Kernel with 64kb PAGE_SIZE
License: GPL-2.0-only
Group: System/Kernel
Version: 5.13.9
%if 0%{?is_kotd}
Release: <RELEASE>.g19b1d90
Release: <RELEASE>.g2e9639b
%else
Release: 0
%endif
@ -192,10 +206,10 @@ Conflicts: hyper-v < 4
Conflicts: libc.so.6()(64bit)
%endif
Provides: kernel = %version-%source_rel
Provides: kernel-%build_flavor-base-srchash-19b1d907051ab563b934d68bc884105369cabdce
Provides: kernel-srchash-19b1d907051ab563b934d68bc884105369cabdce
Provides: kernel-%build_flavor-base-srchash-2e9639bdfc7b044b86e3953792abd84a679e7ddb
Provides: kernel-srchash-2e9639bdfc7b044b86e3953792abd84a679e7ddb
# END COMMON DEPS
Provides: %name-srchash-19b1d907051ab563b934d68bc884105369cabdce
Provides: %name-srchash-2e9639bdfc7b044b86e3953792abd84a679e7ddb
%obsolete_rebuilds %name
Source0: http://www.kernel.org/pub/linux/kernel/v5.x/linux-%srcversion.tar.xz
Source2: source-post.sh
@ -617,6 +631,14 @@ 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
@ -712,11 +734,19 @@ add_vmlinux()
# sign the modules, firmware and possibly the kernel in the buildservice
BRP_PESIGN_FILES=""
%if "%CONFIG_EFI_STUB" == "y"
%if 0%{?usrmerged}
BRP_PESIGN_FILES="%modules_dir/$image"
%else
BRP_PESIGN_FILES="/boot/$image-%kernelrelease-%build_flavor"
%endif
%endif
%ifarch s390x ppc64 ppc64le
%if 0%{?usrmerged}
BRP_PESIGN_FILES="%modules_dir/$image"
%else
BRP_PESIGN_FILES="/boot/$image-%kernelrelease-%build_flavor"
%endif
%endif
%if "%CONFIG_MODULE_SIG" == "y"
BRP_PESIGN_FILES="$BRP_PESIGN_FILES *.ko"
%endif
@ -778,6 +808,13 @@ for sub in '' '-extra' \
-e "s:@RPM_TARGET_CPU@:%_target_cpu:g" \
-e "s:@CPU_ARCH_FLAVOR@:%cpu_arch_flavor:g" \
-e "s:@SRCVARIANT@:%variant:g" \
-e "s:@MODULESDIR@:%modules_dir:g" \
-e "s:@SYSTEMMAP@:%systemmap:g" \
%if 0%{?usrmerged}
-e "s:^@USRMERGE@::" \
%else
-e "/^@USRMERGE@/d" \
%endif
%_sourcedir/$script.sh > %my_builddir/$script$sub.sh
if test "$base_package" -eq 1 -a "${#certs[@]}" -gt 0; then
case "$script" in
@ -984,6 +1021,10 @@ 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 '
@ -996,7 +1037,7 @@ add_dirs_to_filelist() {
# print all parents
:a
# skip directories owned by other packages
s:^%%dir (/boot|/etc|/lib/(modules|firmware)|/usr/src)/[^/]+$::
s:^%%dir (/boot|/etc|(/usr)?/lib/(modules|firmware)|/usr/src)/[^/]+$::
s:/[^/]+$::p
ta
' "$@" | sort -u
@ -1013,10 +1054,23 @@ fi
%endif
shopt -s nullglob dotglob
> %my_builddir/kernel-devel.files
for file in %buildroot/boot/symtypes* %buildroot/lib/modules/*/{build,source}; do
f=${file##%buildroot}
echo "$f"
done | add_dirs_to_filelist >%my_builddir/kernel-devel.files
{
echo "%modules_dir/build"
echo "%modules_dir/source"
cd %buildroot
for file in boot/symtypes*; do
%if 0%{?usrmerged}
l="${file##*/}"
l="%modules_dir/${l//-%kernelrelease-%build_flavor}"
mv "$file" "%{buildroot}$l"
ln -s "..$l" $file
echo "$l"
echo "%%ghost /$file"
%else
echo "/$file"
%endif
done
} | add_dirs_to_filelist >%my_builddir/kernel-devel.files
( cd %buildroot ; find .%obj_install_dir/%cpu_arch_flavor -type f ; ) | \
sed -e 's/^[.]//' | grep -v -e '[.]ipa-clones$' -e '/Symbols[.]list$' -e '/ipa-clones[.]list$'| \
add_dirs_to_filelist >> %my_builddir/kernel-devel.files
@ -1025,6 +1079,8 @@ add_dirs_to_filelist >> %my_builddir/kernel-devel.files
echo %ghost /boot/initrd$suffix
cd %buildroot
for f in boot/*; do
l="${f##*/}"
l="%modules_dir/${l//-%kernelrelease-%build_flavor}"
if test -L "$f"; then
echo "%%ghost /$f"
continue
@ -1040,24 +1096,46 @@ add_dirs_to_filelist >> %my_builddir/kernel-devel.files
;;
boot/vmlinux-*)
if $ghost_vmlinux; then
echo "%%ghost /$f"
continue
# fall through to mark next echo as %ghost
echo -n "%%ghost "
fi
;;
%if 0%{?usrmerged}
boot/vmlinuz-*)
echo -n "%%attr(0644, root, root) "
;;
%endif
boot/symtypes*)
%if 0%{?usrmerged}
echo "%exclude $l"
%endif
continue
;;
esac
%if 0%{?usrmerged}
mv "$f" "./$l"
ln -s "..$l" $f
# the find in the CONFIG_MODULES condition below also finds the files
# but there's sort -u later, so this is ok
echo "$l" # note: must be first after case statement above
echo "%%ghost /$f"
%else
echo "%%attr(0644, root, root) /$f"
%endif
done
if [ %CONFIG_MODULES = y ]; then
find lib/modules/%kernelrelease-%build_flavor \
find %{?usrmerged:usr/}lib/modules/%kernelrelease-%build_flavor \
-type d -o \
\( -path '*/modules.*' ! -path '*/modules.order' \
! -path '*/modules.builtin' \
! -path '*/modules.builtin.modinfo' \) -printf '%%%%ghost /%%p\n' \
-o -name '*.ko' -prune -o -type f -printf '/%%p\n'
-o -name '*.ko' -prune \
%if 0%{?usrmerged}
-o \( -type f ! -path '*/symtypes*' ! -path '*/vmlinu*' \) -printf '/%%p\n'
%else
-o -type f -printf '/%%p\n'
%endif
cat %my_builddir/base-modules
fi
if test %CONFIG_MODULE_SIG = "y" -a -d etc/uefi/certs; then
@ -1118,15 +1196,15 @@ for f in %my_builddir/*-kmp-modules; do
done
if [ %CONFIG_MODULES = y ]; then
install -m 644 %_sourcedir/modules.fips %{buildroot}/lib/modules/%kernelrelease-%build_flavor/modules.fips
echo /lib/modules/%kernelrelease-%build_flavor/modules.fips >> %my_builddir/kernel-base.files
echo /lib/modules/%kernelrelease-%build_flavor/modules.fips >> %my_builddir/kernel-main.files
install -m 644 %_sourcedir/modules.fips %{buildroot}%modules_dir/modules.fips
echo %modules_dir/modules.fips >> %my_builddir/kernel-base.files
echo %modules_dir/modules.fips >> %my_builddir/kernel-main.files
fi
# Hardlink duplicate files automatically (from package fdupes): It doesn't save
# much, but it keeps rpmlint from breaking the package build. Note that we skip
# /usr/src/linux-obj intentionally, to not accidentally break timestamps there
%fdupes $RPM_BUILD_ROOT/lib
%fdupes %buildroot%modules_dir
%preun -f preun.sh
@ -1309,7 +1387,7 @@ static, unlike the %{patch_package}-<kernel-version>-flavor package names.
%files %{livepatch}
# rpmlint complains about empty packages, so lets own something
%defattr(-, root, root)
%dir /lib/modules/%kernelrelease-%build_flavor
%dir %modules_dir
%endif
%if 0%{?klp_symbols} && "%livepatch" != ""

View File

@ -68,6 +68,20 @@
%define install_vdso 0
%endif
# TW is usrmerged
%if %{undefined usrmerged} && 0%{?suse_version} >= 1550
%define usrmerged 1
%endif
%if 0%{?usrmerged}
%define modules_dir /usr/lib/modules/%kernelrelease-%build_flavor
%define systemmap %{modules_dir}/System.map
%else
%define modules_dir /lib/modules/%kernelrelease-%build_flavor
%define systemmap /boot/System.map-%kernelrelease-%build_flavor
%endif
Name: kernel-@FLAVOR@
Summary: @SUMMARY@
License: GPL-2.0-only
@ -472,6 +486,14 @@ 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
@ -567,11 +589,19 @@ add_vmlinux()
# sign the modules, firmware and possibly the kernel in the buildservice
BRP_PESIGN_FILES=""
%if "%CONFIG_EFI_STUB" == "y"
%if 0%{?usrmerged}
BRP_PESIGN_FILES="%modules_dir/$image"
%else
BRP_PESIGN_FILES="/boot/$image-%kernelrelease-%build_flavor"
%endif
%endif
%ifarch s390x ppc64 ppc64le
%if 0%{?usrmerged}
BRP_PESIGN_FILES="%modules_dir/$image"
%else
BRP_PESIGN_FILES="/boot/$image-%kernelrelease-%build_flavor"
%endif
%endif
%if "%CONFIG_MODULE_SIG" == "y"
BRP_PESIGN_FILES="$BRP_PESIGN_FILES *.ko"
%endif
@ -633,6 +663,13 @@ for sub in '' '-extra' \
-e "s:@RPM_TARGET_CPU@:%_target_cpu:g" \
-e "s:@CPU_ARCH_FLAVOR@:%cpu_arch_flavor:g" \
-e "s:@SRCVARIANT@:%variant:g" \
-e "s:@MODULESDIR@:%modules_dir:g" \
-e "s:@SYSTEMMAP@:%systemmap:g" \
%if 0%{?usrmerged}
-e "s:^@USRMERGE@::" \
%else
-e "/^@USRMERGE@/d" \
%endif
%_sourcedir/$script.sh > %my_builddir/$script$sub.sh
if test "$base_package" -eq 1 -a "${#certs[@]}" -gt 0; then
case "$script" in
@ -839,6 +876,10 @@ 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 '
@ -851,7 +892,7 @@ add_dirs_to_filelist() {
# print all parents
:a
# skip directories owned by other packages
s:^%%dir (/boot|/etc|/lib/(modules|firmware)|/usr/src)/[^/]+$::
s:^%%dir (/boot|/etc|(/usr)?/lib/(modules|firmware)|/usr/src)/[^/]+$::
s:/[^/]+$::p
ta
' "$@" | sort -u
@ -868,10 +909,23 @@ fi
%endif
shopt -s nullglob dotglob
> %my_builddir/kernel-devel.files
for file in %buildroot/boot/symtypes* %buildroot/lib/modules/*/{build,source}; do
f=${file##%buildroot}
echo "$f"
done | add_dirs_to_filelist >%my_builddir/kernel-devel.files
{
echo "%modules_dir/build"
echo "%modules_dir/source"
cd %buildroot
for file in boot/symtypes*; do
%if 0%{?usrmerged}
l="${file##*/}"
l="%modules_dir/${l//-%kernelrelease-%build_flavor}"
mv "$file" "%{buildroot}$l"
ln -s "..$l" $file
echo "$l"
echo "%%ghost /$file"
%else
echo "/$file"
%endif
done
} | add_dirs_to_filelist >%my_builddir/kernel-devel.files
( cd %buildroot ; find .%obj_install_dir/%cpu_arch_flavor -type f ; ) | \
sed -e 's/^[.]//' | grep -v -e '[.]ipa-clones$' -e '/Symbols[.]list$' -e '/ipa-clones[.]list$'| \
add_dirs_to_filelist >> %my_builddir/kernel-devel.files
@ -880,6 +934,8 @@ add_dirs_to_filelist >> %my_builddir/kernel-devel.files
echo %ghost /boot/initrd$suffix
cd %buildroot
for f in boot/*; do
l="${f##*/}"
l="%modules_dir/${l//-%kernelrelease-%build_flavor}"
if test -L "$f"; then
echo "%%ghost /$f"
continue
@ -895,24 +951,46 @@ add_dirs_to_filelist >> %my_builddir/kernel-devel.files
;;
boot/vmlinux-*)
if $ghost_vmlinux; then
echo "%%ghost /$f"
continue
# fall through to mark next echo as %ghost
echo -n "%%ghost "
fi
;;
%if 0%{?usrmerged}
boot/vmlinuz-*)
echo -n "%%attr(0644, root, root) "
;;
%endif
boot/symtypes*)
%if 0%{?usrmerged}
echo "%exclude $l"
%endif
continue
;;
esac
%if 0%{?usrmerged}
mv "$f" "./$l"
ln -s "..$l" $f
# the find in the CONFIG_MODULES condition below also finds the files
# but there's sort -u later, so this is ok
echo "$l" # note: must be first after case statement above
echo "%%ghost /$f"
%else
echo "%%attr(0644, root, root) /$f"
%endif
done
if [ %CONFIG_MODULES = y ]; then
find lib/modules/%kernelrelease-%build_flavor \
find %{?usrmerged:usr/}lib/modules/%kernelrelease-%build_flavor \
-type d -o \
\( -path '*/modules.*' ! -path '*/modules.order' \
! -path '*/modules.builtin' \
! -path '*/modules.builtin.modinfo' \) -printf '%%%%ghost /%%p\n' \
-o -name '*.ko' -prune -o -type f -printf '/%%p\n'
-o -name '*.ko' -prune \
%if 0%{?usrmerged}
-o \( -type f ! -path '*/symtypes*' ! -path '*/vmlinu*' \) -printf '/%%p\n'
%else
-o -type f -printf '/%%p\n'
%endif
cat %my_builddir/base-modules
fi
if test %CONFIG_MODULE_SIG = "y" -a -d etc/uefi/certs; then
@ -973,15 +1051,15 @@ for f in %my_builddir/*-kmp-modules; do
done
if [ %CONFIG_MODULES = y ]; then
install -m 644 %_sourcedir/modules.fips %{buildroot}/lib/modules/%kernelrelease-%build_flavor/modules.fips
echo /lib/modules/%kernelrelease-%build_flavor/modules.fips >> %my_builddir/kernel-base.files
echo /lib/modules/%kernelrelease-%build_flavor/modules.fips >> %my_builddir/kernel-main.files
install -m 644 %_sourcedir/modules.fips %{buildroot}%modules_dir/modules.fips
echo %modules_dir/modules.fips >> %my_builddir/kernel-base.files
echo %modules_dir/modules.fips >> %my_builddir/kernel-main.files
fi
# Hardlink duplicate files automatically (from package fdupes): It doesn't save
# much, but it keeps rpmlint from breaking the package build. Note that we skip
# /usr/src/linux-obj intentionally, to not accidentally break timestamps there
%fdupes $RPM_BUILD_ROOT/lib
%fdupes %buildroot%modules_dir
%preun -f preun.sh
@ -1161,7 +1239,7 @@ static, unlike the %{patch_package}-<kernel-version>-flavor package names.
%files %{livepatch}
# rpmlint complains about empty packages, so lets own something
%defattr(-, root, root)
%dir /lib/modules/%kernelrelease-%build_flavor
%dir %modules_dir
%endif
%if 0%{?klp_symbols} && "%livepatch" != ""

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Wed Aug 11 06:36:51 CEST 2021 - jslaby@suse.cz
- Revert "Revert "UsrMerge the kernel (boo#1184804)""
This reverts commit b6ab3ded319fca797d007c541a190a308f940cf7. By that,
we reverted the original commit 6f5ed044f52a. But the two problems were
adressed in the meantime, so it's time to try UsrMerge for kernel again.
- commit 2e9639b
-------------------------------------------------------------------
Sun Aug 8 12:50:22 CEST 2021 - jslaby@suse.cz

View File

@ -68,13 +68,27 @@
%define install_vdso 0
%endif
# TW is usrmerged
%if %{undefined usrmerged} && 0%{?suse_version} >= 1550
%define usrmerged 1
%endif
%if 0%{?usrmerged}
%define modules_dir /usr/lib/modules/%kernelrelease-%build_flavor
%define systemmap %{modules_dir}/System.map
%else
%define modules_dir /lib/modules/%kernelrelease-%build_flavor
%define systemmap /boot/System.map-%kernelrelease-%build_flavor
%endif
Name: kernel-debug
Summary: A Debug Version of the Kernel
License: GPL-2.0-only
Group: System/Kernel
Version: 5.13.9
%if 0%{?is_kotd}
Release: <RELEASE>.g19b1d90
Release: <RELEASE>.g2e9639b
%else
Release: 0
%endif
@ -192,10 +206,10 @@ Conflicts: hyper-v < 4
Conflicts: libc.so.6()(64bit)
%endif
Provides: kernel = %version-%source_rel
Provides: kernel-%build_flavor-base-srchash-19b1d907051ab563b934d68bc884105369cabdce
Provides: kernel-srchash-19b1d907051ab563b934d68bc884105369cabdce
Provides: kernel-%build_flavor-base-srchash-2e9639bdfc7b044b86e3953792abd84a679e7ddb
Provides: kernel-srchash-2e9639bdfc7b044b86e3953792abd84a679e7ddb
# END COMMON DEPS
Provides: %name-srchash-19b1d907051ab563b934d68bc884105369cabdce
Provides: %name-srchash-2e9639bdfc7b044b86e3953792abd84a679e7ddb
%ifarch ppc64
Provides: kernel-kdump = 2.6.28
Obsoletes: kernel-kdump <= 2.6.28
@ -623,6 +637,14 @@ 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
@ -718,11 +740,19 @@ add_vmlinux()
# sign the modules, firmware and possibly the kernel in the buildservice
BRP_PESIGN_FILES=""
%if "%CONFIG_EFI_STUB" == "y"
%if 0%{?usrmerged}
BRP_PESIGN_FILES="%modules_dir/$image"
%else
BRP_PESIGN_FILES="/boot/$image-%kernelrelease-%build_flavor"
%endif
%endif
%ifarch s390x ppc64 ppc64le
%if 0%{?usrmerged}
BRP_PESIGN_FILES="%modules_dir/$image"
%else
BRP_PESIGN_FILES="/boot/$image-%kernelrelease-%build_flavor"
%endif
%endif
%if "%CONFIG_MODULE_SIG" == "y"
BRP_PESIGN_FILES="$BRP_PESIGN_FILES *.ko"
%endif
@ -784,6 +814,13 @@ for sub in '' '-extra' \
-e "s:@RPM_TARGET_CPU@:%_target_cpu:g" \
-e "s:@CPU_ARCH_FLAVOR@:%cpu_arch_flavor:g" \
-e "s:@SRCVARIANT@:%variant:g" \
-e "s:@MODULESDIR@:%modules_dir:g" \
-e "s:@SYSTEMMAP@:%systemmap:g" \
%if 0%{?usrmerged}
-e "s:^@USRMERGE@::" \
%else
-e "/^@USRMERGE@/d" \
%endif
%_sourcedir/$script.sh > %my_builddir/$script$sub.sh
if test "$base_package" -eq 1 -a "${#certs[@]}" -gt 0; then
case "$script" in
@ -990,6 +1027,10 @@ 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 '
@ -1002,7 +1043,7 @@ add_dirs_to_filelist() {
# print all parents
:a
# skip directories owned by other packages
s:^%%dir (/boot|/etc|/lib/(modules|firmware)|/usr/src)/[^/]+$::
s:^%%dir (/boot|/etc|(/usr)?/lib/(modules|firmware)|/usr/src)/[^/]+$::
s:/[^/]+$::p
ta
' "$@" | sort -u
@ -1019,10 +1060,23 @@ fi
%endif
shopt -s nullglob dotglob
> %my_builddir/kernel-devel.files
for file in %buildroot/boot/symtypes* %buildroot/lib/modules/*/{build,source}; do
f=${file##%buildroot}
echo "$f"
done | add_dirs_to_filelist >%my_builddir/kernel-devel.files
{
echo "%modules_dir/build"
echo "%modules_dir/source"
cd %buildroot
for file in boot/symtypes*; do
%if 0%{?usrmerged}
l="${file##*/}"
l="%modules_dir/${l//-%kernelrelease-%build_flavor}"
mv "$file" "%{buildroot}$l"
ln -s "..$l" $file
echo "$l"
echo "%%ghost /$file"
%else
echo "/$file"
%endif
done
} | add_dirs_to_filelist >%my_builddir/kernel-devel.files
( cd %buildroot ; find .%obj_install_dir/%cpu_arch_flavor -type f ; ) | \
sed -e 's/^[.]//' | grep -v -e '[.]ipa-clones$' -e '/Symbols[.]list$' -e '/ipa-clones[.]list$'| \
add_dirs_to_filelist >> %my_builddir/kernel-devel.files
@ -1031,6 +1085,8 @@ add_dirs_to_filelist >> %my_builddir/kernel-devel.files
echo %ghost /boot/initrd$suffix
cd %buildroot
for f in boot/*; do
l="${f##*/}"
l="%modules_dir/${l//-%kernelrelease-%build_flavor}"
if test -L "$f"; then
echo "%%ghost /$f"
continue
@ -1046,24 +1102,46 @@ add_dirs_to_filelist >> %my_builddir/kernel-devel.files
;;
boot/vmlinux-*)
if $ghost_vmlinux; then
echo "%%ghost /$f"
continue
# fall through to mark next echo as %ghost
echo -n "%%ghost "
fi
;;
%if 0%{?usrmerged}
boot/vmlinuz-*)
echo -n "%%attr(0644, root, root) "
;;
%endif
boot/symtypes*)
%if 0%{?usrmerged}
echo "%exclude $l"
%endif
continue
;;
esac
%if 0%{?usrmerged}
mv "$f" "./$l"
ln -s "..$l" $f
# the find in the CONFIG_MODULES condition below also finds the files
# but there's sort -u later, so this is ok
echo "$l" # note: must be first after case statement above
echo "%%ghost /$f"
%else
echo "%%attr(0644, root, root) /$f"
%endif
done
if [ %CONFIG_MODULES = y ]; then
find lib/modules/%kernelrelease-%build_flavor \
find %{?usrmerged:usr/}lib/modules/%kernelrelease-%build_flavor \
-type d -o \
\( -path '*/modules.*' ! -path '*/modules.order' \
! -path '*/modules.builtin' \
! -path '*/modules.builtin.modinfo' \) -printf '%%%%ghost /%%p\n' \
-o -name '*.ko' -prune -o -type f -printf '/%%p\n'
-o -name '*.ko' -prune \
%if 0%{?usrmerged}
-o \( -type f ! -path '*/symtypes*' ! -path '*/vmlinu*' \) -printf '/%%p\n'
%else
-o -type f -printf '/%%p\n'
%endif
cat %my_builddir/base-modules
fi
if test %CONFIG_MODULE_SIG = "y" -a -d etc/uefi/certs; then
@ -1124,15 +1202,15 @@ for f in %my_builddir/*-kmp-modules; do
done
if [ %CONFIG_MODULES = y ]; then
install -m 644 %_sourcedir/modules.fips %{buildroot}/lib/modules/%kernelrelease-%build_flavor/modules.fips
echo /lib/modules/%kernelrelease-%build_flavor/modules.fips >> %my_builddir/kernel-base.files
echo /lib/modules/%kernelrelease-%build_flavor/modules.fips >> %my_builddir/kernel-main.files
install -m 644 %_sourcedir/modules.fips %{buildroot}%modules_dir/modules.fips
echo %modules_dir/modules.fips >> %my_builddir/kernel-base.files
echo %modules_dir/modules.fips >> %my_builddir/kernel-main.files
fi
# Hardlink duplicate files automatically (from package fdupes): It doesn't save
# much, but it keeps rpmlint from breaking the package build. Note that we skip
# /usr/src/linux-obj intentionally, to not accidentally break timestamps there
%fdupes $RPM_BUILD_ROOT/lib
%fdupes %buildroot%modules_dir
%preun -f preun.sh
@ -1323,7 +1401,7 @@ static, unlike the %{patch_package}-<kernel-version>-flavor package names.
%files %{livepatch}
# rpmlint complains about empty packages, so lets own something
%defattr(-, root, root)
%dir /lib/modules/%kernelrelease-%build_flavor
%dir %modules_dir
%endif
%if 0%{?klp_symbols} && "%livepatch" != ""

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Wed Aug 11 06:36:51 CEST 2021 - jslaby@suse.cz
- Revert "Revert "UsrMerge the kernel (boo#1184804)""
This reverts commit b6ab3ded319fca797d007c541a190a308f940cf7. By that,
we reverted the original commit 6f5ed044f52a. But the two problems were
adressed in the meantime, so it's time to try UsrMerge for kernel again.
- commit 2e9639b
-------------------------------------------------------------------
Sun Aug 8 12:50:22 CEST 2021 - jslaby@suse.cz

View File

@ -68,13 +68,27 @@
%define install_vdso 0
%endif
# TW is usrmerged
%if %{undefined usrmerged} && 0%{?suse_version} >= 1550
%define usrmerged 1
%endif
%if 0%{?usrmerged}
%define modules_dir /usr/lib/modules/%kernelrelease-%build_flavor
%define systemmap %{modules_dir}/System.map
%else
%define modules_dir /lib/modules/%kernelrelease-%build_flavor
%define systemmap /boot/System.map-%kernelrelease-%build_flavor
%endif
Name: kernel-default
Summary: The Standard Kernel
License: GPL-2.0-only
Group: System/Kernel
Version: 5.13.9
%if 0%{?is_kotd}
Release: <RELEASE>.g19b1d90
Release: <RELEASE>.g2e9639b
%else
Release: 0
%endif
@ -192,10 +206,10 @@ Conflicts: hyper-v < 4
Conflicts: libc.so.6()(64bit)
%endif
Provides: kernel = %version-%source_rel
Provides: kernel-%build_flavor-base-srchash-19b1d907051ab563b934d68bc884105369cabdce
Provides: kernel-srchash-19b1d907051ab563b934d68bc884105369cabdce
Provides: kernel-%build_flavor-base-srchash-2e9639bdfc7b044b86e3953792abd84a679e7ddb
Provides: kernel-srchash-2e9639bdfc7b044b86e3953792abd84a679e7ddb
# END COMMON DEPS
Provides: %name-srchash-19b1d907051ab563b934d68bc884105369cabdce
Provides: %name-srchash-2e9639bdfc7b044b86e3953792abd84a679e7ddb
%ifarch %ix86
Provides: kernel-smp = 2.6.17
Obsoletes: kernel-smp <= 2.6.17
@ -666,6 +680,14 @@ 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
@ -761,11 +783,19 @@ add_vmlinux()
# sign the modules, firmware and possibly the kernel in the buildservice
BRP_PESIGN_FILES=""
%if "%CONFIG_EFI_STUB" == "y"
%if 0%{?usrmerged}
BRP_PESIGN_FILES="%modules_dir/$image"
%else
BRP_PESIGN_FILES="/boot/$image-%kernelrelease-%build_flavor"
%endif
%endif
%ifarch s390x ppc64 ppc64le
%if 0%{?usrmerged}
BRP_PESIGN_FILES="%modules_dir/$image"
%else
BRP_PESIGN_FILES="/boot/$image-%kernelrelease-%build_flavor"
%endif
%endif
%if "%CONFIG_MODULE_SIG" == "y"
BRP_PESIGN_FILES="$BRP_PESIGN_FILES *.ko"
%endif
@ -827,6 +857,13 @@ for sub in '' '-extra' \
-e "s:@RPM_TARGET_CPU@:%_target_cpu:g" \
-e "s:@CPU_ARCH_FLAVOR@:%cpu_arch_flavor:g" \
-e "s:@SRCVARIANT@:%variant:g" \
-e "s:@MODULESDIR@:%modules_dir:g" \
-e "s:@SYSTEMMAP@:%systemmap:g" \
%if 0%{?usrmerged}
-e "s:^@USRMERGE@::" \
%else
-e "/^@USRMERGE@/d" \
%endif
%_sourcedir/$script.sh > %my_builddir/$script$sub.sh
if test "$base_package" -eq 1 -a "${#certs[@]}" -gt 0; then
case "$script" in
@ -1033,6 +1070,10 @@ 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 '
@ -1045,7 +1086,7 @@ add_dirs_to_filelist() {
# print all parents
:a
# skip directories owned by other packages
s:^%%dir (/boot|/etc|/lib/(modules|firmware)|/usr/src)/[^/]+$::
s:^%%dir (/boot|/etc|(/usr)?/lib/(modules|firmware)|/usr/src)/[^/]+$::
s:/[^/]+$::p
ta
' "$@" | sort -u
@ -1062,10 +1103,23 @@ fi
%endif
shopt -s nullglob dotglob
> %my_builddir/kernel-devel.files
for file in %buildroot/boot/symtypes* %buildroot/lib/modules/*/{build,source}; do
f=${file##%buildroot}
echo "$f"
done | add_dirs_to_filelist >%my_builddir/kernel-devel.files
{
echo "%modules_dir/build"
echo "%modules_dir/source"
cd %buildroot
for file in boot/symtypes*; do
%if 0%{?usrmerged}
l="${file##*/}"
l="%modules_dir/${l//-%kernelrelease-%build_flavor}"
mv "$file" "%{buildroot}$l"
ln -s "..$l" $file
echo "$l"
echo "%%ghost /$file"
%else
echo "/$file"
%endif
done
} | add_dirs_to_filelist >%my_builddir/kernel-devel.files
( cd %buildroot ; find .%obj_install_dir/%cpu_arch_flavor -type f ; ) | \
sed -e 's/^[.]//' | grep -v -e '[.]ipa-clones$' -e '/Symbols[.]list$' -e '/ipa-clones[.]list$'| \
add_dirs_to_filelist >> %my_builddir/kernel-devel.files
@ -1074,6 +1128,8 @@ add_dirs_to_filelist >> %my_builddir/kernel-devel.files
echo %ghost /boot/initrd$suffix
cd %buildroot
for f in boot/*; do
l="${f##*/}"
l="%modules_dir/${l//-%kernelrelease-%build_flavor}"
if test -L "$f"; then
echo "%%ghost /$f"
continue
@ -1089,24 +1145,46 @@ add_dirs_to_filelist >> %my_builddir/kernel-devel.files
;;
boot/vmlinux-*)
if $ghost_vmlinux; then
echo "%%ghost /$f"
continue
# fall through to mark next echo as %ghost
echo -n "%%ghost "
fi
;;
%if 0%{?usrmerged}
boot/vmlinuz-*)
echo -n "%%attr(0644, root, root) "
;;
%endif
boot/symtypes*)
%if 0%{?usrmerged}
echo "%exclude $l"
%endif
continue
;;
esac
%if 0%{?usrmerged}
mv "$f" "./$l"
ln -s "..$l" $f
# the find in the CONFIG_MODULES condition below also finds the files
# but there's sort -u later, so this is ok
echo "$l" # note: must be first after case statement above
echo "%%ghost /$f"
%else
echo "%%attr(0644, root, root) /$f"
%endif
done
if [ %CONFIG_MODULES = y ]; then
find lib/modules/%kernelrelease-%build_flavor \
find %{?usrmerged:usr/}lib/modules/%kernelrelease-%build_flavor \
-type d -o \
\( -path '*/modules.*' ! -path '*/modules.order' \
! -path '*/modules.builtin' \
! -path '*/modules.builtin.modinfo' \) -printf '%%%%ghost /%%p\n' \
-o -name '*.ko' -prune -o -type f -printf '/%%p\n'
-o -name '*.ko' -prune \
%if 0%{?usrmerged}
-o \( -type f ! -path '*/symtypes*' ! -path '*/vmlinu*' \) -printf '/%%p\n'
%else
-o -type f -printf '/%%p\n'
%endif
cat %my_builddir/base-modules
fi
if test %CONFIG_MODULE_SIG = "y" -a -d etc/uefi/certs; then
@ -1167,15 +1245,15 @@ for f in %my_builddir/*-kmp-modules; do
done
if [ %CONFIG_MODULES = y ]; then
install -m 644 %_sourcedir/modules.fips %{buildroot}/lib/modules/%kernelrelease-%build_flavor/modules.fips
echo /lib/modules/%kernelrelease-%build_flavor/modules.fips >> %my_builddir/kernel-base.files
echo /lib/modules/%kernelrelease-%build_flavor/modules.fips >> %my_builddir/kernel-main.files
install -m 644 %_sourcedir/modules.fips %{buildroot}%modules_dir/modules.fips
echo %modules_dir/modules.fips >> %my_builddir/kernel-base.files
echo %modules_dir/modules.fips >> %my_builddir/kernel-main.files
fi
# Hardlink duplicate files automatically (from package fdupes): It doesn't save
# much, but it keeps rpmlint from breaking the package build. Note that we skip
# /usr/src/linux-obj intentionally, to not accidentally break timestamps there
%fdupes $RPM_BUILD_ROOT/lib
%fdupes %buildroot%modules_dir
%preun -f preun.sh
@ -1424,7 +1502,7 @@ static, unlike the %{patch_package}-<kernel-version>-flavor package names.
%files %{livepatch}
# rpmlint complains about empty packages, so lets own something
%defattr(-, root, root)
%dir /lib/modules/%kernelrelease-%build_flavor
%dir %modules_dir
%endif
%if 0%{?klp_symbols} && "%livepatch" != ""

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Wed Aug 11 06:36:51 CEST 2021 - jslaby@suse.cz
- Revert "Revert "UsrMerge the kernel (boo#1184804)""
This reverts commit b6ab3ded319fca797d007c541a190a308f940cf7. By that,
we reverted the original commit 6f5ed044f52a. But the two problems were
adressed in the meantime, so it's time to try UsrMerge for kernel again.
- commit 2e9639b
-------------------------------------------------------------------
Sun Aug 8 12:50:22 CEST 2021 - jslaby@suse.cz

View File

@ -33,7 +33,7 @@ License: GPL-2.0-only
Group: Documentation/Man
Version: 5.13.9
%if 0%{?is_kotd}
Release: <RELEASE>.g19b1d90
Release: <RELEASE>.g2e9639b
%else
Release: 0
%endif
@ -64,7 +64,7 @@ BuildRequires: texlive-zapfding
%endif
Url: http://www.kernel.org/
Provides: %name = %version-%source_rel
Provides: %name-srchash-19b1d907051ab563b934d68bc884105369cabdce
Provides: %name-srchash-2e9639bdfc7b044b86e3953792abd84a679e7ddb
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source0: http://www.kernel.org/pub/linux/kernel/v5.x/linux-%srcversion.tar.xz

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Wed Aug 11 06:36:51 CEST 2021 - jslaby@suse.cz
- Revert "Revert "UsrMerge the kernel (boo#1184804)""
This reverts commit b6ab3ded319fca797d007c541a190a308f940cf7. By that,
we reverted the original commit 6f5ed044f52a. But the two problems were
adressed in the meantime, so it's time to try UsrMerge for kernel again.
- commit 2e9639b
-------------------------------------------------------------------
Sun Aug 8 12:50:22 CEST 2021 - jslaby@suse.cz

View File

@ -68,13 +68,27 @@
%define install_vdso 0
%endif
# TW is usrmerged
%if %{undefined usrmerged} && 0%{?suse_version} >= 1550
%define usrmerged 1
%endif
%if 0%{?usrmerged}
%define modules_dir /usr/lib/modules/%kernelrelease-%build_flavor
%define systemmap %{modules_dir}/System.map
%else
%define modules_dir /lib/modules/%kernelrelease-%build_flavor
%define systemmap /boot/System.map-%kernelrelease-%build_flavor
%endif
Name: kernel-kvmsmall
Summary: The Small Developer Kernel for KVM
License: GPL-2.0-only
Group: System/Kernel
Version: 5.13.9
%if 0%{?is_kotd}
Release: <RELEASE>.g19b1d90
Release: <RELEASE>.g2e9639b
%else
Release: 0
%endif
@ -192,10 +206,10 @@ Conflicts: hyper-v < 4
Conflicts: libc.so.6()(64bit)
%endif
Provides: kernel = %version-%source_rel
Provides: kernel-%build_flavor-base-srchash-19b1d907051ab563b934d68bc884105369cabdce
Provides: kernel-srchash-19b1d907051ab563b934d68bc884105369cabdce
Provides: kernel-%build_flavor-base-srchash-2e9639bdfc7b044b86e3953792abd84a679e7ddb
Provides: kernel-srchash-2e9639bdfc7b044b86e3953792abd84a679e7ddb
# END COMMON DEPS
Provides: %name-srchash-19b1d907051ab563b934d68bc884105369cabdce
Provides: %name-srchash-2e9639bdfc7b044b86e3953792abd84a679e7ddb
%obsolete_rebuilds %name
Source0: http://www.kernel.org/pub/linux/kernel/v5.x/linux-%srcversion.tar.xz
Source2: source-post.sh
@ -621,6 +635,14 @@ 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
@ -716,11 +738,19 @@ add_vmlinux()
# sign the modules, firmware and possibly the kernel in the buildservice
BRP_PESIGN_FILES=""
%if "%CONFIG_EFI_STUB" == "y"
%if 0%{?usrmerged}
BRP_PESIGN_FILES="%modules_dir/$image"
%else
BRP_PESIGN_FILES="/boot/$image-%kernelrelease-%build_flavor"
%endif
%endif
%ifarch s390x ppc64 ppc64le
%if 0%{?usrmerged}
BRP_PESIGN_FILES="%modules_dir/$image"
%else
BRP_PESIGN_FILES="/boot/$image-%kernelrelease-%build_flavor"
%endif
%endif
%if "%CONFIG_MODULE_SIG" == "y"
BRP_PESIGN_FILES="$BRP_PESIGN_FILES *.ko"
%endif
@ -782,6 +812,13 @@ for sub in '' '-extra' \
-e "s:@RPM_TARGET_CPU@:%_target_cpu:g" \
-e "s:@CPU_ARCH_FLAVOR@:%cpu_arch_flavor:g" \
-e "s:@SRCVARIANT@:%variant:g" \
-e "s:@MODULESDIR@:%modules_dir:g" \
-e "s:@SYSTEMMAP@:%systemmap:g" \
%if 0%{?usrmerged}
-e "s:^@USRMERGE@::" \
%else
-e "/^@USRMERGE@/d" \
%endif
%_sourcedir/$script.sh > %my_builddir/$script$sub.sh
if test "$base_package" -eq 1 -a "${#certs[@]}" -gt 0; then
case "$script" in
@ -988,6 +1025,10 @@ 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 '
@ -1000,7 +1041,7 @@ add_dirs_to_filelist() {
# print all parents
:a
# skip directories owned by other packages
s:^%%dir (/boot|/etc|/lib/(modules|firmware)|/usr/src)/[^/]+$::
s:^%%dir (/boot|/etc|(/usr)?/lib/(modules|firmware)|/usr/src)/[^/]+$::
s:/[^/]+$::p
ta
' "$@" | sort -u
@ -1017,10 +1058,23 @@ fi
%endif
shopt -s nullglob dotglob
> %my_builddir/kernel-devel.files
for file in %buildroot/boot/symtypes* %buildroot/lib/modules/*/{build,source}; do
f=${file##%buildroot}
echo "$f"
done | add_dirs_to_filelist >%my_builddir/kernel-devel.files
{
echo "%modules_dir/build"
echo "%modules_dir/source"
cd %buildroot
for file in boot/symtypes*; do
%if 0%{?usrmerged}
l="${file##*/}"
l="%modules_dir/${l//-%kernelrelease-%build_flavor}"
mv "$file" "%{buildroot}$l"
ln -s "..$l" $file
echo "$l"
echo "%%ghost /$file"
%else
echo "/$file"
%endif
done
} | add_dirs_to_filelist >%my_builddir/kernel-devel.files
( cd %buildroot ; find .%obj_install_dir/%cpu_arch_flavor -type f ; ) | \
sed -e 's/^[.]//' | grep -v -e '[.]ipa-clones$' -e '/Symbols[.]list$' -e '/ipa-clones[.]list$'| \
add_dirs_to_filelist >> %my_builddir/kernel-devel.files
@ -1029,6 +1083,8 @@ add_dirs_to_filelist >> %my_builddir/kernel-devel.files
echo %ghost /boot/initrd$suffix
cd %buildroot
for f in boot/*; do
l="${f##*/}"
l="%modules_dir/${l//-%kernelrelease-%build_flavor}"
if test -L "$f"; then
echo "%%ghost /$f"
continue
@ -1044,24 +1100,46 @@ add_dirs_to_filelist >> %my_builddir/kernel-devel.files
;;
boot/vmlinux-*)
if $ghost_vmlinux; then
echo "%%ghost /$f"
continue
# fall through to mark next echo as %ghost
echo -n "%%ghost "
fi
;;
%if 0%{?usrmerged}
boot/vmlinuz-*)
echo -n "%%attr(0644, root, root) "
;;
%endif
boot/symtypes*)
%if 0%{?usrmerged}
echo "%exclude $l"
%endif
continue
;;
esac
%if 0%{?usrmerged}
mv "$f" "./$l"
ln -s "..$l" $f
# the find in the CONFIG_MODULES condition below also finds the files
# but there's sort -u later, so this is ok
echo "$l" # note: must be first after case statement above
echo "%%ghost /$f"
%else
echo "%%attr(0644, root, root) /$f"
%endif
done
if [ %CONFIG_MODULES = y ]; then
find lib/modules/%kernelrelease-%build_flavor \
find %{?usrmerged:usr/}lib/modules/%kernelrelease-%build_flavor \
-type d -o \
\( -path '*/modules.*' ! -path '*/modules.order' \
! -path '*/modules.builtin' \
! -path '*/modules.builtin.modinfo' \) -printf '%%%%ghost /%%p\n' \
-o -name '*.ko' -prune -o -type f -printf '/%%p\n'
-o -name '*.ko' -prune \
%if 0%{?usrmerged}
-o \( -type f ! -path '*/symtypes*' ! -path '*/vmlinu*' \) -printf '/%%p\n'
%else
-o -type f -printf '/%%p\n'
%endif
cat %my_builddir/base-modules
fi
if test %CONFIG_MODULE_SIG = "y" -a -d etc/uefi/certs; then
@ -1122,15 +1200,15 @@ for f in %my_builddir/*-kmp-modules; do
done
if [ %CONFIG_MODULES = y ]; then
install -m 644 %_sourcedir/modules.fips %{buildroot}/lib/modules/%kernelrelease-%build_flavor/modules.fips
echo /lib/modules/%kernelrelease-%build_flavor/modules.fips >> %my_builddir/kernel-base.files
echo /lib/modules/%kernelrelease-%build_flavor/modules.fips >> %my_builddir/kernel-main.files
install -m 644 %_sourcedir/modules.fips %{buildroot}%modules_dir/modules.fips
echo %modules_dir/modules.fips >> %my_builddir/kernel-base.files
echo %modules_dir/modules.fips >> %my_builddir/kernel-main.files
fi
# Hardlink duplicate files automatically (from package fdupes): It doesn't save
# much, but it keeps rpmlint from breaking the package build. Note that we skip
# /usr/src/linux-obj intentionally, to not accidentally break timestamps there
%fdupes $RPM_BUILD_ROOT/lib
%fdupes %buildroot%modules_dir
%preun -f preun.sh
@ -1321,7 +1399,7 @@ static, unlike the %{patch_package}-<kernel-version>-flavor package names.
%files %{livepatch}
# rpmlint complains about empty packages, so lets own something
%defattr(-, root, root)
%dir /lib/modules/%kernelrelease-%build_flavor
%dir %modules_dir
%endif
%if 0%{?klp_symbols} && "%livepatch" != ""

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Wed Aug 11 06:36:51 CEST 2021 - jslaby@suse.cz
- Revert "Revert "UsrMerge the kernel (boo#1184804)""
This reverts commit b6ab3ded319fca797d007c541a190a308f940cf7. By that,
we reverted the original commit 6f5ed044f52a. But the two problems were
adressed in the meantime, so it's time to try UsrMerge for kernel again.
- commit 2e9639b
-------------------------------------------------------------------
Sun Aug 8 12:50:22 CEST 2021 - jslaby@suse.cz

View File

@ -68,13 +68,27 @@
%define install_vdso 0
%endif
# TW is usrmerged
%if %{undefined usrmerged} && 0%{?suse_version} >= 1550
%define usrmerged 1
%endif
%if 0%{?usrmerged}
%define modules_dir /usr/lib/modules/%kernelrelease-%build_flavor
%define systemmap %{modules_dir}/System.map
%else
%define modules_dir /lib/modules/%kernelrelease-%build_flavor
%define systemmap /boot/System.map-%kernelrelease-%build_flavor
%endif
Name: kernel-lpae
Summary: Kernel for LPAE enabled systems
License: GPL-2.0-only
Group: System/Kernel
Version: 5.13.9
%if 0%{?is_kotd}
Release: <RELEASE>.g19b1d90
Release: <RELEASE>.g2e9639b
%else
Release: 0
%endif
@ -192,10 +206,10 @@ Conflicts: hyper-v < 4
Conflicts: libc.so.6()(64bit)
%endif
Provides: kernel = %version-%source_rel
Provides: kernel-%build_flavor-base-srchash-19b1d907051ab563b934d68bc884105369cabdce
Provides: kernel-srchash-19b1d907051ab563b934d68bc884105369cabdce
Provides: kernel-%build_flavor-base-srchash-2e9639bdfc7b044b86e3953792abd84a679e7ddb
Provides: kernel-srchash-2e9639bdfc7b044b86e3953792abd84a679e7ddb
# END COMMON DEPS
Provides: %name-srchash-19b1d907051ab563b934d68bc884105369cabdce
Provides: %name-srchash-2e9639bdfc7b044b86e3953792abd84a679e7ddb
%obsolete_rebuilds %name
Source0: http://www.kernel.org/pub/linux/kernel/v5.x/linux-%srcversion.tar.xz
Source2: source-post.sh
@ -615,6 +629,14 @@ 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
@ -710,11 +732,19 @@ add_vmlinux()
# sign the modules, firmware and possibly the kernel in the buildservice
BRP_PESIGN_FILES=""
%if "%CONFIG_EFI_STUB" == "y"
%if 0%{?usrmerged}
BRP_PESIGN_FILES="%modules_dir/$image"
%else
BRP_PESIGN_FILES="/boot/$image-%kernelrelease-%build_flavor"
%endif
%endif
%ifarch s390x ppc64 ppc64le
%if 0%{?usrmerged}
BRP_PESIGN_FILES="%modules_dir/$image"
%else
BRP_PESIGN_FILES="/boot/$image-%kernelrelease-%build_flavor"
%endif
%endif
%if "%CONFIG_MODULE_SIG" == "y"
BRP_PESIGN_FILES="$BRP_PESIGN_FILES *.ko"
%endif
@ -776,6 +806,13 @@ for sub in '' '-extra' \
-e "s:@RPM_TARGET_CPU@:%_target_cpu:g" \
-e "s:@CPU_ARCH_FLAVOR@:%cpu_arch_flavor:g" \
-e "s:@SRCVARIANT@:%variant:g" \
-e "s:@MODULESDIR@:%modules_dir:g" \
-e "s:@SYSTEMMAP@:%systemmap:g" \
%if 0%{?usrmerged}
-e "s:^@USRMERGE@::" \
%else
-e "/^@USRMERGE@/d" \
%endif
%_sourcedir/$script.sh > %my_builddir/$script$sub.sh
if test "$base_package" -eq 1 -a "${#certs[@]}" -gt 0; then
case "$script" in
@ -982,6 +1019,10 @@ 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 '
@ -994,7 +1035,7 @@ add_dirs_to_filelist() {
# print all parents
:a
# skip directories owned by other packages
s:^%%dir (/boot|/etc|/lib/(modules|firmware)|/usr/src)/[^/]+$::
s:^%%dir (/boot|/etc|(/usr)?/lib/(modules|firmware)|/usr/src)/[^/]+$::
s:/[^/]+$::p
ta
' "$@" | sort -u
@ -1011,10 +1052,23 @@ fi
%endif
shopt -s nullglob dotglob
> %my_builddir/kernel-devel.files
for file in %buildroot/boot/symtypes* %buildroot/lib/modules/*/{build,source}; do
f=${file##%buildroot}
echo "$f"
done | add_dirs_to_filelist >%my_builddir/kernel-devel.files
{
echo "%modules_dir/build"
echo "%modules_dir/source"
cd %buildroot
for file in boot/symtypes*; do
%if 0%{?usrmerged}
l="${file##*/}"
l="%modules_dir/${l//-%kernelrelease-%build_flavor}"
mv "$file" "%{buildroot}$l"
ln -s "..$l" $file
echo "$l"
echo "%%ghost /$file"
%else
echo "/$file"
%endif
done
} | add_dirs_to_filelist >%my_builddir/kernel-devel.files
( cd %buildroot ; find .%obj_install_dir/%cpu_arch_flavor -type f ; ) | \
sed -e 's/^[.]//' | grep -v -e '[.]ipa-clones$' -e '/Symbols[.]list$' -e '/ipa-clones[.]list$'| \
add_dirs_to_filelist >> %my_builddir/kernel-devel.files
@ -1023,6 +1077,8 @@ add_dirs_to_filelist >> %my_builddir/kernel-devel.files
echo %ghost /boot/initrd$suffix
cd %buildroot
for f in boot/*; do
l="${f##*/}"
l="%modules_dir/${l//-%kernelrelease-%build_flavor}"
if test -L "$f"; then
echo "%%ghost /$f"
continue
@ -1038,24 +1094,46 @@ add_dirs_to_filelist >> %my_builddir/kernel-devel.files
;;
boot/vmlinux-*)
if $ghost_vmlinux; then
echo "%%ghost /$f"
continue
# fall through to mark next echo as %ghost
echo -n "%%ghost "
fi
;;
%if 0%{?usrmerged}
boot/vmlinuz-*)
echo -n "%%attr(0644, root, root) "
;;
%endif
boot/symtypes*)
%if 0%{?usrmerged}
echo "%exclude $l"
%endif
continue
;;
esac
%if 0%{?usrmerged}
mv "$f" "./$l"
ln -s "..$l" $f
# the find in the CONFIG_MODULES condition below also finds the files
# but there's sort -u later, so this is ok
echo "$l" # note: must be first after case statement above
echo "%%ghost /$f"
%else
echo "%%attr(0644, root, root) /$f"
%endif
done
if [ %CONFIG_MODULES = y ]; then
find lib/modules/%kernelrelease-%build_flavor \
find %{?usrmerged:usr/}lib/modules/%kernelrelease-%build_flavor \
-type d -o \
\( -path '*/modules.*' ! -path '*/modules.order' \
! -path '*/modules.builtin' \
! -path '*/modules.builtin.modinfo' \) -printf '%%%%ghost /%%p\n' \
-o -name '*.ko' -prune -o -type f -printf '/%%p\n'
-o -name '*.ko' -prune \
%if 0%{?usrmerged}
-o \( -type f ! -path '*/symtypes*' ! -path '*/vmlinu*' \) -printf '/%%p\n'
%else
-o -type f -printf '/%%p\n'
%endif
cat %my_builddir/base-modules
fi
if test %CONFIG_MODULE_SIG = "y" -a -d etc/uefi/certs; then
@ -1116,15 +1194,15 @@ for f in %my_builddir/*-kmp-modules; do
done
if [ %CONFIG_MODULES = y ]; then
install -m 644 %_sourcedir/modules.fips %{buildroot}/lib/modules/%kernelrelease-%build_flavor/modules.fips
echo /lib/modules/%kernelrelease-%build_flavor/modules.fips >> %my_builddir/kernel-base.files
echo /lib/modules/%kernelrelease-%build_flavor/modules.fips >> %my_builddir/kernel-main.files
install -m 644 %_sourcedir/modules.fips %{buildroot}%modules_dir/modules.fips
echo %modules_dir/modules.fips >> %my_builddir/kernel-base.files
echo %modules_dir/modules.fips >> %my_builddir/kernel-main.files
fi
# Hardlink duplicate files automatically (from package fdupes): It doesn't save
# much, but it keeps rpmlint from breaking the package build. Note that we skip
# /usr/src/linux-obj intentionally, to not accidentally break timestamps there
%fdupes $RPM_BUILD_ROOT/lib
%fdupes %buildroot%modules_dir
%preun -f preun.sh
@ -1303,7 +1381,7 @@ static, unlike the %{patch_package}-<kernel-version>-flavor package names.
%files %{livepatch}
# rpmlint complains about empty packages, so lets own something
%defattr(-, root, root)
%dir /lib/modules/%kernelrelease-%build_flavor
%dir %modules_dir
%endif
%if 0%{?klp_symbols} && "%livepatch" != ""

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Wed Aug 11 06:36:51 CEST 2021 - jslaby@suse.cz
- Revert "Revert "UsrMerge the kernel (boo#1184804)""
This reverts commit b6ab3ded319fca797d007c541a190a308f940cf7. By that,
we reverted the original commit 6f5ed044f52a. But the two problems were
adressed in the meantime, so it's time to try UsrMerge for kernel again.
- commit 2e9639b
-------------------------------------------------------------------
Sun Aug 8 12:50:22 CEST 2021 - jslaby@suse.cz

View File

@ -45,7 +45,7 @@ BuildRequires: util-linux
%endif
%endif
%endif
BuildRequires: kernel%kernel_flavor-srchash-19b1d907051ab563b934d68bc884105369cabdce
BuildRequires: kernel%kernel_flavor-srchash-2e9639bdfc7b044b86e3953792abd84a679e7ddb
%if 0%{?rhel_version}
BuildRequires: kernel
@ -66,7 +66,7 @@ License: GPL-2.0-only
Group: SLES
Version: 5.13.9
%if 0%{?is_kotd}
Release: <RELEASE>.g19b1d90
Release: <RELEASE>.g2e9639b
%else
Release: 0
%endif

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Wed Aug 11 06:36:51 CEST 2021 - jslaby@suse.cz
- Revert "Revert "UsrMerge the kernel (boo#1184804)""
This reverts commit b6ab3ded319fca797d007c541a190a308f940cf7. By that,
we reverted the original commit 6f5ed044f52a. But the two problems were
adressed in the meantime, so it's time to try UsrMerge for kernel again.
- commit 2e9639b
-------------------------------------------------------------------
Sun Aug 8 12:50:22 CEST 2021 - jslaby@suse.cz

View File

@ -38,7 +38,7 @@ License: GPL-2.0-only
Group: SLES
Version: 5.13.9
%if 0%{?is_kotd}
Release: <RELEASE>.g19b1d90
Release: <RELEASE>.g2e9639b
%else
Release: 0
%endif
@ -60,7 +60,7 @@ projects and runs basic tests.
# and called here.
krel=$(uname -r)
if test ! -d "/lib/modules/$krel/kernel"; then
if test ! -d "/lib/modules/$krel/kernel" && test ! -d "/usr/lib/modules/$krel/kernel"; then
echo "Kernel package for $krel not installed; exiting"
exit 0
fi

View File

@ -60,7 +60,7 @@ projects and runs basic tests.
# and called here.
krel=$(uname -r)
if test ! -d "/lib/modules/$krel/kernel"; then
if test ! -d "/lib/modules/$krel/kernel" && test ! -d "/usr/lib/modules/$krel/kernel"; then
echo "Kernel package for $krel not installed; exiting"
exit 0
fi

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Wed Aug 11 06:36:51 CEST 2021 - jslaby@suse.cz
- Revert "Revert "UsrMerge the kernel (boo#1184804)""
This reverts commit b6ab3ded319fca797d007c541a190a308f940cf7. By that,
we reverted the original commit 6f5ed044f52a. But the two problems were
adressed in the meantime, so it's time to try UsrMerge for kernel again.
- commit 2e9639b
-------------------------------------------------------------------
Sun Aug 8 12:50:22 CEST 2021 - jslaby@suse.cz

View File

@ -68,13 +68,27 @@
%define install_vdso 0
%endif
# TW is usrmerged
%if %{undefined usrmerged} && 0%{?suse_version} >= 1550
%define usrmerged 1
%endif
%if 0%{?usrmerged}
%define modules_dir /usr/lib/modules/%kernelrelease-%build_flavor
%define systemmap %{modules_dir}/System.map
%else
%define modules_dir /lib/modules/%kernelrelease-%build_flavor
%define systemmap /boot/System.map-%kernelrelease-%build_flavor
%endif
Name: kernel-pae
Summary: Kernel with PAE Support
License: GPL-2.0-only
Group: System/Kernel
Version: 5.13.9
%if 0%{?is_kotd}
Release: <RELEASE>.g19b1d90
Release: <RELEASE>.g2e9639b
%else
Release: 0
%endif
@ -192,10 +206,10 @@ Conflicts: hyper-v < 4
Conflicts: libc.so.6()(64bit)
%endif
Provides: kernel = %version-%source_rel
Provides: kernel-%build_flavor-base-srchash-19b1d907051ab563b934d68bc884105369cabdce
Provides: kernel-srchash-19b1d907051ab563b934d68bc884105369cabdce
Provides: kernel-%build_flavor-base-srchash-2e9639bdfc7b044b86e3953792abd84a679e7ddb
Provides: kernel-srchash-2e9639bdfc7b044b86e3953792abd84a679e7ddb
# END COMMON DEPS
Provides: %name-srchash-19b1d907051ab563b934d68bc884105369cabdce
Provides: %name-srchash-2e9639bdfc7b044b86e3953792abd84a679e7ddb
%ifarch %ix86
Provides: kernel-bigsmp = 2.6.17
Obsoletes: kernel-bigsmp <= 2.6.17
@ -643,6 +657,14 @@ 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
@ -738,11 +760,19 @@ add_vmlinux()
# sign the modules, firmware and possibly the kernel in the buildservice
BRP_PESIGN_FILES=""
%if "%CONFIG_EFI_STUB" == "y"
%if 0%{?usrmerged}
BRP_PESIGN_FILES="%modules_dir/$image"
%else
BRP_PESIGN_FILES="/boot/$image-%kernelrelease-%build_flavor"
%endif
%endif
%ifarch s390x ppc64 ppc64le
%if 0%{?usrmerged}
BRP_PESIGN_FILES="%modules_dir/$image"
%else
BRP_PESIGN_FILES="/boot/$image-%kernelrelease-%build_flavor"
%endif
%endif
%if "%CONFIG_MODULE_SIG" == "y"
BRP_PESIGN_FILES="$BRP_PESIGN_FILES *.ko"
%endif
@ -804,6 +834,13 @@ for sub in '' '-extra' \
-e "s:@RPM_TARGET_CPU@:%_target_cpu:g" \
-e "s:@CPU_ARCH_FLAVOR@:%cpu_arch_flavor:g" \
-e "s:@SRCVARIANT@:%variant:g" \
-e "s:@MODULESDIR@:%modules_dir:g" \
-e "s:@SYSTEMMAP@:%systemmap:g" \
%if 0%{?usrmerged}
-e "s:^@USRMERGE@::" \
%else
-e "/^@USRMERGE@/d" \
%endif
%_sourcedir/$script.sh > %my_builddir/$script$sub.sh
if test "$base_package" -eq 1 -a "${#certs[@]}" -gt 0; then
case "$script" in
@ -1010,6 +1047,10 @@ 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 '
@ -1022,7 +1063,7 @@ add_dirs_to_filelist() {
# print all parents
:a
# skip directories owned by other packages
s:^%%dir (/boot|/etc|/lib/(modules|firmware)|/usr/src)/[^/]+$::
s:^%%dir (/boot|/etc|(/usr)?/lib/(modules|firmware)|/usr/src)/[^/]+$::
s:/[^/]+$::p
ta
' "$@" | sort -u
@ -1039,10 +1080,23 @@ fi
%endif
shopt -s nullglob dotglob
> %my_builddir/kernel-devel.files
for file in %buildroot/boot/symtypes* %buildroot/lib/modules/*/{build,source}; do
f=${file##%buildroot}
echo "$f"
done | add_dirs_to_filelist >%my_builddir/kernel-devel.files
{
echo "%modules_dir/build"
echo "%modules_dir/source"
cd %buildroot
for file in boot/symtypes*; do
%if 0%{?usrmerged}
l="${file##*/}"
l="%modules_dir/${l//-%kernelrelease-%build_flavor}"
mv "$file" "%{buildroot}$l"
ln -s "..$l" $file
echo "$l"
echo "%%ghost /$file"
%else
echo "/$file"
%endif
done
} | add_dirs_to_filelist >%my_builddir/kernel-devel.files
( cd %buildroot ; find .%obj_install_dir/%cpu_arch_flavor -type f ; ) | \
sed -e 's/^[.]//' | grep -v -e '[.]ipa-clones$' -e '/Symbols[.]list$' -e '/ipa-clones[.]list$'| \
add_dirs_to_filelist >> %my_builddir/kernel-devel.files
@ -1051,6 +1105,8 @@ add_dirs_to_filelist >> %my_builddir/kernel-devel.files
echo %ghost /boot/initrd$suffix
cd %buildroot
for f in boot/*; do
l="${f##*/}"
l="%modules_dir/${l//-%kernelrelease-%build_flavor}"
if test -L "$f"; then
echo "%%ghost /$f"
continue
@ -1066,24 +1122,46 @@ add_dirs_to_filelist >> %my_builddir/kernel-devel.files
;;
boot/vmlinux-*)
if $ghost_vmlinux; then
echo "%%ghost /$f"
continue
# fall through to mark next echo as %ghost
echo -n "%%ghost "
fi
;;
%if 0%{?usrmerged}
boot/vmlinuz-*)
echo -n "%%attr(0644, root, root) "
;;
%endif
boot/symtypes*)
%if 0%{?usrmerged}
echo "%exclude $l"
%endif
continue
;;
esac
%if 0%{?usrmerged}
mv "$f" "./$l"
ln -s "..$l" $f
# the find in the CONFIG_MODULES condition below also finds the files
# but there's sort -u later, so this is ok
echo "$l" # note: must be first after case statement above
echo "%%ghost /$f"
%else
echo "%%attr(0644, root, root) /$f"
%endif
done
if [ %CONFIG_MODULES = y ]; then
find lib/modules/%kernelrelease-%build_flavor \
find %{?usrmerged:usr/}lib/modules/%kernelrelease-%build_flavor \
-type d -o \
\( -path '*/modules.*' ! -path '*/modules.order' \
! -path '*/modules.builtin' \
! -path '*/modules.builtin.modinfo' \) -printf '%%%%ghost /%%p\n' \
-o -name '*.ko' -prune -o -type f -printf '/%%p\n'
-o -name '*.ko' -prune \
%if 0%{?usrmerged}
-o \( -type f ! -path '*/symtypes*' ! -path '*/vmlinu*' \) -printf '/%%p\n'
%else
-o -type f -printf '/%%p\n'
%endif
cat %my_builddir/base-modules
fi
if test %CONFIG_MODULE_SIG = "y" -a -d etc/uefi/certs; then
@ -1144,15 +1222,15 @@ for f in %my_builddir/*-kmp-modules; do
done
if [ %CONFIG_MODULES = y ]; then
install -m 644 %_sourcedir/modules.fips %{buildroot}/lib/modules/%kernelrelease-%build_flavor/modules.fips
echo /lib/modules/%kernelrelease-%build_flavor/modules.fips >> %my_builddir/kernel-base.files
echo /lib/modules/%kernelrelease-%build_flavor/modules.fips >> %my_builddir/kernel-main.files
install -m 644 %_sourcedir/modules.fips %{buildroot}%modules_dir/modules.fips
echo %modules_dir/modules.fips >> %my_builddir/kernel-base.files
echo %modules_dir/modules.fips >> %my_builddir/kernel-main.files
fi
# Hardlink duplicate files automatically (from package fdupes): It doesn't save
# much, but it keeps rpmlint from breaking the package build. Note that we skip
# /usr/src/linux-obj intentionally, to not accidentally break timestamps there
%fdupes $RPM_BUILD_ROOT/lib
%fdupes %buildroot%modules_dir
%preun -f preun.sh
@ -1373,7 +1451,7 @@ static, unlike the %{patch_package}-<kernel-version>-flavor package names.
%files %{livepatch}
# rpmlint complains about empty packages, so lets own something
%defattr(-, root, root)
%dir /lib/modules/%kernelrelease-%build_flavor
%dir %modules_dir
%endif
%if 0%{?klp_symbols} && "%livepatch" != ""

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Wed Aug 11 06:36:51 CEST 2021 - jslaby@suse.cz
- Revert "Revert "UsrMerge the kernel (boo#1184804)""
This reverts commit b6ab3ded319fca797d007c541a190a308f940cf7. By that,
we reverted the original commit 6f5ed044f52a. But the two problems were
adressed in the meantime, so it's time to try UsrMerge for kernel again.
- commit 2e9639b
-------------------------------------------------------------------
Sun Aug 8 12:50:22 CEST 2021 - jslaby@suse.cz

View File

@ -1,10 +1,10 @@
# These zero-length files are correct:
addFilter("zero-length /usr/src/linux-.*-obj/.*/include/config.*h")
# vdsos are special
addFilter("shared-lib-without-dependency-information /lib/modules/[1-9].*/vdso/.*")
addFilter("missing-PT_GNU_STACK-section /lib/modules/[1-9].*/vdso/.*")
addFilter("shared-lib-without-dependency-information .*/lib/modules/[1-9].*/vdso/.*")
addFilter("missing-PT_GNU_STACK-section .*/lib/modules/[1-9].*/vdso/.*")
# This is a stale symlink until the kernel-source package is installed:
addFilter("dangling-symlink /lib/modules/[1-9].*/source")
addFilter("dangling-symlink .*/lib/modules/[1-9].*/source")
# These hidden files are fine:
addFilter("hidden-file-or-dir /usr/src/linux-.*-obj/.*/.config")
addFilter("hidden-file-or-dir /usr/src/linux-.*-obj/.*/.kernel-binary.spec.buildenv")

View File

@ -32,7 +32,7 @@ License: GPL-2.0-only
Group: Development/Sources
Version: 5.13.9
%if 0%{?is_kotd}
Release: <RELEASE>.g19b1d90
Release: <RELEASE>.g2e9639b
%else
Release: 0
%endif
@ -43,7 +43,7 @@ BuildRequires: fdupes
BuildRequires: sed
Requires(post): coreutils sed
Provides: %name = %version-%source_rel
Provides: %name-srchash-19b1d907051ab563b934d68bc884105369cabdce
Provides: %name-srchash-2e9639bdfc7b044b86e3953792abd84a679e7ddb
Provides: linux
Provides: multiversion(kernel)
Source0: http://www.kernel.org/pub/linux/kernel/v5.x/linux-%srcversion.tar.xz

View File

@ -11,7 +11,7 @@ set -o pipefail
install -d -m 0755 $RPM_BUILD_ROOT/boot
$scriptdir/splitflist $kernel_package_name kernel.flist kernel-ghost.flist
echo Missing files:
echo Ghost files:
cat kernel-ghost.flist
rpm -q --qf '%{PREIN}' $kernel_package_name | sed -e "s/$kernel_nvrq/$package_nvr/g" > prein.sh
@ -21,7 +21,8 @@ rpm -q --qf '%{POSTUN}' $kernel_package_name | sed -e "s/$kernel_nvrq/$package_n
[ -z "$(rpm -q --triggers $kernel_package_name)" ] # not handled
KREL=$(cat kernel.flist | grep ^/lib/modules | { sort -r ||: ;} | head -n 1 | sed -e s,^/lib/modules/,, -e 's,/.*,,')
KREL=$(sed -rne '/^(\/usr)?\/lib\/modules\/([^/]+)$/{s,.*/,,;p;q}' < kernel.flist)
grep -q /usr/lib/modules/ kernel.flist && USR=/usr
$scriptdir/mergedep $KREL > modules.dep
@ -29,13 +30,13 @@ $scriptdir/mergedep $KREL > modules.dep
$scriptdir/moddep modules.dep request-modules modules
$scriptdir/modflist kernel.flist modules modules.flist /lib/modules/$KREL/modules.builtin
cat kernel.flist | grep -v ^/lib/modules >> modules.flist
[ -d /lib/modules/$KREL/vdso ] && echo /lib/modules/$KREL/vdso >> modules.flist ||:
echo /lib/modules/$KREL/modules.* | tr ' ' '\n' >> modules.flist
grep -v "^$USR/lib/modules/$KREL\\(\$\\|/kernel\\)" < kernel.flist >> modules.flist || :
tar -C / -cf- -T modules.flist | tar -C $RPM_BUILD_ROOT -xvf-
[ -z "$USR" ] || ln -s usr/lib $RPM_BUILD_ROOT/lib
moderr="$(/usr/sbin/depmod -b $RPM_BUILD_ROOT -e -F /boot/System.map-$KREL $KREL 2>&1 > /dev/null)"
[ -z "$USR" ] || rm $RPM_BUILD_ROOT/lib
if [ "$moderr" ] ; then
echo Picked modules have errors:
@ -44,35 +45,27 @@ exit 1
fi
echo "%defattr(-,root,root)" > subpackage.flist
cat kernel.flist | grep -v ^/lib/modules >> subpackage.flist
echo /lib/modules/$KREL >> subpackage.flist
cat kernel-ghost.flist | sed -e 's/^/%ghost /' >> subpackage.flist
cat kernel-ghost.flist | while read ghost ; do
case $ghost in
/boot/image-%build_flavor | /boot/vmlinux-%build_flavor | /boot/vmlinuz-%build_flavor | \
/boot/Image-%build_flavor | /boot/initrd-%build_flavor)
;;
/boot/vmlinux | /boot/vmlinuz | /boot/zImage | /boot/Image | /boot/image | /boot/initrd)
;;
/boot/vmlinux-$KREL)
[ -f /boot/vmlinux-$KREL.gz ] && touch vmlinux-$KREL
;;
/boot/initrd-$KREL | /boot/initrd-$KREL-kdump)
# Create a dummy initrd with roughly the size the real one will have.
# That way, YaST will know that this package requires some additional
# space in /boot.
dd if=/dev/zero of=$RPM_BUILD_ROOT$ghost \
bs=1024 seek=2047 count=1
chmod 0600 $RPM_BUILD_ROOT$ghost
;;
/lib/modules/$KREL/modules.*)
[ -f $RPM_BUILD_ROOT$ghost ]
;;
*)
echo Missing file "$ghost" not handled.
exit 1;
;;
esac
done
echo "%dir $USR/lib/modules/$KREL" >> subpackage.flist
grep -v "^$USR/lib/modules/$KREL\\(\$\\|/kernel\\)" < kernel.flist >> subpackage.flist || :
echo $USR/lib/modules/$KREL/kernel >> subpackage.flist
while read name rest; do
echo "%ghost $name"
done < kernel-ghost.flist >> subpackage.flist
# recreate ghost files in build root
while read name mode size mtime link; do
t=$(( mode&0170000 ))
p="${mode:0-4:4}"
(( p != 0 )) || p=''
if (( t == 0100000 )); then
install -D -m "${p:-0644}" /dev/null "$RPM_BUILD_ROOT$name"
dd if=/dev/null bs=1 count=0 status=none seek="$size" of="$RPM_BUILD_ROOT$name"
touch -h --date="@$mtime" "$RPM_BUILD_ROOT$name"
elif (( t == 0040000 )); then
install -d -m "${p:-0755}" "$RPM_BUILD_ROOT$name"
touch -h -date="@$mtime" "$RPM_BUILD_ROOT$name"
elif (( t == 0120000 )); then
ln -s "$link" "$RPM_BUILD_ROOT$name"
touch -h --date="@$mtime" "$RPM_BUILD_ROOT$name"
fi
done < kernel-ghost.flist

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Wed Aug 11 06:36:51 CEST 2021 - jslaby@suse.cz
- Revert "Revert "UsrMerge the kernel (boo#1184804)""
This reverts commit b6ab3ded319fca797d007c541a190a308f940cf7. By that,
we reverted the original commit 6f5ed044f52a. But the two problems were
adressed in the meantime, so it's time to try UsrMerge for kernel again.
- commit 2e9639b
-------------------------------------------------------------------
Sun Aug 8 12:50:22 CEST 2021 - jslaby@suse.cz

View File

@ -27,7 +27,7 @@ Group: Development/Sources
Version: 5.13.9
%if %using_buildservice
%if 0%{?is_kotd}
Release: <RELEASE>.g19b1d90
Release: <RELEASE>.g2e9639b
%else
Release: 0
%endif
@ -52,7 +52,7 @@ Requires: kernel-pae-devel = %version-%source_rel
%endif
Requires: pesign-obs-integration
Provides: %name = %version-%source_rel
Provides: %name-srchash-19b1d907051ab563b934d68bc884105369cabdce
Provides: %name-srchash-2e9639bdfc7b044b86e3953792abd84a679e7ddb
Provides: multiversion(kernel)
Source: README.KSYMS
Requires: kernel-devel%variant = %version-%source_rel

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Wed Aug 11 06:36:51 CEST 2021 - jslaby@suse.cz
- Revert "Revert "UsrMerge the kernel (boo#1184804)""
This reverts commit b6ab3ded319fca797d007c541a190a308f940cf7. By that,
we reverted the original commit 6f5ed044f52a. But the two problems were
adressed in the meantime, so it's time to try UsrMerge for kernel again.
- commit 2e9639b
-------------------------------------------------------------------
Sun Aug 8 12:50:22 CEST 2021 - jslaby@suse.cz

View File

@ -68,13 +68,27 @@
%define install_vdso 0
%endif
# TW is usrmerged
%if %{undefined usrmerged} && 0%{?suse_version} >= 1550
%define usrmerged 1
%endif
%if 0%{?usrmerged}
%define modules_dir /usr/lib/modules/%kernelrelease-%build_flavor
%define systemmap %{modules_dir}/System.map
%else
%define modules_dir /lib/modules/%kernelrelease-%build_flavor
%define systemmap /boot/System.map-%kernelrelease-%build_flavor
%endif
Name: kernel-vanilla
Summary: The Standard Kernel - without any SUSE patches
License: GPL-2.0-only
Group: System/Kernel
Version: 5.13.9
%if 0%{?is_kotd}
Release: <RELEASE>.g19b1d90
Release: <RELEASE>.g2e9639b
%else
Release: 0
%endif
@ -192,10 +206,10 @@ Conflicts: hyper-v < 4
Conflicts: libc.so.6()(64bit)
%endif
Provides: kernel = %version-%source_rel
Provides: kernel-%build_flavor-base-srchash-19b1d907051ab563b934d68bc884105369cabdce
Provides: kernel-srchash-19b1d907051ab563b934d68bc884105369cabdce
Provides: kernel-%build_flavor-base-srchash-2e9639bdfc7b044b86e3953792abd84a679e7ddb
Provides: kernel-srchash-2e9639bdfc7b044b86e3953792abd84a679e7ddb
# END COMMON DEPS
Provides: %name-srchash-19b1d907051ab563b934d68bc884105369cabdce
Provides: %name-srchash-2e9639bdfc7b044b86e3953792abd84a679e7ddb
%obsolete_rebuilds %name
Source0: http://www.kernel.org/pub/linux/kernel/v5.x/linux-%srcversion.tar.xz
Source2: source-post.sh
@ -614,6 +628,14 @@ 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
@ -709,11 +731,19 @@ add_vmlinux()
# sign the modules, firmware and possibly the kernel in the buildservice
BRP_PESIGN_FILES=""
%if "%CONFIG_EFI_STUB" == "y"
%if 0%{?usrmerged}
BRP_PESIGN_FILES="%modules_dir/$image"
%else
BRP_PESIGN_FILES="/boot/$image-%kernelrelease-%build_flavor"
%endif
%endif
%ifarch s390x ppc64 ppc64le
%if 0%{?usrmerged}
BRP_PESIGN_FILES="%modules_dir/$image"
%else
BRP_PESIGN_FILES="/boot/$image-%kernelrelease-%build_flavor"
%endif
%endif
%if "%CONFIG_MODULE_SIG" == "y"
BRP_PESIGN_FILES="$BRP_PESIGN_FILES *.ko"
%endif
@ -775,6 +805,13 @@ for sub in '' '-extra' \
-e "s:@RPM_TARGET_CPU@:%_target_cpu:g" \
-e "s:@CPU_ARCH_FLAVOR@:%cpu_arch_flavor:g" \
-e "s:@SRCVARIANT@:%variant:g" \
-e "s:@MODULESDIR@:%modules_dir:g" \
-e "s:@SYSTEMMAP@:%systemmap:g" \
%if 0%{?usrmerged}
-e "s:^@USRMERGE@::" \
%else
-e "/^@USRMERGE@/d" \
%endif
%_sourcedir/$script.sh > %my_builddir/$script$sub.sh
if test "$base_package" -eq 1 -a "${#certs[@]}" -gt 0; then
case "$script" in
@ -981,6 +1018,10 @@ 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 '
@ -993,7 +1034,7 @@ add_dirs_to_filelist() {
# print all parents
:a
# skip directories owned by other packages
s:^%%dir (/boot|/etc|/lib/(modules|firmware)|/usr/src)/[^/]+$::
s:^%%dir (/boot|/etc|(/usr)?/lib/(modules|firmware)|/usr/src)/[^/]+$::
s:/[^/]+$::p
ta
' "$@" | sort -u
@ -1010,10 +1051,23 @@ fi
%endif
shopt -s nullglob dotglob
> %my_builddir/kernel-devel.files
for file in %buildroot/boot/symtypes* %buildroot/lib/modules/*/{build,source}; do
f=${file##%buildroot}
echo "$f"
done | add_dirs_to_filelist >%my_builddir/kernel-devel.files
{
echo "%modules_dir/build"
echo "%modules_dir/source"
cd %buildroot
for file in boot/symtypes*; do
%if 0%{?usrmerged}
l="${file##*/}"
l="%modules_dir/${l//-%kernelrelease-%build_flavor}"
mv "$file" "%{buildroot}$l"
ln -s "..$l" $file
echo "$l"
echo "%%ghost /$file"
%else
echo "/$file"
%endif
done
} | add_dirs_to_filelist >%my_builddir/kernel-devel.files
( cd %buildroot ; find .%obj_install_dir/%cpu_arch_flavor -type f ; ) | \
sed -e 's/^[.]//' | grep -v -e '[.]ipa-clones$' -e '/Symbols[.]list$' -e '/ipa-clones[.]list$'| \
add_dirs_to_filelist >> %my_builddir/kernel-devel.files
@ -1022,6 +1076,8 @@ add_dirs_to_filelist >> %my_builddir/kernel-devel.files
echo %ghost /boot/initrd$suffix
cd %buildroot
for f in boot/*; do
l="${f##*/}"
l="%modules_dir/${l//-%kernelrelease-%build_flavor}"
if test -L "$f"; then
echo "%%ghost /$f"
continue
@ -1037,24 +1093,46 @@ add_dirs_to_filelist >> %my_builddir/kernel-devel.files
;;
boot/vmlinux-*)
if $ghost_vmlinux; then
echo "%%ghost /$f"
continue
# fall through to mark next echo as %ghost
echo -n "%%ghost "
fi
;;
%if 0%{?usrmerged}
boot/vmlinuz-*)
echo -n "%%attr(0644, root, root) "
;;
%endif
boot/symtypes*)
%if 0%{?usrmerged}
echo "%exclude $l"
%endif
continue
;;
esac
%if 0%{?usrmerged}
mv "$f" "./$l"
ln -s "..$l" $f
# the find in the CONFIG_MODULES condition below also finds the files
# but there's sort -u later, so this is ok
echo "$l" # note: must be first after case statement above
echo "%%ghost /$f"
%else
echo "%%attr(0644, root, root) /$f"
%endif
done
if [ %CONFIG_MODULES = y ]; then
find lib/modules/%kernelrelease-%build_flavor \
find %{?usrmerged:usr/}lib/modules/%kernelrelease-%build_flavor \
-type d -o \
\( -path '*/modules.*' ! -path '*/modules.order' \
! -path '*/modules.builtin' \
! -path '*/modules.builtin.modinfo' \) -printf '%%%%ghost /%%p\n' \
-o -name '*.ko' -prune -o -type f -printf '/%%p\n'
-o -name '*.ko' -prune \
%if 0%{?usrmerged}
-o \( -type f ! -path '*/symtypes*' ! -path '*/vmlinu*' \) -printf '/%%p\n'
%else
-o -type f -printf '/%%p\n'
%endif
cat %my_builddir/base-modules
fi
if test %CONFIG_MODULE_SIG = "y" -a -d etc/uefi/certs; then
@ -1115,15 +1193,15 @@ for f in %my_builddir/*-kmp-modules; do
done
if [ %CONFIG_MODULES = y ]; then
install -m 644 %_sourcedir/modules.fips %{buildroot}/lib/modules/%kernelrelease-%build_flavor/modules.fips
echo /lib/modules/%kernelrelease-%build_flavor/modules.fips >> %my_builddir/kernel-base.files
echo /lib/modules/%kernelrelease-%build_flavor/modules.fips >> %my_builddir/kernel-main.files
install -m 644 %_sourcedir/modules.fips %{buildroot}%modules_dir/modules.fips
echo %modules_dir/modules.fips >> %my_builddir/kernel-base.files
echo %modules_dir/modules.fips >> %my_builddir/kernel-main.files
fi
# Hardlink duplicate files automatically (from package fdupes): It doesn't save
# much, but it keeps rpmlint from breaking the package build. Note that we skip
# /usr/src/linux-obj intentionally, to not accidentally break timestamps there
%fdupes $RPM_BUILD_ROOT/lib
%fdupes %buildroot%modules_dir
%preun -f preun.sh
@ -1300,7 +1378,7 @@ static, unlike the %{patch_package}-<kernel-version>-flavor package names.
%files %{livepatch}
# rpmlint complains about empty packages, so lets own something
%defattr(-, root, root)
%dir /lib/modules/%kernelrelease-%build_flavor
%dir %modules_dir
%endif
%if 0%{?klp_symbols} && "%livepatch" != ""

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Wed Aug 11 06:36:51 CEST 2021 - jslaby@suse.cz
- Revert "Revert "UsrMerge the kernel (boo#1184804)""
This reverts commit b6ab3ded319fca797d007c541a190a308f940cf7. By that,
we reverted the original commit 6f5ed044f52a. But the two problems were
adressed in the meantime, so it's time to try UsrMerge for kernel again.
- commit 2e9639b
-------------------------------------------------------------------
Sun Aug 8 12:50:22 CEST 2021 - jslaby@suse.cz

View File

@ -68,13 +68,27 @@
%define install_vdso 0
%endif
# TW is usrmerged
%if %{undefined usrmerged} && 0%{?suse_version} >= 1550
%define usrmerged 1
%endif
%if 0%{?usrmerged}
%define modules_dir /usr/lib/modules/%kernelrelease-%build_flavor
%define systemmap %{modules_dir}/System.map
%else
%define modules_dir /lib/modules/%kernelrelease-%build_flavor
%define systemmap /boot/System.map-%kernelrelease-%build_flavor
%endif
Name: kernel-zfcpdump
Summary: The IBM System Z zfcpdump Kernel
License: GPL-2.0-only
Group: System/Kernel
Version: 5.13.9
%if 0%{?is_kotd}
Release: <RELEASE>.g19b1d90
Release: <RELEASE>.g2e9639b
%else
Release: 0
%endif
@ -192,10 +206,10 @@ Conflicts: hyper-v < 4
Conflicts: libc.so.6()(64bit)
%endif
Provides: kernel = %version-%source_rel
Provides: kernel-%build_flavor-base-srchash-19b1d907051ab563b934d68bc884105369cabdce
Provides: kernel-srchash-19b1d907051ab563b934d68bc884105369cabdce
Provides: kernel-%build_flavor-base-srchash-2e9639bdfc7b044b86e3953792abd84a679e7ddb
Provides: kernel-srchash-2e9639bdfc7b044b86e3953792abd84a679e7ddb
# END COMMON DEPS
Provides: %name-srchash-19b1d907051ab563b934d68bc884105369cabdce
Provides: %name-srchash-2e9639bdfc7b044b86e3953792abd84a679e7ddb
%obsolete_rebuilds %name
Source0: http://www.kernel.org/pub/linux/kernel/v5.x/linux-%srcversion.tar.xz
Source2: source-post.sh
@ -617,6 +631,14 @@ 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
@ -712,11 +734,19 @@ add_vmlinux()
# sign the modules, firmware and possibly the kernel in the buildservice
BRP_PESIGN_FILES=""
%if "%CONFIG_EFI_STUB" == "y"
%if 0%{?usrmerged}
BRP_PESIGN_FILES="%modules_dir/$image"
%else
BRP_PESIGN_FILES="/boot/$image-%kernelrelease-%build_flavor"
%endif
%endif
%ifarch s390x ppc64 ppc64le
%if 0%{?usrmerged}
BRP_PESIGN_FILES="%modules_dir/$image"
%else
BRP_PESIGN_FILES="/boot/$image-%kernelrelease-%build_flavor"
%endif
%endif
%if "%CONFIG_MODULE_SIG" == "y"
BRP_PESIGN_FILES="$BRP_PESIGN_FILES *.ko"
%endif
@ -778,6 +808,13 @@ for sub in '' '-extra' \
-e "s:@RPM_TARGET_CPU@:%_target_cpu:g" \
-e "s:@CPU_ARCH_FLAVOR@:%cpu_arch_flavor:g" \
-e "s:@SRCVARIANT@:%variant:g" \
-e "s:@MODULESDIR@:%modules_dir:g" \
-e "s:@SYSTEMMAP@:%systemmap:g" \
%if 0%{?usrmerged}
-e "s:^@USRMERGE@::" \
%else
-e "/^@USRMERGE@/d" \
%endif
%_sourcedir/$script.sh > %my_builddir/$script$sub.sh
if test "$base_package" -eq 1 -a "${#certs[@]}" -gt 0; then
case "$script" in
@ -984,6 +1021,10 @@ 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 '
@ -996,7 +1037,7 @@ add_dirs_to_filelist() {
# print all parents
:a
# skip directories owned by other packages
s:^%%dir (/boot|/etc|/lib/(modules|firmware)|/usr/src)/[^/]+$::
s:^%%dir (/boot|/etc|(/usr)?/lib/(modules|firmware)|/usr/src)/[^/]+$::
s:/[^/]+$::p
ta
' "$@" | sort -u
@ -1013,10 +1054,23 @@ fi
%endif
shopt -s nullglob dotglob
> %my_builddir/kernel-devel.files
for file in %buildroot/boot/symtypes* %buildroot/lib/modules/*/{build,source}; do
f=${file##%buildroot}
echo "$f"
done | add_dirs_to_filelist >%my_builddir/kernel-devel.files
{
echo "%modules_dir/build"
echo "%modules_dir/source"
cd %buildroot
for file in boot/symtypes*; do
%if 0%{?usrmerged}
l="${file##*/}"
l="%modules_dir/${l//-%kernelrelease-%build_flavor}"
mv "$file" "%{buildroot}$l"
ln -s "..$l" $file
echo "$l"
echo "%%ghost /$file"
%else
echo "/$file"
%endif
done
} | add_dirs_to_filelist >%my_builddir/kernel-devel.files
( cd %buildroot ; find .%obj_install_dir/%cpu_arch_flavor -type f ; ) | \
sed -e 's/^[.]//' | grep -v -e '[.]ipa-clones$' -e '/Symbols[.]list$' -e '/ipa-clones[.]list$'| \
add_dirs_to_filelist >> %my_builddir/kernel-devel.files
@ -1025,6 +1079,8 @@ add_dirs_to_filelist >> %my_builddir/kernel-devel.files
echo %ghost /boot/initrd$suffix
cd %buildroot
for f in boot/*; do
l="${f##*/}"
l="%modules_dir/${l//-%kernelrelease-%build_flavor}"
if test -L "$f"; then
echo "%%ghost /$f"
continue
@ -1040,24 +1096,46 @@ add_dirs_to_filelist >> %my_builddir/kernel-devel.files
;;
boot/vmlinux-*)
if $ghost_vmlinux; then
echo "%%ghost /$f"
continue
# fall through to mark next echo as %ghost
echo -n "%%ghost "
fi
;;
%if 0%{?usrmerged}
boot/vmlinuz-*)
echo -n "%%attr(0644, root, root) "
;;
%endif
boot/symtypes*)
%if 0%{?usrmerged}
echo "%exclude $l"
%endif
continue
;;
esac
%if 0%{?usrmerged}
mv "$f" "./$l"
ln -s "..$l" $f
# the find in the CONFIG_MODULES condition below also finds the files
# but there's sort -u later, so this is ok
echo "$l" # note: must be first after case statement above
echo "%%ghost /$f"
%else
echo "%%attr(0644, root, root) /$f"
%endif
done
if [ %CONFIG_MODULES = y ]; then
find lib/modules/%kernelrelease-%build_flavor \
find %{?usrmerged:usr/}lib/modules/%kernelrelease-%build_flavor \
-type d -o \
\( -path '*/modules.*' ! -path '*/modules.order' \
! -path '*/modules.builtin' \
! -path '*/modules.builtin.modinfo' \) -printf '%%%%ghost /%%p\n' \
-o -name '*.ko' -prune -o -type f -printf '/%%p\n'
-o -name '*.ko' -prune \
%if 0%{?usrmerged}
-o \( -type f ! -path '*/symtypes*' ! -path '*/vmlinu*' \) -printf '/%%p\n'
%else
-o -type f -printf '/%%p\n'
%endif
cat %my_builddir/base-modules
fi
if test %CONFIG_MODULE_SIG = "y" -a -d etc/uefi/certs; then
@ -1118,15 +1196,15 @@ for f in %my_builddir/*-kmp-modules; do
done
if [ %CONFIG_MODULES = y ]; then
install -m 644 %_sourcedir/modules.fips %{buildroot}/lib/modules/%kernelrelease-%build_flavor/modules.fips
echo /lib/modules/%kernelrelease-%build_flavor/modules.fips >> %my_builddir/kernel-base.files
echo /lib/modules/%kernelrelease-%build_flavor/modules.fips >> %my_builddir/kernel-main.files
install -m 644 %_sourcedir/modules.fips %{buildroot}%modules_dir/modules.fips
echo %modules_dir/modules.fips >> %my_builddir/kernel-base.files
echo %modules_dir/modules.fips >> %my_builddir/kernel-main.files
fi
# Hardlink duplicate files automatically (from package fdupes): It doesn't save
# much, but it keeps rpmlint from breaking the package build. Note that we skip
# /usr/src/linux-obj intentionally, to not accidentally break timestamps there
%fdupes $RPM_BUILD_ROOT/lib
%fdupes %buildroot%modules_dir
%preun -f preun.sh
@ -1309,7 +1387,7 @@ static, unlike the %{patch_package}-<kernel-version>-flavor package names.
%files %{livepatch}
# rpmlint complains about empty packages, so lets own something
%defattr(-, root, root)
%dir /lib/modules/%kernelrelease-%build_flavor
%dir %modules_dir
%endif
%if 0%{?klp_symbols} && "%livepatch" != ""

19
post.sh
View File

@ -10,6 +10,23 @@ for x in /boot/@IMAGE@ /boot/initrd; do
rm -f $x$suffix
ln -s ${x##*/}-@KERNELRELEASE@-@FLAVOR@ $x$suffix
done
@USRMERGE@# compat stuff for /boot.
@USRMERGE@# if /boot is not a speparate partition we can just link the kernel
@USRMERGE@# there to save space. Otherwise copy.
@USRMERGE@if mountpoint -q /boot; then
@USRMERGE@ copy_or_link="cp -a"
@USRMERGE@else
@USRMERGE@ copy_or_link="ln -sf"
@USRMERGE@fi
@USRMERGE@# XXX: need to fix suse-module-tools for sysctl.conf and System.map
@USRMERGE@for x in @IMAGE@ sysctl.conf System.map; do
@USRMERGE@ if [ ! -e /boot/$x-@KERNELRELEASE@-@FLAVOR@ ]; then
@USRMERGE@ $copy_or_link ..@MODULESDIR@/$x /boot/$x-@KERNELRELEASE@-@FLAVOR@
@USRMERGE@ if [ -e @MODULESDIR@/.$x.hmac ]; then
@USRMERGE@ $copy_or_link ..@MODULESDIR@/.$x.hmac /boot/.$x-@KERNELRELEASE@-@FLAVOR@.hmac
@USRMERGE@ fi
@USRMERGE@ fi
@USRMERGE@done
# Add symlinks of compatible modules to /lib/modules/$krel/weak-updates/,
# run depmod and mkinitrd
@ -56,7 +73,7 @@ if [ -f /etc/fstab -a ! -e /.buildenv ] ; then
if [ @FLAVOR@ = rt ]; then
default=force-default
fi
if [ -e /boot/$initrd -o ! -e /lib/modules/@KERNELRELEASE@-@FLAVOR@ ] && \
if [ -e /boot/$initrd -o ! -e @MODULESDIR@ ] && \
run_bootloader ; then
[ -e /boot/$initrd ] || initrd=
if [ -x /usr/lib/bootloader/bootloader_entry ]; then

View File

@ -6,7 +6,7 @@ rm -f /boot/do_purge_kernels
wm2=/usr/lib/module-init-tools/weak-modules2
nvr=@SUBPACKAGE@-@RPM_VERSION_RELEASE@
if [ -e /boot/System.map-@KERNELRELEASE@-@FLAVOR@ ]; then
if [ -e @SYSTEMMAP@ ]; then
# the same package was reinstalled or just rebuilt, otherwise the files
# would have been deleted by now
# do not remove anything in this case (bnc#533766)
@ -21,7 +21,7 @@ if [ @BASE_PACKAGE@ = 0 ]; then
rm -f /var/run/rpm-$nvr-modules
exit 0
fi
# Remove symlinks from /lib/modules/$krel/weak-updates/.
# Remove symlinks from @MODULESDIR@/weak-updates/.
if [ -x $wm2 ]; then
/bin/bash -${-/e/} $wm2 --remove-kernel @KERNELRELEASE@-@FLAVOR@
fi

View File

@ -1,3 +1,3 @@
2021-08-08 10:50:26 +0000
GIT Revision: 19b1d907051ab563b934d68bc884105369cabdce
2021-08-11 04:36:51 +0000
GIT Revision: 2e9639bdfc7b044b86e3953792abd84a679e7ddb
GIT Branch: stable

View File

@ -77,7 +77,7 @@ while read mod path; do
no)
;;
"")
echo "warning: ${path#/lib/modules/*/kernel/} not listed in supported.conf" >&2
echo "warning: $mod not listed in supported.conf" >&2
;;
*)
echo "error: invalid support flag for $mod: $support" >&2
@ -119,11 +119,13 @@ join -j 1 -o 2.2 "$tmp/base" "$tmp/all" >"$opt_out/base-modules"
# base firmware
kver=$(make $MAKE_ARGS -s -C "$opt_builddir" kernelrelease)
if test -d "$opt_dir/lib/firmware/$kver"; then
fw_dir=/lib/firmware/$kver
test -d $opt_dir/usr$fw_dir && fw_dir=/usr$fw_dir
if test -d "$opt_dir$fw_dir"; then
join <(/sbin/modinfo -F firmware \
$(sed "s:^:$opt_dir:" "$opt_out/base-modules") | sort) \
<(find "$opt_dir/lib/firmware/$kver" -type f -printf '%P\n' | sort)
fi | sed "s:^:/lib/firmware/$kver/:" >"$opt_out/base-firmware"
<(find "$opt_dir$fw_dir" -type f -printf '%P\n' | sort)
fi | sed "s:^:$fw_dir:" >"$opt_out/base-firmware"
# kmps
for f in "$opt_builddir"/Module.*-kmp; do

View File

@ -1,4 +1,4 @@
#!/bin/sh -e
#!/bin/bash -e
package="$1"
present="$2"
@ -10,6 +10,7 @@ rpm -ql --noghost "$package" | while read x ; do
[ -e "$x" -o -L "$x" ] && echo "$x" >> "$present" || echo Missing file "$x"
done
rpm -ql "$package" | while read x ; do
grep "^$x\$" $present >/dev/null || echo "$x" >> $ghost
done
rpm -q --qf '[%{FILEFLAGS} %{FILENAMES} 0%{FILEMODES:octal} %{FILESIZES} %{FILEMTIMES} %{FILELINKTOS}\n]' $package | while read -a line; do
[ $[line[0]&64] = 64 ] || continue
echo "${line[@]:1}"
done > "$ghost"