From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6599908607246991360 X-Received: by 2002:a19:1724:: with SMTP id n36-v6mr527418lfi.0.1536660969773; Tue, 11 Sep 2018 03:16:09 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a2e:421c:: with SMTP id p28-v6ls1717046lja.2.gmail; Tue, 11 Sep 2018 03:16:09 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbxMqnAqG8SyIEDsB8dvGZaxgEOoAF+wMHQcEOFBoSmQ2Dhvh4Rx92SIL9lGzE+3Huvkt4J X-Received: by 2002:a2e:97d1:: with SMTP id m17-v6mr476243ljj.17.1536660969342; Tue, 11 Sep 2018 03:16:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536660969; cv=none; d=google.com; s=arc-20160816; b=JhYa6ZVRhmVXMOMzfmovJBDu6Q6upZhOTXZYCUyAD0jm7GQy4a5ikhNQooXu1enLxV LYk/wUgE36f7niFKaYznTgNo7FolfLQZ+TZWWZ8FBfpyJfwIGUlstj/NScJWYL6QXhrc hfoYS/P0wNx0n8YwON72RGcD4BKTUo/af191jKQWnWoVtHkmbe1ENUHwyMhNbSChicuV HyHkOLs7ySD5IGl3yeDb+MHjK5uLlCxNR2XbhLbx3AXz3xHuTn2j6gzRbD5eVYD2mseN CmxJaJwPRIP0lOXqWZw8J3AY8T47pd0D4RDQEEilu94VotI3HbZnI4fMMvdf/VXOPKaZ JMhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from; bh=mbRKmB/Dz6YSoDZtW5jcoUXe4D7wPHO0ZlhcA9nnyuk=; b=YD9Z4zRK4RXGasBtvcJSBqDR49cflm56DSFx29A4yIM/7T5rxeaOy3x5WWvfjhngFf J7pIERWYPlpjO+TFo0bE2CJdpIOapF/4QAP2+g+baMNSBJ7fTS98oVWYz8OP3QToQu8m j8YGLyDpW5HoKNtFdycE5YELOY6OwWudxjbaYmot81b+MuZXzMhzmYk2vB+VMSND8LYr zge9UyPJre/TQoxajjP8HGunCft+S4iaCGqTiG4b1OL62vuuzgPqV03rLxIJAnV22FLB iYGlPxJ1Gf8jRFkZLHYiNZ6wkiLiFwHFb8KOmdtq3nT4SU7BfqlD0jVyuCMLzIwaeRla 0TlQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Return-Path: Received: from gecko.sbs.de (gecko.sbs.de. [194.138.37.40]) by gmr-mx.google.com with ESMTPS id i67-v6si610746lfb.3.2018.09.11.03.16.09 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Sep 2018 03:16:09 -0700 (PDT) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.40 as permitted sender) client-ip=194.138.37.40; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 194.138.37.40 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by gecko.sbs.de (8.15.2/8.15.2) with ESMTPS id w8BAG8tO031778 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 11 Sep 2018 12:16:08 +0200 Received: from md1pvb1c.ad001.siemens.net (md1pvb1c.ad001.siemens.net [139.25.68.40]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id w8BAG7Ll011543; Tue, 11 Sep 2018 12:16:08 +0200 From: Henning Schild To: isar-users Cc: Henning Schild Subject: [PATCH 2/2] build-kernel: fix the cross compile arch naming Date: Tue, 11 Sep 2018 12:16:05 +0200 Message-Id: <20180911101605.21977-3-henning.schild@siemens.com> X-Mailer: git-send-email 2.16.4 In-Reply-To: <20180911101605.21977-1-henning.schild@siemens.com> References: <20180911101605.21977-1-henning.schild@siemens.com> X-TUID: ZXNf19D/iGNZ In debian cross building scenarios we have three machines. "build" is where we work on, "host" is what we produce binaries for, and "target" would be a third arch if we build a cross compiler to run on "host". ("target" is not yet relevant on Isar) We used to call "build" "host" and "host" "target", this patch changes the kernel building to the debian/GNU naming. Signed-off-by: Henning Schild --- meta/recipes-kernel/linux/files/build-kernel.sh | 18 +++++++++--------- meta/recipes-kernel/linux/linux-custom.inc | 4 ++-- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/meta/recipes-kernel/linux/files/build-kernel.sh b/meta/recipes-kernel/linux/files/build-kernel.sh index 2cee28f..d1824db 100644 --- a/meta/recipes-kernel/linux/files/build-kernel.sh +++ b/meta/recipes-kernel/linux/files/build-kernel.sh @@ -9,11 +9,11 @@ set -e -host_arch=$(dpkg --print-architecture) -target_arch=$2 +build_arch=$(dpkg-architecture -qDEB_BUILD_ARCH) +host_arch=$(dpkg-architecture -qDEB_HOST_ARCH) -if [ "$host_arch" != "$target_arch" ]; then - case $target_arch in +if [ "$build_arch" != "$host_arch" ]; then + case $host_arch in armhf) export ARCH=arm export CROSS_COMPILE="arm-linux-gnueabihf-" @@ -23,7 +23,7 @@ if [ "$host_arch" != "$target_arch" ]; then export CROSS_COMPILE="aarch64-linux-gnu-" ;; *) - echo "error: unsupported architecture ($target_arch)" + echo "error: unsupported architecture ($host_arch)" exit 1 ;; esac @@ -44,7 +44,7 @@ if [ "${KV}" != "${PV}" ]; then fi rm -f .version -KBUILD_DEBARCH=$target_arch make -j $(($(nproc) * 2)) deb-pkg +KBUILD_DEBARCH=$host_arch make -j $(($(nproc) * 2)) deb-pkg rm -rf ${REPACK_DIR} mkdir -p ${REPACK_DIR} @@ -65,7 +65,7 @@ dpkg-gencontrol -crepack/debian/control \ -DSection=kernel \ -DPriority=required \ -DDepends="${KERNEL_DEBIAN_DEPENDS}" \ - -DArchitecture=$target_arch + -DArchitecture=$host_arch # Add Debian-like link installation to postinst touch ${REPACK_LINUX_IMAGE_DIR}/lib/modules/${PV}/.fresh-install @@ -91,7 +91,7 @@ if [ \"\$1\" != upgrade ] && command -v linux-update-symlinks >/dev/null; then\\ fi" # Make sure arm64 kernels are decompressed -if [ "$target_arch" = "arm64" ]; then +if [ "$host_arch" = "arm64" ]; then vmlinuz=${REPACK_LINUX_IMAGE_DIR}/boot/vmlinuz-${PV} mv $vmlinuz $vmlinuz.gz gunzip $vmlinuz.gz @@ -106,7 +106,7 @@ dpkg-gencontrol -crepack/debian/control \ -DPackage="linux-headers-${KERNEL_NAME}" \ -DSection=kernel \ -DDepends="${KERNEL_HEADERS_DEBIAN_DEPENDS}" \ - -DArchitecture=$target_arch + -DArchitecture=$host_arch dpkg-deb -b ${REPACK_LINUX_IMAGE_DIR} \ linux-image-${KERNEL_NAME}_${PV}-1_${KERNEL_NAME}.deb diff --git a/meta/recipes-kernel/linux/linux-custom.inc b/meta/recipes-kernel/linux/linux-custom.inc index d75346e..7ee2a86 100644 --- a/meta/recipes-kernel/linux/linux-custom.inc +++ b/meta/recipes-kernel/linux/linux-custom.inc @@ -52,6 +52,6 @@ dpkg_runbuild() { export KBUILD_DEPENDS="${KBUILD_DEPENDS}" export KERNEL_DEBIAN_DEPENDS="${KERNEL_DEBIAN_DEPENDS}" export KERNEL_HEADERS_DEBIAN_DEPENDS="${KERNEL_HEADERS_DEBIAN_DEPENDS}" - - sudo -E chroot ${BUILDCHROOT_DIR} /build-kernel.sh ${PP}/${PPS} ${DISTRO_ARCH} + export DEB_HOST_ARCH="${DISTRO_ARCH}" + sudo -E chroot ${BUILDCHROOT_DIR} /build-kernel.sh ${PP}/${PPS} } -- 2.16.4