Since commit f8d94c4e403c ("kbuild: do not create intermediate *.tar for source tarballs"), 'make rpm-pkg' fails because the prefix of the source tarball is 'linux.tar/' instead of 'linux/'. $(basename $@) strips only '.gz' from the filename linux.tar.gz. You need to strip two suffixes from compressed tarballs and one suffix from uncompressed tarballs (for example 'perf-6.3.0.tar' generated by 'make perf-tar-src-pkg'). One tricky fix might be --prefix=$(firstword $(subst .tar, ,$@))/ but I think it is better to hard-code the prefix.
Showing the changes to scripts (1 of 1 file). Show all
Unified · Split
| @@ -49,7 +49,7 @@ git-config-tar.zst = -c tar.tar.zst.command="$(ZSTD)" · 48 unmodified lines | |||
| 49 | 49 | ||
| 50 | quiet_cmd_archive = ARCHIVE $@ | 50 | quiet_cmd_archive = ARCHIVE $@ |
| 51 | cmd_archive = git -C $(srctree) $(git-config-tar$(suffix $@)) archive \ | 51 | cmd_archive = git -C $(srctree) $(git-config-tar$(suffix $@)) archive \ |
| 52 | --output=$$(realpath $@) --prefix=$(basename $@)/ $(archive-args) | 52 | --output=$$(realpath $@) $(archive-args) |
| 53 | 53 | ||
| 54 | # Linux source tarball | 54 | # Linux source tarball |
| 55 | # --------------------------------------------------------------------------- | 55 | # --------------------------------------------------------------------------- |
| @@ -57,7 +57,7 @@ quiet_cmd_archive = ARCHIVE $@ · 1 unmodified line | |||
| 57 | linux-tarballs := $(addprefix linux, .tar.gz) | 57 | linux-tarballs := $(addprefix linux, .tar.gz) |
| 58 | 58 | ||
| 59 | targets += $(linux-tarballs) | 59 | targets += $(linux-tarballs) |
| 60 | $(linux-tarballs): archive-args = $$(cat $<) | 60 | $(linux-tarballs): archive-args = --prefix=linux/ $$(cat $<) |
| 61 | $(linux-tarballs): .tmp_HEAD FORCE | 61 | $(linux-tarballs): .tmp_HEAD FORCE |
| 62 | $(call if_changed,archive) | 62 | $(call if_changed,archive) |
| 63 | 63 | ||
| @@ -189,7 +189,7 @@ perf-archive-args = --add-file=$$(realpath $(word 2, $^)) \ · 125 unmodified lines | |||
| 189 | perf-tarballs := $(addprefix perf-$(KERNELVERSION), .tar .tar.gz .tar.bz2 .tar.xz .tar.zst) | 189 | perf-tarballs := $(addprefix perf-$(KERNELVERSION), .tar .tar.gz .tar.bz2 .tar.xz .tar.zst) |
| 190 | 190 | ||
| 191 | targets += $(perf-tarballs) | 191 | targets += $(perf-tarballs) |
| 192 | $(perf-tarballs): archive-args = $(perf-archive-args) | 192 | $(perf-tarballs): archive-args = --prefix=perf-$(KERNELVERSION)/ $(perf-archive-args) |
| 193 | $(perf-tarballs): tools/perf/MANIFEST .tmp_perf/HEAD .tmp_perf/PERF-VERSION-FILE FORCE | 193 | $(perf-tarballs): tools/perf/MANIFEST .tmp_perf/HEAD .tmp_perf/PERF-VERSION-FILE FORCE |
| 194 | $(call if_changed,archive) | 194 | $(call if_changed,archive) |
| 195 | 195 | ||