mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	kbuild: do not put .scmversion into the source tarball
.scmversion is used by (src)rpm-pkg and deb-pkg to carry KERNELRELEASE. In fact, deb-pkg does not rely on it any more because the generated debian/rules specifies KERNELRELEASE from the command line. Do likwise for (src)rpm-pkg, and remove this feature. For the same reason, you do not need to save LOCALVERSION in the spec file. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nicolas Schier <nicolas@fjasle.eu>
This commit is contained in:
		
							parent
							
								
									c9f9cf2560
								
							
						
					
					
						commit
						f6e09b07cc
					
				
					 4 changed files with 8 additions and 27 deletions
				
			
		| 
						 | 
					@ -32,7 +32,7 @@ export KDEB_SOURCENAME
 | 
				
			||||||
TAR_CONTENT := Documentation LICENSES arch block certs crypto drivers fs \
 | 
					TAR_CONTENT := Documentation LICENSES arch block certs crypto drivers fs \
 | 
				
			||||||
               include init io_uring ipc kernel lib mm net rust \
 | 
					               include init io_uring ipc kernel lib mm net rust \
 | 
				
			||||||
               samples scripts security sound tools usr virt \
 | 
					               samples scripts security sound tools usr virt \
 | 
				
			||||||
               .config .scmversion Makefile \
 | 
					               .config Makefile \
 | 
				
			||||||
               Kbuild Kconfig COPYING $(wildcard localversion*)
 | 
					               Kbuild Kconfig COPYING $(wildcard localversion*)
 | 
				
			||||||
MKSPEC     := $(srctree)/scripts/package/mkspec
 | 
					MKSPEC     := $(srctree)/scripts/package/mkspec
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -47,10 +47,8 @@ if test "$(objtree)" != "$(srctree)"; then \
 | 
				
			||||||
	echo >&2; \
 | 
						echo >&2; \
 | 
				
			||||||
	false; \
 | 
						false; \
 | 
				
			||||||
fi ; \
 | 
					fi ; \
 | 
				
			||||||
$(srctree)/scripts/setlocalversion --save-scmversion; \
 | 
					 | 
				
			||||||
tar -I $(KGZIP) -c $(RCS_TAR_IGNORE) -f $(2).tar.gz \
 | 
					tar -I $(KGZIP) -c $(RCS_TAR_IGNORE) -f $(2).tar.gz \
 | 
				
			||||||
	--transform 's:^:$(2)/:S' $(TAR_CONTENT) $(3); \
 | 
						--transform 's:^:$(2)/:S' $(TAR_CONTENT) $(3)
 | 
				
			||||||
rm -f $(objtree)/.scmversion
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
# rpm-pkg
 | 
					# rpm-pkg
 | 
				
			||||||
# ---------------------------------------------------------------------------
 | 
					# ---------------------------------------------------------------------------
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -33,8 +33,6 @@ EXCLUDES="$RCS_TAR_IGNORE --exclude=*vmlinux* --exclude=*.mod \
 | 
				
			||||||
--exclude=*.o --exclude=*.ko --exclude=*.cmd --exclude=Documentation \
 | 
					--exclude=*.o --exclude=*.ko --exclude=*.cmd --exclude=Documentation \
 | 
				
			||||||
--exclude=.config.old --exclude=.missing-syscalls.d --exclude=*.s"
 | 
					--exclude=.config.old --exclude=.missing-syscalls.d --exclude=*.s"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
test -n "$LOCALVERSION" && MAKE="$MAKE LOCALVERSION=$LOCALVERSION"
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
# We can label the here-doc lines for conditional output to the spec file
 | 
					# We can label the here-doc lines for conditional output to the spec file
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
# Labels:
 | 
					# Labels:
 | 
				
			||||||
| 
						 | 
					@ -90,7 +88,7 @@ $S	rm -f scripts/basic/fixdep scripts/kconfig/conf
 | 
				
			||||||
$S	rm -f tools/objtool/{fixdep,objtool}
 | 
					$S	rm -f tools/objtool/{fixdep,objtool}
 | 
				
			||||||
$S
 | 
					$S
 | 
				
			||||||
$S	%build
 | 
					$S	%build
 | 
				
			||||||
$S	$MAKE %{?_smp_mflags} KBUILD_BUILD_VERSION=%{release}
 | 
					$S	$MAKE %{?_smp_mflags} KERNELRELEASE=$KERNELRELEASE KBUILD_BUILD_VERSION=%{release}
 | 
				
			||||||
$S
 | 
					$S
 | 
				
			||||||
	%install
 | 
						%install
 | 
				
			||||||
	mkdir -p %{buildroot}/boot
 | 
						mkdir -p %{buildroot}/boot
 | 
				
			||||||
