lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20230419062056.7964-1-jiweisun126@126.com>
Date:   Wed, 19 Apr 2023 14:20:56 +0800
From:   jiweisun126@....com
To:     masahiroy@...nel.org, nathan@...nel.org, ndesaulniers@...gle.com,
        nicolas@...sle.eu, linux-kbuild@...r.kernel.org,
        linux-kernel@...r.kernel.org, sunjw10@...ovo.com
Cc:     jiwei.sun.bj@...com
Subject: [PATCH] kbuild: rpm-pkg: fix rpm-pkg build error

From: Jiwei Sun <sunjw10@...ovo.com>

The following error will trigger when building rpm-pkg
$ make rpm-pkg
  SYNC    include/config/auto.conf.cmd
  HOSTLD  scripts/kconfig/conf
  UPD     include/config/kernel.release
  UPD     .tmp_HEAD
  ARCHIVE linux.tar.gz
sh ./scripts/package/mkspec >./kernel.spec
rpmbuild  --target x86_64-linux -bs kernel.spec \
--define='_smp_mflags %{nil}' --define='_sourcedir rpmbuild/SOURCES' --define='_srcrpmdir .'
Building target platforms: x86_64-linux
Building for target x86_64-linux
Wrote: ./kernel-6.3.0_rc7-47.src.rpm
rpmbuild  --target x86_64-linux -rb kernel-6.3.0_rc7-47.src.rpm \
--define='_smp_mflags %{nil}'
Installing kernel-6.3.0_rc7-47.src.rpm
Building target platforms: x86_64-linux
Building for target x86_64-linux
Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.QtGSXP
+ umask 022
+ cd /mnt/datapart/rpmbuild/BUILD
+ cd /mnt/datapart/rpmbuild/BUILD
+ rm -rf linux
+ /usr/bin/gzip -dc /mnt/datapart/rpmbuild/SOURCES/linux.tar.gz
+ /usr/bin/tar -xof -
+ STATUS=0
+ '[' 0 -ne 0 ']'
+ cd linux
/var/tmp/rpm-tmp.QtGSXP: line 40: cd: linux: No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.QtGSXP (%prep)

There is linux.tar, not linux, and the linux.tar.gz is create by the following
 quiet_cmd_archive = ARCHIVE $@
       cmd_archive = git -C $(srctree) $(git-config-tar$(suffix $@)) archive \
                     --output=$$(realpath $@) --prefix=$(basename $@)/ $(archive-args)
Here the $@ is linux.tar.gz, and $(basename $@) will be linux.tar,
The above fact is the cause, so use $(basename $(basename $@)) to get the right directory name.

Signed-off-by: Jiwei Sun <sunjw10@...ovo.com>
---
 scripts/Makefile.package | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/Makefile.package b/scripts/Makefile.package
index 4d90691505b1..3718ecdf9edf 100644
--- a/scripts/Makefile.package
+++ b/scripts/Makefile.package
@@ -49,7 +49,7 @@ git-config-tar.zst = -c tar.tar.zst.command="$(ZSTD)"
 
 quiet_cmd_archive = ARCHIVE $@
       cmd_archive = git -C $(srctree) $(git-config-tar$(suffix $@)) archive \
-                    --output=$$(realpath $@) --prefix=$(basename $@)/ $(archive-args)
+                    --output=$$(realpath $@) --prefix=$(basename $(basename $@))/ $(archive-args)
 
 # Linux source tarball
 # ---------------------------------------------------------------------------
-- 
2.27.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