Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package kernel-source for openSUSE:Factory checked in at 2021-08-24 10:54:15 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/kernel-source (Old) and /work/SRC/openSUSE:Factory/.kernel-source.new.1899 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "kernel-source" Tue Aug 24 10:54:15 2021 rev:601 rq:913265 version:5.13.12 Changes: -------- --- /work/SRC/openSUSE:Factory/kernel-source/dtb-aarch64.changes 2021-08-19 13:39:02.861423359 +0200 +++ /work/SRC/openSUSE:Factory/.kernel-source.new.1899/dtb-aarch64.changes 2021-08-24 10:54:58.592312707 +0200 @@ -1,0 +2,9 @@ +Wed Aug 18 14:54:50 CEST 2021 - ti...@suse.de + +- Bluetooth: switch to lock_sock in SCO (CVE-2021-3640 + bsc#1188172). +- Bluetooth: avoid circular locks in sco_sock_connect + (CVE-2021-3640 bsc#1188172). +- commit aa9e1af + +------------------------------------------------------------------- @@ -634,0 +644,5 @@ + This reverts commit 999e6048a4cc6accd2653c9dccaaaff2f4ae8f86. By that, + we reverted the original commit 6f5ed044f52a. But the selinux problem is + hopefully fixed in the meantime, so it's time to try UsrMerge for kernel + again. +- Revert "Revert "UsrMerge the kernel (boo#1184804)"" @@ -638 +652 @@ -- commit 2e9639b +- commit 33df9c6 dtb-armv6l.changes: same change dtb-armv7l.changes: same change dtb-riscv64.changes: same change kernel-64kb.changes: same change kernel-debug.changes: same change kernel-default.changes: same change kernel-docs.changes: same change kernel-kvmsmall.changes: same change kernel-lpae.changes: same change kernel-obs-build.changes: same change kernel-obs-qa.changes: same change kernel-pae.changes: same change kernel-source.changes: same change kernel-syms.changes: same change kernel-vanilla.changes: same change kernel-zfcpdump.changes: same change ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ dtb-aarch64.spec ++++++ --- /var/tmp/diff_new_pack.8NzXIb/_old 2021-08-24 10:55:03.192306614 +0200 +++ /var/tmp/diff_new_pack.8NzXIb/_new 2021-08-24 10:55:03.192306614 +0200 @@ -31,7 +31,7 @@ Name: dtb-aarch64 Version: 5.13.12 %if 0%{?is_kotd} -Release: <RELEASE>.g999e604 +Release: <RELEASE>.g33df9c6 %else Release: 0 %endif dtb-armv6l.spec: same change dtb-armv7l.spec: same change dtb-riscv64.spec: same change ++++++ kernel-64kb.spec ++++++ --- /var/tmp/diff_new_pack.8NzXIb/_old 2021-08-24 10:55:03.300306472 +0200 +++ /var/tmp/diff_new_pack.8NzXIb/_new 2021-08-24 10:55:03.304306466 +0200 @@ -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.12 %if 0%{?is_kotd} -Release: <RELEASE>.g999e604 +Release: <RELEASE>.g33df9c6 %else Release: 0 %endif @@ -191,10 +205,10 @@ Conflicts: libc.so.6()(64bit) %endif Provides: kernel = %version-%source_rel -Provides: kernel-%build_flavor-base-srchash-999e6048a4cc6accd2653c9dccaaaff2f4ae8f86 -Provides: kernel-srchash-999e6048a4cc6accd2653c9dccaaaff2f4ae8f86 +Provides: kernel-%build_flavor-base-srchash-33df9c651d0aa37cce1275bd9528ea5cb9196022 +Provides: kernel-srchash-33df9c651d0aa37cce1275bd9528ea5cb9196022 # END COMMON DEPS -Provides: %name-srchash-999e6048a4cc6accd2653c9dccaaaff2f4ae8f86 +Provides: %name-srchash-33df9c651d0aa37cce1275bd9528ea5cb9196022 %obsolete_rebuilds %name Source0: http://www.kernel.org/pub/linux/kernel/v5.x/linux-%srcversion.tar.xz Source2: source-post.sh @@ -616,6 +630,14 @@ %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 @@ -711,11 +733,19 @@ # 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 @@ -777,6 +807,13 @@ -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 @@ -983,6 +1020,10 @@ fi rm -rf %{buildroot}/lib/firmware +%if 0%{?usrmerged} +# remove usrmerge aid +rm %{buildroot}/lib +%endif add_dirs_to_filelist() { sed -rn ' @@ -995,7 +1036,7 @@ # 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 @@ -1012,10 +1053,23 @@ %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 @@ -1024,6 +1078,8 @@ 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 @@ -1039,24 +1095,46 @@ ;; 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 @@ -1117,15 +1195,15 @@ 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 @@ -1311,7 +1389,7 @@ %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" != "" ++++++ kernel-debug.spec ++++++ --- /var/tmp/diff_new_pack.8NzXIb/_old 2021-08-24 10:55:03.332306429 +0200 +++ /var/tmp/diff_new_pack.8NzXIb/_new 2021-08-24 10:55:03.336306424 +0200 @@ -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.12 %if 0%{?is_kotd} -Release: <RELEASE>.g999e604 +Release: <RELEASE>.g33df9c6 %else Release: 0 %endif @@ -191,10 +205,10 @@ Conflicts: libc.so.6()(64bit) %endif Provides: kernel = %version-%source_rel -Provides: kernel-%build_flavor-base-srchash-999e6048a4cc6accd2653c9dccaaaff2f4ae8f86 -Provides: kernel-srchash-999e6048a4cc6accd2653c9dccaaaff2f4ae8f86 +Provides: kernel-%build_flavor-base-srchash-33df9c651d0aa37cce1275bd9528ea5cb9196022 +Provides: kernel-srchash-33df9c651d0aa37cce1275bd9528ea5cb9196022 # END COMMON DEPS -Provides: %name-srchash-999e6048a4cc6accd2653c9dccaaaff2f4ae8f86 +Provides: %name-srchash-33df9c651d0aa37cce1275bd9528ea5cb9196022 %ifarch ppc64 Provides: kernel-kdump = 2.6.28 Obsoletes: kernel-kdump <= 2.6.28 @@ -622,6 +636,14 @@ %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 @@ -717,11 +739,19 @@ # 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 @@ -783,6 +813,13 @@ -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 @@ -989,6 +1026,10 @@ fi rm -rf %{buildroot}/lib/firmware +%if 0%{?usrmerged} +# remove usrmerge aid +rm %{buildroot}/lib +%endif add_dirs_to_filelist() { sed -rn ' @@ -1001,7 +1042,7 @@ # 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 @@ -1018,10 +1059,23 @@ %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 @@ -1030,6 +1084,8 @@ 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 @@ -1045,24 +1101,46 @@ ;; 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 @@ -1123,15 +1201,15 @@ 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 @@ -1325,7 +1403,7 @@ %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" != "" ++++++ kernel-default.spec ++++++ --- /var/tmp/diff_new_pack.8NzXIb/_old 2021-08-24 10:55:03.360306392 +0200 +++ /var/tmp/diff_new_pack.8NzXIb/_new 2021-08-24 10:55:03.364306387 +0200 @@ -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.12 %if 0%{?is_kotd} -Release: <RELEASE>.g999e604 +Release: <RELEASE>.g33df9c6 %else Release: 0 %endif @@ -191,10 +205,10 @@ Conflicts: libc.so.6()(64bit) %endif Provides: kernel = %version-%source_rel -Provides: kernel-%build_flavor-base-srchash-999e6048a4cc6accd2653c9dccaaaff2f4ae8f86 -Provides: kernel-srchash-999e6048a4cc6accd2653c9dccaaaff2f4ae8f86 +Provides: kernel-%build_flavor-base-srchash-33df9c651d0aa37cce1275bd9528ea5cb9196022 +Provides: kernel-srchash-33df9c651d0aa37cce1275bd9528ea5cb9196022 # END COMMON DEPS -Provides: %name-srchash-999e6048a4cc6accd2653c9dccaaaff2f4ae8f86 +Provides: %name-srchash-33df9c651d0aa37cce1275bd9528ea5cb9196022 %ifarch %ix86 Provides: kernel-smp = 2.6.17 Obsoletes: kernel-smp <= 2.6.17 @@ -665,6 +679,14 @@ %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 @@ -760,11 +782,19 @@ # 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 @@ -826,6 +856,13 @@ -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 @@ -1032,6 +1069,10 @@ fi rm -rf %{buildroot}/lib/firmware +%if 0%{?usrmerged} +# remove usrmerge aid +rm %{buildroot}/lib +%endif add_dirs_to_filelist() { sed -rn ' @@ -1044,7 +1085,7 @@ # 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 @@ -1061,10 +1102,23 @@ %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 @@ -1073,6 +1127,8 @@ 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 @@ -1088,24 +1144,46 @@ ;; 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 @@ -1166,15 +1244,15 @@ 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 @@ -1426,7 +1504,7 @@ %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" != "" ++++++ kernel-docs.spec ++++++ --- /var/tmp/diff_new_pack.8NzXIb/_old 2021-08-24 10:55:03.392306350 +0200 +++ /var/tmp/diff_new_pack.8NzXIb/_new 2021-08-24 10:55:03.392306350 +0200 @@ -33,7 +33,7 @@ Group: Documentation/Man Version: 5.13.12 %if 0%{?is_kotd} -Release: <RELEASE>.g999e604 +Release: <RELEASE>.g33df9c6 %else Release: 0 %endif @@ -64,7 +64,7 @@ %endif Url: http://www.kernel.org/ Provides: %name = %version-%source_rel -Provides: %name-srchash-999e6048a4cc6accd2653c9dccaaaff2f4ae8f86 +Provides: %name-srchash-33df9c651d0aa37cce1275bd9528ea5cb9196022 BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-build Source0: http://www.kernel.org/pub/linux/kernel/v5.x/linux-%srcversion.tar.xz ++++++ kernel-kvmsmall.spec ++++++ --- /var/tmp/diff_new_pack.8NzXIb/_old 2021-08-24 10:55:03.424306307 +0200 +++ /var/tmp/diff_new_pack.8NzXIb/_new 2021-08-24 10:55:03.428306302 +0200 @@ -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.12 %if 0%{?is_kotd} -Release: <RELEASE>.g999e604 +Release: <RELEASE>.g33df9c6 %else Release: 0 %endif @@ -191,10 +205,10 @@ Conflicts: libc.so.6()(64bit) %endif Provides: kernel = %version-%source_rel -Provides: kernel-%build_flavor-base-srchash-999e6048a4cc6accd2653c9dccaaaff2f4ae8f86 -Provides: kernel-srchash-999e6048a4cc6accd2653c9dccaaaff2f4ae8f86 +Provides: kernel-%build_flavor-base-srchash-33df9c651d0aa37cce1275bd9528ea5cb9196022 +Provides: kernel-srchash-33df9c651d0aa37cce1275bd9528ea5cb9196022 # END COMMON DEPS -Provides: %name-srchash-999e6048a4cc6accd2653c9dccaaaff2f4ae8f86 +Provides: %name-srchash-33df9c651d0aa37cce1275bd9528ea5cb9196022 %obsolete_rebuilds %name Source0: http://www.kernel.org/pub/linux/kernel/v5.x/linux-%srcversion.tar.xz Source2: source-post.sh @@ -620,6 +634,14 @@ %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 @@ -715,11 +737,19 @@ # 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 @@ -781,6 +811,13 @@ -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 @@ -987,6 +1024,10 @@ fi rm -rf %{buildroot}/lib/firmware +%if 0%{?usrmerged} +# remove usrmerge aid +rm %{buildroot}/lib +%endif add_dirs_to_filelist() { sed -rn ' @@ -999,7 +1040,7 @@ # 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 @@ -1016,10 +1057,23 @@ %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 @@ -1028,6 +1082,8 @@ 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 @@ -1043,24 +1099,46 @@ ;; 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 @@ -1121,15 +1199,15 @@ 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 @@ %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" != "" kernel-lpae.spec: same change ++++++ kernel-obs-build.spec ++++++ --- /var/tmp/diff_new_pack.8NzXIb/_old 2021-08-24 10:55:03.480306234 +0200 +++ /var/tmp/diff_new_pack.8NzXIb/_new 2021-08-24 10:55:03.484306228 +0200 @@ -45,7 +45,7 @@ %endif %endif %endif -BuildRequires: kernel%kernel_flavor-srchash-999e6048a4cc6accd2653c9dccaaaff2f4ae8f86 +BuildRequires: kernel%kernel_flavor-srchash-33df9c651d0aa37cce1275bd9528ea5cb9196022 %if 0%{?rhel_version} BuildRequires: kernel @@ -66,7 +66,7 @@ Group: SLES Version: 5.13.12 %if 0%{?is_kotd} -Release: <RELEASE>.g999e604 +Release: <RELEASE>.g33df9c6 %else Release: 0 %endif ++++++ kernel-obs-qa.spec ++++++ --- /var/tmp/diff_new_pack.8NzXIb/_old 2021-08-24 10:55:03.512306191 +0200 +++ /var/tmp/diff_new_pack.8NzXIb/_new 2021-08-24 10:55:03.516306186 +0200 @@ -38,7 +38,7 @@ Group: SLES Version: 5.13.12 %if 0%{?is_kotd} -Release: <RELEASE>.g999e604 +Release: <RELEASE>.g33df9c6 %else Release: 0 %endif @@ -60,7 +60,7 @@ # 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 ++++++ kernel-pae.spec ++++++ --- /var/tmp/diff_new_pack.8NzXIb/_old 2021-08-24 10:55:03.536306159 +0200 +++ /var/tmp/diff_new_pack.8NzXIb/_new 2021-08-24 10:55:03.540306154 +0200 @@ -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.12 %if 0%{?is_kotd} -Release: <RELEASE>.g999e604 +Release: <RELEASE>.g33df9c6 %else Release: 0 %endif @@ -191,10 +205,10 @@ Conflicts: libc.so.6()(64bit) %endif Provides: kernel = %version-%source_rel -Provides: kernel-%build_flavor-base-srchash-999e6048a4cc6accd2653c9dccaaaff2f4ae8f86 -Provides: kernel-srchash-999e6048a4cc6accd2653c9dccaaaff2f4ae8f86 +Provides: kernel-%build_flavor-base-srchash-33df9c651d0aa37cce1275bd9528ea5cb9196022 +Provides: kernel-srchash-33df9c651d0aa37cce1275bd9528ea5cb9196022 # END COMMON DEPS -Provides: %name-srchash-999e6048a4cc6accd2653c9dccaaaff2f4ae8f86 +Provides: %name-srchash-33df9c651d0aa37cce1275bd9528ea5cb9196022 %ifarch %ix86 Provides: kernel-bigsmp = 2.6.17 Obsoletes: kernel-bigsmp <= 2.6.17 @@ -642,6 +656,14 @@ %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 @@ -737,11 +759,19 @@ # 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 @@ -803,6 +833,13 @@ -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 @@ -1009,6 +1046,10 @@ fi rm -rf %{buildroot}/lib/firmware +%if 0%{?usrmerged} +# remove usrmerge aid +rm %{buildroot}/lib +%endif add_dirs_to_filelist() { sed -rn ' @@ -1021,7 +1062,7 @@ # 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 @@ -1038,10 +1079,23 @@ %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 @@ -1050,6 +1104,8 @@ 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 @@ -1065,24 +1121,46 @@ ;; 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 @@ -1143,15 +1221,15 @@ 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 @@ -1375,7 +1453,7 @@ %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" != "" ++++++ kernel-source.spec ++++++ --- /var/tmp/diff_new_pack.8NzXIb/_old 2021-08-24 10:55:03.564306122 +0200 +++ /var/tmp/diff_new_pack.8NzXIb/_new 2021-08-24 10:55:03.568306117 +0200 @@ -32,7 +32,7 @@ Group: Development/Sources Version: 5.13.12 %if 0%{?is_kotd} -Release: <RELEASE>.g999e604 +Release: <RELEASE>.g33df9c6 %else Release: 0 %endif @@ -43,7 +43,7 @@ BuildRequires: sed Requires(post): coreutils sed Provides: %name = %version-%source_rel -Provides: %name-srchash-999e6048a4cc6accd2653c9dccaaaff2f4ae8f86 +Provides: %name-srchash-33df9c651d0aa37cce1275bd9528ea5cb9196022 Provides: linux Provides: multiversion(kernel) Source0: http://www.kernel.org/pub/linux/kernel/v5.x/linux-%srcversion.tar.xz ++++++ kernel-syms.spec ++++++ --- /var/tmp/diff_new_pack.8NzXIb/_old 2021-08-24 10:55:03.592306085 +0200 +++ /var/tmp/diff_new_pack.8NzXIb/_new 2021-08-24 10:55:03.596306079 +0200 @@ -27,7 +27,7 @@ Version: 5.13.12 %if %using_buildservice %if 0%{?is_kotd} -Release: <RELEASE>.g999e604 +Release: <RELEASE>.g33df9c6 %else Release: 0 %endif @@ -52,7 +52,7 @@ %endif Requires: pesign-obs-integration Provides: %name = %version-%source_rel -Provides: %name-srchash-999e6048a4cc6accd2653c9dccaaaff2f4ae8f86 +Provides: %name-srchash-33df9c651d0aa37cce1275bd9528ea5cb9196022 Provides: multiversion(kernel) Source: README.KSYMS Requires: kernel-devel%variant = %version-%source_rel ++++++ kernel-vanilla.spec ++++++ --- /var/tmp/diff_new_pack.8NzXIb/_old 2021-08-24 10:55:03.620306048 +0200 +++ /var/tmp/diff_new_pack.8NzXIb/_new 2021-08-24 10:55:03.624306043 +0200 @@ -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.12 %if 0%{?is_kotd} -Release: <RELEASE>.g999e604 +Release: <RELEASE>.g33df9c6 %else Release: 0 %endif @@ -191,10 +205,10 @@ Conflicts: libc.so.6()(64bit) %endif Provides: kernel = %version-%source_rel -Provides: kernel-%build_flavor-base-srchash-999e6048a4cc6accd2653c9dccaaaff2f4ae8f86 -Provides: kernel-srchash-999e6048a4cc6accd2653c9dccaaaff2f4ae8f86 +Provides: kernel-%build_flavor-base-srchash-33df9c651d0aa37cce1275bd9528ea5cb9196022 +Provides: kernel-srchash-33df9c651d0aa37cce1275bd9528ea5cb9196022 # END COMMON DEPS -Provides: %name-srchash-999e6048a4cc6accd2653c9dccaaaff2f4ae8f86 +Provides: %name-srchash-33df9c651d0aa37cce1275bd9528ea5cb9196022 %obsolete_rebuilds %name Source0: http://www.kernel.org/pub/linux/kernel/v5.x/linux-%srcversion.tar.xz Source2: source-post.sh @@ -613,6 +627,14 @@ %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 @@ -708,11 +730,19 @@ # 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 @@ -774,6 +804,13 @@ -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 @@ -980,6 +1017,10 @@ fi rm -rf %{buildroot}/lib/firmware +%if 0%{?usrmerged} +# remove usrmerge aid +rm %{buildroot}/lib +%endif add_dirs_to_filelist() { sed -rn ' @@ -992,7 +1033,7 @@ # 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 @@ -1009,10 +1050,23 @@ %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 @@ -1021,6 +1075,8 @@ 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 @@ -1036,24 +1092,46 @@ ;; 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 @@ -1114,15 +1192,15 @@ 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 @@ -1302,7 +1380,7 @@ %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" != "" kernel-zfcpdump.spec: same change ++++++ kernel-binary.spec.in ++++++ --- /var/tmp/diff_new_pack.8NzXIb/_old 2021-08-24 10:55:04.044305486 +0200 +++ /var/tmp/diff_new_pack.8NzXIb/_new 2021-08-24 10:55:04.048305481 +0200 @@ -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 @@ -471,6 +485,14 @@ %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 @@ -566,11 +588,19 @@ # 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 @@ -632,6 +662,13 @@ -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 @@ -838,6 +875,10 @@ fi rm -rf %{buildroot}/lib/firmware +%if 0%{?usrmerged} +# remove usrmerge aid +rm %{buildroot}/lib +%endif add_dirs_to_filelist() { sed -rn ' @@ -850,7 +891,7 @@ # 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 @@ -867,10 +908,23 @@ %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 @@ -879,6 +933,8 @@ 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 @@ -894,24 +950,46 @@ ;; 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 @@ -972,15 +1050,15 @@ 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 @@ -1163,7 +1241,7 @@ %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" != "" ++++++ kernel-obs-qa.spec.in ++++++ --- /var/tmp/diff_new_pack.8NzXIb/_old 2021-08-24 10:55:04.144305354 +0200 +++ /var/tmp/diff_new_pack.8NzXIb/_new 2021-08-24 10:55:04.144305354 +0200 @@ -60,7 +60,7 @@ # 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 ++++++ kernel-source.rpmlintrc ++++++ --- /var/tmp/diff_new_pack.8NzXIb/_old 2021-08-24 10:55:04.164305327 +0200 +++ /var/tmp/diff_new_pack.8NzXIb/_new 2021-08-24 10:55:04.168305322 +0200 @@ -2,10 +2,10 @@ addFilter("zero-length /usr/src/linux-.*-obj/.*/include/config.*h") addFilter("zero-length /usr/src/linux-.*-obj/.*/include/config/.*") # 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") ++++++ kernel-subpackage-build ++++++ --- /var/tmp/diff_new_pack.8NzXIb/_old 2021-08-24 10:55:04.208305269 +0200 +++ /var/tmp/diff_new_pack.8NzXIb/_new 2021-08-24 10:55:04.208305269 +0200 @@ -11,7 +11,7 @@ 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 @@ [ -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/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 @@ 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 ++++++ patches.suse.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/patches.suse/Bluetooth-avoid-circular-locks-in-sco_sock_connect.patch new/patches.suse/Bluetooth-avoid-circular-locks-in-sco_sock_connect.patch --- old/patches.suse/Bluetooth-avoid-circular-locks-in-sco_sock_connect.patch 1970-01-01 01:00:00.000000000 +0100 +++ new/patches.suse/Bluetooth-avoid-circular-locks-in-sco_sock_connect.patch 2021-08-18 14:54:53.000000000 +0200 @@ -0,0 +1,239 @@ +From 734bc5ff783115aa3164f4e9dd5967ae78e0a8ab Mon Sep 17 00:00:00 2001 +From: Desmond Cheong Zhi Xi <desmondcheon...@gmail.com> +Date: Tue, 10 Aug 2021 12:14:06 +0800 +Subject: [PATCH] Bluetooth: avoid circular locks in sco_sock_connect +Git-commit: 734bc5ff783115aa3164f4e9dd5967ae78e0a8ab +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git +Patch-mainline: Queued in subsystem maintainer repo +References: CVE-2021-3640 bsc#1188172 + +In a future patch, calls to bh_lock_sock in sco.c should be replaced +by lock_sock now that none of the functions are run in IRQ context. + +However, doing so results in a circular locking dependency: + +====================================================== +Warning: possible circular locking dependency detected +5.14.0-rc4-syzkaller #0 Not tainted + +Acked-by: Takashi Iwai <ti...@suse.de> + +------------------------------------------------------ +syz-executor.2/14867 is trying to acquire lock: +ffff88803e3c1120 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: +lock_sock include/net/sock.h:1613 [inline] +ffff88803e3c1120 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}, at: +sco_conn_del+0x12a/0x2a0 net/bluetooth/sco.c:191 + +but task is already holding lock: +ffffffff8d2dc7c8 (hci_cb_list_lock){+.+.}-{3:3}, at: +hci_disconn_cfm include/net/bluetooth/hci_core.h:1497 [inline] +ffffffff8d2dc7c8 (hci_cb_list_lock){+.+.}-{3:3}, at: +hci_conn_hash_flush+0xda/0x260 net/bluetooth/hci_conn.c:1608 + +which lock already depends on the new lock. + +the existing dependency chain (in reverse order) is: + +-> #2 (hci_cb_list_lock){+.+.}-{3:3}: + __mutex_lock_common kernel/locking/mutex.c:959 [inline] + __mutex_lock+0x12a/0x10a0 kernel/locking/mutex.c:1104 + hci_connect_cfm include/net/bluetooth/hci_core.h:1482 [inline] + hci_remote_features_evt net/bluetooth/hci_event.c:3263 [inline] + hci_event_packet+0x2f4d/0x7c50 net/bluetooth/hci_event.c:6240 + hci_rx_work+0x4f8/0xd30 net/bluetooth/hci_core.c:5122 + process_one_work+0x98d/0x1630 kernel/workqueue.c:2276 + worker_thread+0x658/0x11f0 kernel/workqueue.c:2422 + kthread+0x3e5/0x4d0 kernel/kthread.c:319 + ret_from_fork+0x1f/0x30 arch/x86/entry/entry_64.S:295 + +-> #1 (&hdev->lock){+.+.}-{3:3}: + __mutex_lock_common kernel/locking/mutex.c:959 [inline] + __mutex_lock+0x12a/0x10a0 kernel/locking/mutex.c:1104 + sco_connect net/bluetooth/sco.c:245 [inline] + sco_sock_connect+0x227/0xa10 net/bluetooth/sco.c:601 + __sys_connect_file+0x155/0x1a0 net/socket.c:1879 + __sys_connect+0x161/0x190 net/socket.c:1896 + __do_sys_connect net/socket.c:1906 [inline] + __se_sys_connect net/socket.c:1903 [inline] + __x64_sys_connect+0x6f/0xb0 net/socket.c:1903 + do_syscall_x64 arch/x86/entry/common.c:50 [inline] + do_syscall_64+0x35/0xb0 arch/x86/entry/common.c:80 + entry_SYSCALL_64_after_hwframe+0x44/0xae + +-> #0 (sk_lock-AF_BLUETOOTH-BTPROTO_SCO){+.+.}-{0:0}: + check_prev_add kernel/locking/lockdep.c:3051 [inline] + check_prevs_add kernel/locking/lockdep.c:3174 [inline] + validate_chain kernel/locking/lockdep.c:3789 [inline] + __lock_acquire+0x2a07/0x54a0 kernel/locking/lockdep.c:5015 + lock_acquire kernel/locking/lockdep.c:5625 [inline] + lock_acquire+0x1ab/0x510 kernel/locking/lockdep.c:5590 + lock_sock_nested+0xca/0x120 net/core/sock.c:3170 + lock_sock include/net/sock.h:1613 [inline] + sco_conn_del+0x12a/0x2a0 net/bluetooth/sco.c:191 + sco_disconn_cfm+0x71/0xb0 net/bluetooth/sco.c:1202 + hci_disconn_cfm include/net/bluetooth/hci_core.h:1500 [inline] + hci_conn_hash_flush+0x127/0x260 net/bluetooth/hci_conn.c:1608 + hci_dev_do_close+0x528/0x1130 net/bluetooth/hci_core.c:1778 + hci_unregister_dev+0x1c0/0x5a0 net/bluetooth/hci_core.c:4015 + vhci_release+0x70/0xe0 drivers/bluetooth/hci_vhci.c:340 + __fput+0x288/0x920 fs/file_table.c:280 + task_work_run+0xdd/0x1a0 kernel/task_work.c:164 + exit_task_work include/linux/task_work.h:32 [inline] + do_exit+0xbd4/0x2a60 kernel/exit.c:825 + do_group_exit+0x125/0x310 kernel/exit.c:922 + get_signal+0x47f/0x2160 kernel/signal.c:2808 + arch_do_signal_or_restart+0x2a9/0x1c40 arch/x86/kernel/signal.c:865 + handle_signal_work kernel/entry/common.c:148 [inline] + exit_to_user_mode_loop kernel/entry/common.c:172 [inline] + exit_to_user_mode_prepare+0x17d/0x290 kernel/entry/common.c:209 + __syscall_exit_to_user_mode_work kernel/entry/common.c:291 [inline] + syscall_exit_to_user_mode+0x19/0x60 kernel/entry/common.c:302 + ret_from_fork+0x15/0x30 arch/x86/entry/entry_64.S:288 + +other info that might help us debug this: + +Chain exists of: + sk_lock-AF_BLUETOOTH-BTPROTO_SCO --> &hdev->lock --> hci_cb_list_lock + + Possible unsafe locking scenario: + + CPU0 CPU1 + ---- ---- + lock(hci_cb_list_lock); + lock(&hdev->lock); + lock(hci_cb_list_lock); + lock(sk_lock-AF_BLUETOOTH-BTPROTO_SCO); + + *** DEADLOCK *** + +The issue is that the lock hierarchy should go from &hdev->lock --> +hci_cb_list_lock --> sk_lock-AF_BLUETOOTH-BTPROTO_SCO. For example, +one such call trace is: + + hci_dev_do_close(): + hci_dev_lock(); + hci_conn_hash_flush(): + hci_disconn_cfm(): + mutex_lock(&hci_cb_list_lock); + sco_disconn_cfm(): + sco_conn_del(): + lock_sock(sk); + +However, in sco_sock_connect, we call lock_sock before calling +hci_dev_lock inside sco_connect, thus inverting the lock hierarchy. + +We fix this by pulling the call to hci_dev_lock out from sco_connect. + +Signed-off-by: Desmond Cheong Zhi Xi <desmondcheon...@gmail.com> +Signed-off-by: Luiz Augusto von Dentz <luiz.von.de...@intel.com> +--- + net/bluetooth/sco.c | 39 ++++++++++++++++----------------------- + 1 file changed, 16 insertions(+), 23 deletions(-) + +diff --git a/net/bluetooth/sco.c b/net/bluetooth/sco.c +index 62e638f971a9..94a3aa686556 100644 +--- a/net/bluetooth/sco.c ++++ b/net/bluetooth/sco.c +@@ -237,44 +237,32 @@ static int sco_chan_add(struct sco_conn *conn, struct sock *sk, + return err; + } + +-static int sco_connect(struct sock *sk) ++static int sco_connect(struct hci_dev *hdev, struct sock *sk) + { + struct sco_conn *conn; + struct hci_conn *hcon; +- struct hci_dev *hdev; + int err, type; + + BT_DBG("%pMR -> %pMR", &sco_pi(sk)->src, &sco_pi(sk)->dst); + +- hdev = hci_get_route(&sco_pi(sk)->dst, &sco_pi(sk)->src, BDADDR_BREDR); +- if (!hdev) +- return -EHOSTUNREACH; +- +- hci_dev_lock(hdev); +- + if (lmp_esco_capable(hdev) && !disable_esco) + type = ESCO_LINK; + else + type = SCO_LINK; + + if (sco_pi(sk)->setting == BT_VOICE_TRANSPARENT && +- (!lmp_transp_capable(hdev) || !lmp_esco_capable(hdev))) { +- err = -EOPNOTSUPP; +- goto done; +- } ++ (!lmp_transp_capable(hdev) || !lmp_esco_capable(hdev))) ++ return -EOPNOTSUPP; + + hcon = hci_connect_sco(hdev, type, &sco_pi(sk)->dst, + sco_pi(sk)->setting); +- if (IS_ERR(hcon)) { +- err = PTR_ERR(hcon); +- goto done; +- } ++ if (IS_ERR(hcon)) ++ return PTR_ERR(hcon); + + conn = sco_conn_add(hcon); + if (!conn) { + hci_conn_drop(hcon); +- err = -ENOMEM; +- goto done; ++ return -ENOMEM; + } + + /* Update source addr of the socket */ +@@ -282,7 +270,7 @@ static int sco_connect(struct sock *sk) + + err = sco_chan_add(conn, sk, NULL); + if (err) +- goto done; ++ return err; + + if (hcon->state == BT_CONNECTED) { + sco_sock_clear_timer(sk); +@@ -292,9 +280,6 @@ static int sco_connect(struct sock *sk) + sco_sock_set_timer(sk, sk->sk_sndtimeo); + } + +-done: +- hci_dev_unlock(hdev); +- hci_dev_put(hdev); + return err; + } + +@@ -589,6 +574,7 @@ static int sco_sock_connect(struct socket *sock, struct sockaddr *addr, int alen + { + struct sockaddr_sco *sa = (struct sockaddr_sco *) addr; + struct sock *sk = sock->sk; ++ struct hci_dev *hdev; + int err; + + BT_DBG("sk %p", sk); +@@ -603,12 +589,19 @@ static int sco_sock_connect(struct socket *sock, struct sockaddr *addr, int alen + if (sk->sk_type != SOCK_SEQPACKET) + return -EINVAL; + ++ hdev = hci_get_route(&sa->sco_bdaddr, &sco_pi(sk)->src, BDADDR_BREDR); ++ if (!hdev) ++ return -EHOSTUNREACH; ++ hci_dev_lock(hdev); ++ + lock_sock(sk); + + /* Set destination address and psm */ + bacpy(&sco_pi(sk)->dst, &sa->sco_bdaddr); + +- err = sco_connect(sk); ++ err = sco_connect(hdev, sk); ++ hci_dev_unlock(hdev); ++ hci_dev_put(hdev); + if (err) + goto done; + +-- +2.26.2 + diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/patches.suse/Bluetooth-switch-to-lock_sock-in-SCO.patch new/patches.suse/Bluetooth-switch-to-lock_sock-in-SCO.patch --- old/patches.suse/Bluetooth-switch-to-lock_sock-in-SCO.patch 1970-01-01 01:00:00.000000000 +0100 +++ new/patches.suse/Bluetooth-switch-to-lock_sock-in-SCO.patch 2021-08-18 14:54:53.000000000 +0200 @@ -0,0 +1,90 @@ +From 27c24fda62b601d6f9ca5e992502578c4310876f Mon Sep 17 00:00:00 2001 +From: Desmond Cheong Zhi Xi <desmondcheon...@gmail.com> +Date: Tue, 10 Aug 2021 12:14:07 +0800 +Subject: [PATCH] Bluetooth: switch to lock_sock in SCO +Git-commit: 27c24fda62b601d6f9ca5e992502578c4310876f +Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/bluetooth/bluetooth-next.git +Patch-mainline: Queued in subsystem maintainer repo +References: CVE-2021-3640 bsc#1188172 + +Since sco_sock_timeout is now scheduled using delayed work, it is no +longer run in SOFTIRQ context. Hence bh_lock_sock is no longer +necessary in SCO to synchronise between user contexts and SOFTIRQ +processing. + +As such, calls to bh_lock_sock should be replaced with lock_sock to +synchronize with other concurrent processes that use lock_sock. + +Signed-off-by: Desmond Cheong Zhi Xi <desmondcheon...@gmail.com> +Signed-off-by: Luiz Augusto von Dentz <luiz.von.de...@intel.com> +Acked-by: Takashi Iwai <ti...@suse.de> + +--- + net/bluetooth/sco.c | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) + +--- a/net/bluetooth/sco.c ++++ b/net/bluetooth/sco.c +@@ -79,10 +79,10 @@ static void sco_sock_timeout(struct time + + BT_DBG("sock %p state %d", sk, sk->sk_state); + +- bh_lock_sock(sk); ++ lock_sock(sk); + sk->sk_err = ETIMEDOUT; + sk->sk_state_change(sk); +- bh_unlock_sock(sk); ++ release_sock(sk); + + sco_sock_kill(sk); + sock_put(sk); +@@ -172,10 +172,10 @@ static void sco_conn_del(struct hci_conn + + if (sk) { + sock_hold(sk); +- bh_lock_sock(sk); ++ lock_sock(sk); + sco_sock_clear_timer(sk); + sco_chan_del(sk, err); +- bh_unlock_sock(sk); ++ release_sock(sk); + sco_sock_kill(sk); + sock_put(sk); + } +@@ -1021,10 +1021,10 @@ static void sco_conn_ready(struct sco_co + + if (sk) { + sco_sock_clear_timer(sk); +- bh_lock_sock(sk); ++ lock_sock(sk); + sk->sk_state = BT_CONNECTED; + sk->sk_state_change(sk); +- bh_unlock_sock(sk); ++ release_sock(sk); + } else { + sco_conn_lock(conn); + +@@ -1039,12 +1039,12 @@ static void sco_conn_ready(struct sco_co + return; + } + +- bh_lock_sock(parent); ++ lock_sock(parent); + + sk = sco_sock_alloc(sock_net(parent), NULL, + BTPROTO_SCO, GFP_ATOMIC, 0); + if (!sk) { +- bh_unlock_sock(parent); ++ release_sock(parent); + sco_conn_unlock(conn); + return; + } +@@ -1065,7 +1065,7 @@ static void sco_conn_ready(struct sco_co + /* Wake up parent */ + parent->sk_data_ready(parent); + +- bh_unlock_sock(parent); ++ release_sock(parent); + + sco_conn_unlock(conn); + } ++++++ post.sh ++++++ --- /var/tmp/diff_new_pack.8NzXIb/_old 2021-08-24 10:55:04.456304941 +0200 +++ /var/tmp/diff_new_pack.8NzXIb/_new 2021-08-24 10:55:04.456304941 +0200 @@ -10,6 +10,23 @@ 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 [ @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 ++++++ postun.sh ++++++ --- /var/tmp/diff_new_pack.8NzXIb/_old 2021-08-24 10:55:04.480304909 +0200 +++ /var/tmp/diff_new_pack.8NzXIb/_new 2021-08-24 10:55:04.480304909 +0200 @@ -6,7 +6,7 @@ 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 @@ 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 ++++++ series.conf ++++++ --- /var/tmp/diff_new_pack.8NzXIb/_old 2021-08-24 10:55:04.544304824 +0200 +++ /var/tmp/diff_new_pack.8NzXIb/_new 2021-08-24 10:55:04.548304819 +0200 @@ -2487,6 +2487,8 @@ patches.suse/Bluetooth-btusb-Add-support-for-Lite-On-Mediatek-Chi.patch patches.suse/Bluetooth-btusb-Add-support-for-IMC-Networks-Mediate.patch patches.suse/Bluetooth-btusb-Add-support-for-Foxconn-Mediatek-Chi.patch + patches.suse/Bluetooth-avoid-circular-locks-in-sco_sock_connect.patch + patches.suse/Bluetooth-switch-to-lock_sock-in-SCO.patch ######################################################## # USB ++++++ source-timestamp ++++++ --- /var/tmp/diff_new_pack.8NzXIb/_old 2021-08-24 10:55:04.576304781 +0200 +++ /var/tmp/diff_new_pack.8NzXIb/_new 2021-08-24 10:55:04.576304781 +0200 @@ -1,3 +1,3 @@ -2021-08-18 08:01:38 +0000 -GIT Revision: 999e6048a4cc6accd2653c9dccaaaff2f4ae8f86 +2021-08-20 07:04:28 +0000 +GIT Revision: 33df9c651d0aa37cce1275bd9528ea5cb9196022 GIT Branch: stable ++++++ split-modules ++++++ --- /var/tmp/diff_new_pack.8NzXIb/_old 2021-08-24 10:55:04.588304766 +0200 +++ /var/tmp/diff_new_pack.8NzXIb/_new 2021-08-24 10:55:04.592304761 +0200 @@ -77,7 +77,7 @@ 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 @@ # 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 ++++++ splitflist ++++++ --- /var/tmp/diff_new_pack.8NzXIb/_old 2021-08-24 10:55:04.604304745 +0200 +++ /var/tmp/diff_new_pack.8NzXIb/_new 2021-08-24 10:55:04.604304745 +0200 @@ -1,4 +1,4 @@ -#!/bin/sh -e +#!/bin/bash -e package="$1" present="$2" @@ -10,6 +10,7 @@ [ -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"