| 
						 | 
					@ -101,8 +99,8 @@ $S
 | 
				
			||||||
	%else
 | 
						%else
 | 
				
			||||||
	cp \$($MAKE -s image_name) %{buildroot}/boot/vmlinuz-$KERNELRELEASE
 | 
						cp \$($MAKE -s image_name) %{buildroot}/boot/vmlinuz-$KERNELRELEASE
 | 
				
			||||||
	%endif
 | 
						%endif
 | 
				
			||||||
$M	$MAKE %{?_smp_mflags} INSTALL_MOD_PATH=%{buildroot} modules_install
 | 
					$M	$MAKE %{?_smp_mflags} KERNELRELEASE=$KERNELRELEASE INSTALL_MOD_PATH=%{buildroot} modules_install
 | 
				
			||||||
	$MAKE %{?_smp_mflags} INSTALL_HDR_PATH=%{buildroot}/usr headers_install
 | 
						$MAKE %{?_smp_mflags} KERNELRELEASE=$KERNELRELEASE INSTALL_HDR_PATH=%{buildroot}/usr headers_install
 | 
				
			||||||
	cp System.map %{buildroot}/boot/System.map-$KERNELRELEASE
 | 
						cp System.map %{buildroot}/boot/System.map-$KERNELRELEASE
 | 
				
			||||||
	cp .config %{buildroot}/boot/config-$KERNELRELEASE
 | 
						cp .config %{buildroot}/boot/config-$KERNELRELEASE
 | 
				
			||||||
$S$M	rm -f %{buildroot}/lib/modules/$KERNELRELEASE/build
 | 
					$S$M	rm -f %{buildroot}/lib/modules/$KERNELRELEASE/build
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -31,3 +31,5 @@ rm -f scripts/kconfig/[gmnq]conf-cfg
 | 
				
			||||||
rm -f rust/target.json
 | 
					rm -f rust/target.json
 | 
				
			||||||
 | 
					
 | 
				
			||||||
rm -f scripts/bin2c
 | 
					rm -f scripts/bin2c
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					rm -f .scmversion
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -11,16 +11,11 @@
 | 
				
			||||||
#
 | 
					#
 | 
				
			||||||
 | 
					
 | 
				
			||||||
usage() {
 | 
					usage() {
 | 
				
			||||||
	echo "Usage: $0 [--save-scmversion] [srctree]" >&2
 | 
						echo "Usage: $0 [srctree]" >&2
 | 
				
			||||||
	exit 1
 | 
						exit 1
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
scm_only=false
 | 
					 | 
				
			||||||
srctree=.
 | 
					srctree=.
 | 
				
			||||||
if test "$1" = "--save-scmversion"; then
 | 
					 | 
				
			||||||
	scm_only=true
 | 
					 | 
				
			||||||
	shift
 | 
					 | 
				
			||||||
fi
 | 
					 | 
				
			||||||
if test $# -gt 0; then
 | 
					if test $# -gt 0; then
 | 
				
			||||||
	srctree=$1
 | 
						srctree=$1
 | 
				
			||||||
	shift
 | 
						shift
 | 
				
			||||||
| 
						 | 
					@ -35,10 +30,6 @@ scm_version()
 | 
				
			||||||
	short=false
 | 
						short=false
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	cd "$srctree"
 | 
						cd "$srctree"
 | 
				
			||||||
	if test -e .scmversion; then
 | 
					 | 
				
			||||||
		cat .scmversion
 | 
					 | 
				
			||||||
		return
 | 
					 | 
				
			||||||
	fi
 | 
					 | 
				
			||||||
	if test "$1" = "--short"; then
 | 
						if test "$1" = "--short"; then
 | 
				
			||||||
		short=true
 | 
							short=true
 | 
				
			||||||
	fi
 | 
						fi
 | 
				
			||||||
| 
						 | 
					@ -103,14 +94,6 @@ collect_files()
 | 
				
			||||||
	echo "$res"
 | 
						echo "$res"
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
if $scm_only; then
 | 
					 | 
				
			||||||
	if test ! -e .scmversion; then
 | 
					 | 
				
			||||||
		res=$(scm_version)
 | 
					 | 
				
			||||||
		echo "$res" >.scmversion
 | 
					 | 
				
			||||||
	fi
 | 
					 | 
				
			||||||
	exit
 | 
					 | 
				
			||||||
fi
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
if ! test -e include/config/auto.conf; then
 | 
					if ! test -e include/config/auto.conf; then
 | 
				
			||||||
	echo "Error: kernelrelease not valid - run 'make prepare' to update it" >&2
 | 
						echo "Error: kernelrelease not valid - run 'make prepare' to update it" >&2
 | 
				
			||||||
	exit 1
 | 
						exit 1
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue