Skip to content

Commit e12e00e

Browse files
committed
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
2 parents 63a42e1 + d5615e4 commit e12e00e

File tree

5 files changed

+19
-14
lines changed

5 files changed

+19
-14
lines changed

scripts/kconfig/merge_config.sh

+4-3
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ if [ ! -r "$INITFILE" ]; then
102102
fi
103103

104104
MERGE_LIST=$*
105-
SED_CONFIG_EXP="s/^\(# \)\{0,1\}\(${CONFIG_PREFIX}[a-zA-Z0-9_]*\)[= ].*/\2/p"
105+
SED_CONFIG_EXP1="s/^\(${CONFIG_PREFIX}[a-zA-Z0-9_]*\)=.*/\1/p"
106+
SED_CONFIG_EXP2="s/^# \(${CONFIG_PREFIX}[a-zA-Z0-9_]*\) is not set$/\1/p"
106107

107108
TMP_FILE=$(mktemp ./.tmp.config.XXXXXXXXXX)
108109

@@ -116,7 +117,7 @@ for MERGE_FILE in $MERGE_LIST ; do
116117
echo "The merge file '$MERGE_FILE' does not exist. Exit." >&2
117118
exit 1
118119
fi
119-
CFG_LIST=$(sed -n "$SED_CONFIG_EXP" $MERGE_FILE)
120+
CFG_LIST=$(sed -n -e "$SED_CONFIG_EXP1" -e "$SED_CONFIG_EXP2" $MERGE_FILE)
120121

121122
for CFG in $CFG_LIST ; do
122123
grep -q -w $CFG $TMP_FILE || continue
@@ -159,7 +160,7 @@ make KCONFIG_ALLCONFIG=$TMP_FILE $OUTPUT_ARG $ALLTARGET
159160

160161

161162
# Check all specified config values took (might have missed-dependency issues)
162-
for CFG in $(sed -n "$SED_CONFIG_EXP" $TMP_FILE); do
163+
for CFG in $(sed -n -e "$SED_CONFIG_EXP1" -e "$SED_CONFIG_EXP2" $TMP_FILE); do
163164

164165
REQUESTED_VAL=$(grep -w -e "$CFG" $TMP_FILE)
165166
ACTUAL_VAL=$(grep -w -e "$CFG" "$KCONFIG_CONFIG")

scripts/package/builddeb

+3-3
Original file line numberDiff line numberDiff line change
@@ -81,11 +81,11 @@ else
8181
cp System.map "$tmpdir/boot/System.map-$version"
8282
cp $KCONFIG_CONFIG "$tmpdir/boot/config-$version"
8383
fi
84-
cp "$($MAKE -s image_name)" "$tmpdir/$installed_image_path"
84+
cp "$($MAKE -s -f $srctree/Makefile image_name)" "$tmpdir/$installed_image_path"
8585

86-
if grep -q "^CONFIG_OF=y" $KCONFIG_CONFIG ; then
86+
if grep -q "^CONFIG_OF_EARLY_FLATTREE=y" $KCONFIG_CONFIG ; then
8787
# Only some architectures with OF support have this target
88-
if grep -q dtbs_install "${srctree}/arch/$SRCARCH/Makefile"; then
88+
if [ -d "${srctree}/arch/$SRCARCH/boot/dts" ]; then
8989
$MAKE KBUILD_SRC= INSTALL_DTBS_PATH="$tmpdir/usr/lib/$packagename" dtbs_install
9090
fi
9191
fi

scripts/package/mkdebian

+5-2
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ set_debarch() {
8888
version=$KERNELRELEASE
8989
if [ -n "$KDEB_PKGVERSION" ]; then
9090
packageversion=$KDEB_PKGVERSION
91+
revision=${packageversion##*-}
9192
else
9293
revision=$(cat .version 2>/dev/null||echo 1)
9394
packageversion=$version-$revision
@@ -205,10 +206,12 @@ cat <<EOF > debian/rules
205206
#!$(command -v $MAKE) -f
206207
207208
build:
208-
\$(MAKE) KERNELRELEASE=${version} ARCH=${ARCH} KBUILD_SRC=
209+
\$(MAKE) KERNELRELEASE=${version} ARCH=${ARCH} \
210+
KBUILD_BUILD_VERSION=${revision} KBUILD_SRC=
209211
210212
binary-arch:
211-
\$(MAKE) KERNELRELEASE=${version} ARCH=${ARCH} KBUILD_SRC= intdeb-pkg
213+
\$(MAKE) KERNELRELEASE=${version} ARCH=${ARCH} \
214+
KBUILD_BUILD_VERSION=${revision} KBUILD_SRC= intdeb-pkg
212215
213216
clean:
214217
rm -rf debian/*tmp debian/files

scripts/package/mkspec

+6-5
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# how we were called determines which rpms we build and how we build them
1313
if [ "$1" = prebuilt ]; then
1414
S=DEL
15+
MAKE="$MAKE -f $srctree/Makefile"
1516
else
1617
S=
1718
fi
@@ -78,19 +79,19 @@ $S %prep
7879
$S %setup -q
7980
$S
8081
$S %build
81-
$S make %{?_smp_mflags} KBUILD_BUILD_VERSION=%{release}
82+
$S $MAKE %{?_smp_mflags} KBUILD_BUILD_VERSION=%{release}
8283
$S
8384
%install
8485
mkdir -p %{buildroot}/boot
8586
%ifarch ia64
8687
mkdir -p %{buildroot}/boot/efi
87-
cp \$(make image_name) %{buildroot}/boot/efi/vmlinuz-$KERNELRELEASE
88+
cp \$($MAKE image_name) %{buildroot}/boot/efi/vmlinuz-$KERNELRELEASE
8889
ln -s efi/vmlinuz-$KERNELRELEASE %{buildroot}/boot/
8990
%else
90-
cp \$(make image_name) %{buildroot}/boot/vmlinuz-$KERNELRELEASE
91+
cp \$($MAKE image_name) %{buildroot}/boot/vmlinuz-$KERNELRELEASE
9192
%endif
92-
$M make %{?_smp_mflags} INSTALL_MOD_PATH=%{buildroot} KBUILD_SRC= modules_install
93-
make %{?_smp_mflags} INSTALL_HDR_PATH=%{buildroot}/usr KBUILD_SRC= headers_install
93+
$M $MAKE %{?_smp_mflags} INSTALL_MOD_PATH=%{buildroot} modules_install
94+
$MAKE %{?_smp_mflags} INSTALL_HDR_PATH=%{buildroot}/usr headers_install
9495
cp System.map %{buildroot}/boot/System.map-$KERNELRELEASE
9596
cp .config %{buildroot}/boot/config-$KERNELRELEASE
9697
bzip2 -9 --keep vmlinux

scripts/setlocalversion

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ scm_version()
7474
fi
7575

7676
# Check for uncommitted changes
77-
if git status -uno --porcelain | grep -qv '^.. scripts/package'; then
77+
if git diff-index --name-only HEAD | grep -qv "^scripts/package"; then
7878
printf '%s' -dirty
7979
fi
8080

0 commit comments

Comments
 (0)