summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFathi Boudra <fathi.boudra@linaro.org>2016-11-25 19:15:28 +0200
committerFathi Boudra <fathi.boudra@linaro.org>2016-11-25 19:15:28 +0200
commit52c10d39e763d08ff920b96aee032045aa058096 (patch)
tree95e459ec164d0ecc7beaec7574d41bb7b5189617
parentb3018ed2e219473c73c2e401c9e00abb67f73217 (diff)
downloadlci-build-tools-52c10d39e763d08ff920b96aee032045aa058096.tar.gz
builddeb: sync with latest upstreamed/submitted code
Remaining changes: * arm64 kernel installed to boot/Image-$version * dtb's installed to lib/firmware/$version/device-tree * arm64 boot wrapper installed to boot/ Change-Id: Ib14239b0c89e208bac6deca0acaf493db08172e9 Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
-rwxr-xr-x[-rw-r--r--]build-scripts/builddeb39
1 files changed, 22 insertions, 17 deletions
diff --git a/build-scripts/builddeb b/build-scripts/builddeb
index a1eb9ac..ad8ce08 100644..100755
--- a/build-scripts/builddeb
+++ b/build-scripts/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"
@@ -49,7 +51,7 @@ set_debarch() {
debarch=hppa ;;
mips*)
debarch=mips$(grep -q CPU_LITTLE_ENDIAN=y $KCONFIG_CONFIG && echo el || true) ;;
- arm64)
+ aarch64|arm64)
debarch=arm64 ;;
arm*)
if grep -q CONFIG_AEABI=y $KCONFIG_CONFIG; then
@@ -88,11 +90,7 @@ if [ -n "$KDEB_PKGVERSION" ]; then
else
packageversion=$version-$revision
fi
-if [ -n "$KDEB_SOURCENAME" ]; then
- sourcename=$KDEB_SOURCENAME
-else
- sourcename=linux-upstream
-fi
+sourcename=$KDEB_SOURCENAME
tmpdir="$objtree/debian/tmp"
fwdir="$objtree/debian/fwtmp"
kernel_headers_dir="$objtree/debian/hdrtmp"
@@ -131,7 +129,7 @@ esac
BUILD_DEBUG="$(grep -s '^CONFIG_DEBUG_INFO=y' $KCONFIG_CONFIG || true)"
# Setup the directory structure
-rm -rf "$tmpdir" "$fwdir" "$kernel_headers_dir" "$libc_headers_dir" "$dbg_dir"
+rm -rf "$tmpdir" "$fwdir" "$kernel_headers_dir" "$libc_headers_dir" "$dbg_dir" $objtree/debian/files
mkdir -m 755 -p "$tmpdir/DEBIAN"
mkdir -p "$tmpdir/lib" "$tmpdir/boot"
mkdir -p "$fwdir/lib/firmware/$version/"
@@ -231,7 +229,7 @@ if [ -n "$DEBEMAIL" ]; then
elif [ -n "$EMAIL" ]; then
email=$EMAIL
else
- email=$(id -nu)@$(hostname -f)
+ email=$(id -nu)@$(hostname -f 2>/dev/null || hostname)
fi
if [ -n "$DEBFULLNAME" ]; then
name=$DEBFULLNAME
@@ -245,7 +243,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"
@@ -329,10 +328,16 @@ fi
# Build kernel header package
(cd $srctree; find . -name Makefile\* -o -name Kconfig\* -o -name \*.pl) > "$objtree/debian/hdrsrcfiles"
-(cd $srctree; find arch/$SRCARCH/include include scripts -type f) >> "$objtree/debian/hdrsrcfiles"
+(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"
+if grep -q '^CONFIG_GCC_PLUGINS=y' $KCONFIG_CONFIG ; then
+ (cd $objtree; find scripts/gcc-plugins -name \*.so -o -name gcc-common.h) >> "$objtree/debian/hdrobjfiles"
+fi
destdir=$kernel_headers_dir/usr/src/linux-headers-$version
mkdir -p "$destdir"
(cd $srctree; tar -c -f - -T -) < "$objtree/debian/hdrsrcfiles" | (cd $destdir; tar -xf -)
@@ -424,27 +429,27 @@ EOF
create_package "$dbg_packagename" "$dbg_dir"
fi
-if [ "x$1" != "xbindeb-pkg" ]
+if [ "x$1" = "xdeb-pkg" ]
then
cat <<EOF > debian/rules
#!/usr/bin/make -f
build:
- cp debian/config .config
- \$(MAKE) oldconfig
+ \$(MAKE)
binary-arch:
\$(MAKE) KDEB_SOURCENAME=${sourcename} KDEB_PKGVERSION=${packageversion} bindeb-pkg
clean:
+ rm -rf debian/*tmp debian/files
+ mv debian/ debian.backup # debian/ might be cleaned away
\$(MAKE) clean
+ mv debian.backup debian
binary: binary-arch
EOF
-
- (cd $KBUILD_SRC; git archive --prefix=${sourcename}-${version}/ HEAD)|gzip -9 > ../${sourcename}_${version}.orig.tar.gz
- cp $KCONFIG_CONFIG debian/config
- tar caf ../${sourcename}_${packageversion}.debian.tar.gz debian/{config,copyright,rules,changelog,control}
+ mv ${sourcename}.tar.gz ../${sourcename}_${version}.orig.tar.gz
+ tar caf ../${sourcename}_${packageversion}.debian.tar.gz debian/{copyright,rules,changelog,control}
dpkg-source -cdebian/control -ldebian/changelog --format="3.0 (custom)" --target-format="3.0 (quilt)" \
-b / ../${sourcename}_${version}.orig.tar.gz ../${sourcename}_${packageversion}.debian.tar.gz
mv ${sourcename}_${packageversion}*dsc ..