Commit e12e00e3 authored by Linus Torvalds's avatar Linus Torvalds

Merge tag 'kbuild-fixes-v4.20' of...

Merge tag 'kbuild-fixes-v4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild

Pull Kbuild fixes from Masahiro Yamada:

 - fix build errors in binrpm-pkg and bindeb-pkg targets

 - fix false positive matches in merge_config.sh

 - fix build version mismatch in deb-pkg target

 - fix dtbs_install handling in (bin)deb-pkg target

 - revert a commit that allows setlocalversion to write to source tree

* tag 'kbuild-fixes-v4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
  builddeb: Fix inclusion of dtbs in debian package
  Revert "scripts/setlocalversion: git: Make -dirty check more robust"
  kbuild: deb-pkg: fix too low build version number
  kconfig: merge_config: avoid false positive matches from comment lines
  kbuild: deb-pkg: fix bindeb-pkg breakage when O= is used
  kbuild: rpm-pkg: fix binrpm-pkg breakage when O= is used
parents 63a42e1a d5615e47
...@@ -102,7 +102,8 @@ if [ ! -r "$INITFILE" ]; then ...@@ -102,7 +102,8 @@ if [ ! -r "$INITFILE" ]; then
fi fi
MERGE_LIST=$* MERGE_LIST=$*
SED_CONFIG_EXP="s/^\(# \)\{0,1\}\(${CONFIG_PREFIX}[a-zA-Z0-9_]*\)[= ].*/\2/p" SED_CONFIG_EXP1="s/^\(${CONFIG_PREFIX}[a-zA-Z0-9_]*\)=.*/\1/p"
SED_CONFIG_EXP2="s/^# \(${CONFIG_PREFIX}[a-zA-Z0-9_]*\) is not set$/\1/p"
TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX) TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX)
...@@ -116,7 +117,7 @@ for MERGE_FILE in $MERGE_LIST ; do ...@@ -116,7 +117,7 @@ for MERGE_FILE in $MERGE_LIST ; do
echo "The merge file '$MERGE_FILE' does not exist. Exit." >&2 echo "The merge file '$MERGE_FILE' does not exist. Exit." >&2
exit 1 exit 1
fi fi
CFG_LIST=$(sed -n "$SED_CONFIG_EXP" $MERGE_FILE) CFG_LIST=$(sed -n -e "$SED_CONFIG_EXP1" -e "$SED_CONFIG_EXP2" $MERGE_FILE)
for CFG in $CFG_LIST ; do for CFG in $CFG_LIST ; do
grep -q -w $CFG $TMP_FILE || continue grep -q -w $CFG $TMP_FILE || continue
...@@ -159,7 +160,7 @@ make KCONFIG_ALLCONFIG=$TMP_FILE $OUTPUT_ARG $ALLTARGET ...@@ -159,7 +160,7 @@ make KCONFIG_ALLCONFIG=$TMP_FILE $OUTPUT_ARG $ALLTARGET
# Check all specified config values took (might have missed-dependency issues) # Check all specified config values took (might have missed-dependency issues)
for CFG in $(sed -n "$SED_CONFIG_EXP" $TMP_FILE); do for CFG in $(sed -n -e "$SED_CONFIG_EXP1" -e "$SED_CONFIG_EXP2" $TMP_FILE); do
REQUESTED_VAL=$(grep -w -e "$CFG" $TMP_FILE) REQUESTED_VAL=$(grep -w -e "$CFG" $TMP_FILE)
ACTUAL_VAL=$(grep -w -e "$CFG" "$KCONFIG_CONFIG") ACTUAL_VAL=$(grep -w -e "$CFG" "$KCONFIG_CONFIG")
......
...@@ -81,11 +81,11 @@ else ...@@ -81,11 +81,11 @@ else
cp System.map "$tmpdir/boot/System.map-$version" cp System.map "$tmpdir/boot/System.map-$version"
cp $KCONFIG_CONFIG "$tmpdir/boot/config-$version" cp $KCONFIG_CONFIG "$tmpdir/boot/config-$version"
fi fi
cp "$($MAKE -s image_name)" "$tmpdir/$installed_image_path" cp "$($MAKE -s -f $srctree/Makefile image_name)" "$tmpdir/$installed_image_path"
if grep -q "^CONFIG_OF=y" $KCONFIG_CONFIG ; then if grep -q "^CONFIG_OF_EARLY_FLATTREE=y" $KCONFIG_CONFIG ; then
# Only some architectures with OF support have this target # Only some architectures with OF support have this target
if grep -q dtbs_install "${srctree}/arch/$SRCARCH/Makefile"; then if [ -d "${srctree}/arch/$SRCARCH/boot/dts" ]; then
$MAKE KBUILD_SRC= INSTALL_DTBS_PATH="$tmpdir/usr/lib/$packagename" dtbs_install $MAKE KBUILD_SRC= INSTALL_DTBS_PATH="$tmpdir/usr/lib/$packagename" dtbs_install
fi fi
fi fi
......
...@@ -88,6 +88,7 @@ set_debarch() { ...@@ -88,6 +88,7 @@ set_debarch() {
version=$KERNELRELEASE version=$KERNELRELEASE
if [ -n "$KDEB_PKGVERSION" ]; then if [ -n "$KDEB_PKGVERSION" ]; then
packageversion=$KDEB_PKGVERSION packageversion=$KDEB_PKGVERSION
revision=${packageversion##*-}
else else
revision=$(cat .version 2>/dev/null||echo 1) revision=$(cat .version 2>/dev/null||echo 1)
packageversion=$version-$revision packageversion=$version-$revision
...@@ -205,10 +206,12 @@ cat <<EOF > debian/rules ...@@ -205,10 +206,12 @@ cat <<EOF > debian/rules
#!$(command -v $MAKE) -f #!$(command -v $MAKE) -f
build: build:
\$(MAKE) KERNELRELEASE=${version} ARCH=${ARCH} KBUILD_SRC= \$(MAKE) KERNELRELEASE=${version} ARCH=${ARCH} \
KBUILD_BUILD_VERSION=${revision} KBUILD_SRC=
binary-arch: binary-arch:
\$(MAKE) KERNELRELEASE=${version} ARCH=${ARCH} KBUILD_SRC= intdeb-pkg \$(MAKE) KERNELRELEASE=${version} ARCH=${ARCH} \
KBUILD_BUILD_VERSION=${revision} KBUILD_SRC= intdeb-pkg
clean: clean:
rm -rf debian/*tmp debian/files rm -rf debian/*tmp debian/files
......
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
# how we were called determines which rpms we build and how we build them # how we were called determines which rpms we build and how we build them
if [ "$1" = prebuilt ]; then if [ "$1" = prebuilt ]; then
S=DEL S=DEL
MAKE="$MAKE -f $srctree/Makefile"
else else
S= S=
fi fi
...@@ -78,19 +79,19 @@ $S %prep ...@@ -78,19 +79,19 @@ $S %prep
$S %setup -q $S %setup -q
$S $S
$S %build $S %build
$S make %{?_smp_mflags} KBUILD_BUILD_VERSION=%{release} $S $MAKE %{?_smp_mflags} KBUILD_BUILD_VERSION=%{release}
$S $S
%install %install
mkdir -p %{buildroot}/boot mkdir -p %{buildroot}/boot
%ifarch ia64 %ifarch ia64
mkdir -p %{buildroot}/boot/efi mkdir -p %{buildroot}/boot/efi
cp \$(make image_name) %{buildroot}/boot/efi/vmlinuz-$KERNELRELEASE cp \$($MAKE image_name) %{buildroot}/boot/efi/vmlinuz-$KERNELRELEASE
ln -s efi/vmlinuz-$KERNELRELEASE %{buildroot}/boot/ ln -s efi/vmlinuz-$KERNELRELEASE %{buildroot}/boot/
%else %else
cp \$(make image_name) %{buildroot}/boot/vmlinuz-$KERNELRELEASE cp \$($MAKE image_name) %{buildroot}/boot/vmlinuz-$KERNELRELEASE
%endif %endif
$M make %{?_smp_mflags} INSTALL_MOD_PATH=%{buildroot} KBUILD_SRC= modules_install $M $MAKE %{?_smp_mflags} INSTALL_MOD_PATH=%{buildroot} modules_install
make %{?_smp_mflags} INSTALL_HDR_PATH=%{buildroot}/usr KBUILD_SRC= headers_install $MAKE %{?_smp_mflags} 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
bzip2 -9 --keep vmlinux bzip2 -9 --keep vmlinux
......
...@@ -74,7 +74,7 @@ scm_version() ...@@ -74,7 +74,7 @@ scm_version()
fi fi
# Check for uncommitted changes # Check for uncommitted changes
if git status -uno --porcelain | grep -qv '^.. scripts/package'; then if git diff-index --name-only HEAD | grep -qv "^scripts/package"; then
printf '%s' -dirty printf '%s' -dirty
fi fi
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment