From 15f6d337159b2a9fdad8c0bef50ec826593ed5d2 Mon Sep 17 00:00:00 2001 From: Wilfried Klaebe Date: Tue, 28 Jun 2016 12:21:33 +0000 Subject: builddeb: really include objtool binary in headers package MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On May 4th, Bjørn Mork provided patch 697bbc7b8320 ("builddeb: include objtool binary in headers package"). However, that one only works if $srctree=$objtree, because the objtool binaries are not written to the srctree, but to the objtree. Signed-off-by: Wilfried Klaebe Fixes: 697bbc7b8320 ("builddeb: include objtool binary in headers package") Signed-off-by: Michal Marek --- scripts/package/builddeb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts/package') diff --git a/scripts/package/builddeb b/scripts/package/builddeb index 86e56fef7473..202d6e7db859 100755 --- a/scripts/package/builddeb +++ b/scripts/package/builddeb @@ -322,12 +322,12 @@ fi # Build kernel header package (cd $srctree; find . -name Makefile\* -o -name Kconfig\* -o -name \*.pl) > "$objtree/debian/hdrsrcfiles" -if grep -q '^CONFIG_STACK_VALIDATION=y' $KCONFIG_CONFIG ; then - (cd $srctree; find tools/objtool -type f -executable) >> "$objtree/debian/hdrsrcfiles" -fi (cd $srctree; find arch/*/include include scripts -type f) >> "$objtree/debian/hdrsrcfiles" (cd $srctree; find arch/$SRCARCH -name module.lds -o -name Kbuild.platforms -o -name Platform) >> "$objtree/debian/hdrsrcfiles" (cd $srctree; find $(find arch/$SRCARCH -name include -o -name scripts -type d) -type f) >> "$objtree/debian/hdrsrcfiles" +if grep -q '^CONFIG_STACK_VALIDATION=y' $KCONFIG_CONFIG ; then + (cd $objtree; find tools/objtool -type f -executable) >> "$objtree/debian/hdrobjfiles" +fi (cd $objtree; find arch/$SRCARCH/include Module.symvers include scripts -type f) >> "$objtree/debian/hdrobjfiles" destdir=$kernel_headers_dir/usr/src/linux-headers-$version mkdir -p "$destdir" -- cgit v1.2.3 From ca617dc68b23407c4b7427d4f2fd71e0ba7ba81d Mon Sep 17 00:00:00 2001 From: Henning Schild Date: Fri, 22 Jul 2016 14:46:52 +0200 Subject: builddeb: fix file permissions before packaging Builddep is not very explicit about file permissions. Actually the file permissions in the package are largely influenced by the umask of the user cloning the git and building the package. If that umask does not set go+r the resulting linux-headers package will prevent non-root users from building out-of-tree modules. And that is probably just one unexpected effect. Being a packaging/install tool builddep should make sure the file permissions are set correctly and not just derived from a value that is never checked. This patch sets ugo read permissions for all packaged files and derives the executable bit for directories and executables from the file-owner. Signed-off-by: Henning Schild Signed-off-by: Michal Marek --- scripts/package/builddeb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'scripts/package') diff --git a/scripts/package/builddeb b/scripts/package/builddeb index 202d6e7db859..116ef00c0b82 100755 --- a/scripts/package/builddeb +++ b/scripts/package/builddeb @@ -26,6 +26,8 @@ create_package() { # Fix ownership and permissions chown -R root:root "$pdir" chmod -R go-w "$pdir" + # in case we are in a restrictive umask environment like 0077 + chmod -R a+rX "$pdir" # Create the package dpkg-gencontrol $forcearch -Vkernel:debarch="${debarch}" -p$pname -P"$pdir" -- cgit v1.2.3 From 4c586062b275dcddc18f521ac092cf0f600a36de Mon Sep 17 00:00:00 2001 From: Marcin Mielniczuk Date: Tue, 12 Jul 2016 21:42:35 +0200 Subject: Fix the Debian packaging script on systems with no codename When calling `make deb-pkg` on a system with no codename (for example Arch Linux), lsb_release sometimes outputs `n/a` as the codename. This breaks dpkg-parsechangelog, which can't process the changelog correctly. Signed-off-by: Marcin Mielniczuk Signed-off-by: Michal Marek --- scripts/package/builddeb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts/package') diff --git a/scripts/package/builddeb b/scripts/package/builddeb index 116ef00c0b82..510add6d050c 100755 --- a/scripts/package/builddeb +++ b/scripts/package/builddeb @@ -240,7 +240,8 @@ maintainer="$name <$email>" # Try to determine distribution if [ -n "$KDEB_CHANGELOG_DIST" ]; then distribution=$KDEB_CHANGELOG_DIST -elif distribution=$(lsb_release -cs 2>/dev/null) && [ -n "$distribution" ]; then +# In some cases lsb_release returns the codename as n/a, which breaks dpkg-parsechangelog +elif distribution=$(lsb_release -cs 2>/dev/null) && [ -n "$distribution" ] && [ "$distribution" != "n/a" ]; then : # nothing to do in this case else distribution="unstable" -- cgit v1.2.3