From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6701739048874016768 X-Received: by 2002:a5d:4008:: with SMTP id n8mr84928wrp.353.1560413434763; Thu, 13 Jun 2019 01:10:34 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:adf:e844:: with SMTP id d4ls1130273wrn.7.gmail; Thu, 13 Jun 2019 01:10:34 -0700 (PDT) X-Google-Smtp-Source: APXvYqy5xd8cqWEIA0NSdQ3pIHrYsktaKdcKgzgG/y3Xr8TgA9M0CHc3AJCkbJZudqQrHkIM0xhd X-Received: by 2002:adf:a749:: with SMTP id e9mr59409745wrd.64.1560413434346; Thu, 13 Jun 2019 01:10:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560413434; cv=none; d=google.com; s=arc-20160816; b=ovjNi2eHcAaYSZcmk4tbq8aYSrUD5AiGInvX20VCjAY3bPK+LLBcv2I/rf+5/dGL/S fcwyuZhLIFB4YKRmzyoFG1SSf1uCXPNxozk97MFtF3fg2z+6MYS/niGLiNUnGGLD3PXp yDrFZVK/KVxOKLJE3tMEzf8V3lTDpC1OXFlAXCuIImhv429mQuoUuhwNeepD/NdHW3h5 JSkVsCoLN2YlTYWikzpiNnaahciL5VK4NW7dd4O1A1hSRJ8KlrTAUrkY9H9C7sO7JkYK I7h4b5wJR7gWXANAsz6MIHViAPgPrzA/CFQ7DOX4iu3D94L1bSMweGg1DRe2nfjYyFfz P2EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date; bh=fIb0god6uMRNYKEmM7HlpB9GHD6q9a8Y56PmiLYSXVE=; b=SSN7OxETHuCxN4CnFoQGjQ4dYbTs5npfC6LGdmfatzURvS4F7liKinrTWyNY1yVmkU D08GNaJeFyWbUOnXWtBiyqfYbVCeZFFOfeqm1IpJf8n4sBVEizZV53bC9Bry3OEJHTZM Y6dpIT7k8SjveXE36seaK+0qWWupSYKo9ry24CD5k4xtKOBxpPvud+kkQ92C2qfN+VxR ACSsG8gniqjt6lkBcAjbv/TRNaaWXEoHkJ4e8afP80MgumzJxUny01i3AutmrI21frSu DwDZijLD2CSAmFsnElEgEGBoKOETTjsLhctsWYgz/XL71k0thXU1VZVY4WeXlfnSz+ot 22zA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from thoth.sbs.de (thoth.sbs.de. [192.35.17.2]) by gmr-mx.google.com with ESMTPS id x3si227537wmh.4.2019.06.13.01.10.34 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Jun 2019 01:10:34 -0700 (PDT) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.2 as permitted sender) client-ip=192.35.17.2; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.2 as permitted sender) smtp.mailfrom=henning.schild@siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: from mail2.sbs.de (mail2.sbs.de [192.129.41.66]) by thoth.sbs.de (8.15.2/8.15.2) with ESMTPS id x5D8AY5U008666 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 13 Jun 2019 10:10:34 +0200 Received: from md1za8fc.ad001.siemens.net ([139.25.68.171]) by mail2.sbs.de (8.15.2/8.15.2) with ESMTP id x5D8AXNX020872; Thu, 13 Jun 2019 10:10:33 +0200 Date: Thu, 13 Jun 2019 10:10:30 +0200 From: Henning Schild To: Cedric Hombourger Cc: Subject: Re: [PATCH] linux-custom: repack linux-libc-dev Message-ID: <20190613101030.156ab5ac@md1za8fc.ad001.siemens.net> In-Reply-To: <1560370202-632-1-git-send-email-Cedric_Hombourger@mentor.com> References: <1560370202-632-1-git-send-email-Cedric_Hombourger@mentor.com> X-Mailer: Claws Mail 3.17.3 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-TUID: T1Scg8b6Gvkv Am Wed, 12 Jun 2019 22:10:02 +0200 schrieb Cedric Hombourger : > Debian's linux-libc-dev package has "asm" headers in the following > directory: /usr/include//asm while the builddeb script > from the Linux kernel places them in: /usr/include/asm. Repack the > linux-libc-dev package (fixing a build error for packages built > against Isar-created distributions shipping a custom kernel in > lieu of Debian's). To me that sounds like an upstream bug that should not just get covered up by repacking. I would propose looking into a kernel patch for the "debpkg" step. That patch could be carried in your layer(s) and Isar while it is pending upstream. Looking at both ubuntu and debian, old and new .. it should never be /usr/include/asm/. > Signed-off-by: Cedric Hombourger > --- > meta/recipes-kernel/linux/files/build-kernel.sh | 38 > +++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 3 > deletions(-) > > diff --git a/meta/recipes-kernel/linux/files/build-kernel.sh > b/meta/recipes-kernel/linux/files/build-kernel.sh index > 8b7b23b..2c97932 100644 --- > a/meta/recipes-kernel/linux/files/build-kernel.sh +++ > b/meta/recipes-kernel/linux/files/build-kernel.sh @@ -9,8 +9,20 @@ > > source /isar/common.sh > > -host_arch=$(dpkg --print-architecture) > +unsupported_arch() { > + echo "error: unsupported architecture ($1)" >&2 > + exit 1 > +} > + > +case $target_arch in > + amd64) LIBC_HEADERS_DIR="x86_64-linux-gnu" ;; > + armhf) LIBC_HEADERS_DIR="arm-linux-gnueabihf" ;; > + arm64) LIBC_HEADERS_DIR="aarch64-linux-gnu" ;; > + mipsel) LIBC_HEADERS_DIR="mipsel-linux-gnu" ;; > + *) unsupported_arch "$target_arch" ;; > +esac Looks suspiciously like "${CROSS-COMPILE}gcc -dumpmachine". Using that would relieve us from carrying those magic strings around. > +host_arch=$(dpkg --print-architecture) > if [ "$host_arch" != "$target_arch" ]; then > case $target_arch in > armhf) > @@ -26,8 +38,7 @@ if [ "$host_arch" != "$target_arch" ]; then > export CROSS_COMPILE="mipsel-linux-gnu-" > ;; > *) > - echo "error: unsupported architecture ($target_arch)" > - exit 1 > + unsupported_arch "$target_arch" > ;; > esac > fi > @@ -35,6 +46,7 @@ fi > REPACK_DIR="$1/../repack" > REPACK_LINUX_IMAGE_DIR="${REPACK_DIR}/linux-image" > REPACK_LINUX_HEADERS_DIR="${REPACK_DIR}/linux-headers" > +REPACK_LIBC_HEADERS_DIR="${REPACK_DIR}/libc-headers" > > if [ -e .config ]; then > make olddefconfig > @@ -56,6 +68,7 @@ rm -rf "${REPACK_DIR}" > mkdir -p "${REPACK_DIR}" > mkdir -p "${REPACK_LINUX_IMAGE_DIR}" > mkdir -p "${REPACK_LINUX_HEADERS_DIR}" > +mkdir -p "${REPACK_LIBC_HEADERS_DIR}" > > cp -a debian "${REPACK_DIR}" > > @@ -67,6 +80,7 @@ cd .. > > dpkg-deb -R linux-image-${PV}_${PV}-1_*.deb > "${REPACK_LINUX_IMAGE_DIR}" dpkg-deb -R > linux-headers-${PV}_${PV}-1_*.deb "${REPACK_LINUX_HEADERS_DIR}" > +dpkg-deb -R linux-libc-dev_${PV}-1_*.deb > "${REPACK_LIBC_HEADERS_DIR}" dpkg-gencontrol -crepack/debian/control \ > -lrepack/debian/changelog \ > @@ -110,6 +124,10 @@ if [ "$target_arch" = "arm64" ]; then > gunzip "$vmlinuz.gz" > fi > > +# Move libc's asm headers where they are expected > +mkdir ${REPACK_LIBC_HEADERS_DIR}/usr/include/${LIBC_HEADERS_DIR} > +mv ${REPACK_LIBC_HEADERS_DIR}/usr/include/asm > ${REPACK_LIBC_HEADERS_DIR}/usr/include/${LIBC_HEADERS_DIR} + > dpkg-gencontrol -crepack/debian/control \ > -lrepack/debian/changelog \ > -frepack/debian/files \ > @@ -121,12 +139,26 @@ dpkg-gencontrol -crepack/debian/control \ > -DDepends="${KERNEL_HEADERS_DEBIAN_DEPENDS}" \ > -DArchitecture=$target_arch > > +dpkg-gencontrol -crepack/debian/control \ > + -lrepack/debian/changelog \ > + -frepack/debian/files \ > + -plinux-libc-dev \ > + -P"${REPACK_LIBC_HEADERS_DIR}" \ > + -Vkernel:debarch="${KERNEL_NAME}" \ > + -DPackage="linux-libc-dev" \ > + -DSection=kernel \ > + -DDepends="${LIBC_HEADERS_DEBIAN_DEPENDS}" \ > + -DArchitecture=$target_arch > + > fakeroot dpkg-deb -b "${REPACK_LINUX_IMAGE_DIR}" \ > linux-image-${KERNEL_NAME}_${PV}-1_${KERNEL_NAME}.deb > rm -f linux-image-${PV}_${PV}-1_*.deb > fakeroot dpkg-deb -b "${REPACK_LINUX_HEADERS_DIR}" \ > linux-headers-${KERNEL_NAME}_${PV}-1_${KERNEL_NAME}.deb > rm -f linux-headers-${PV}_${PV}-1_*.deb > +rm -f linux-libc-dev_${PV}-1_*.deb > +fakeroot dpkg-deb -b "${REPACK_LIBC_HEADERS_DIR}" \ > + linux-libc-dev_${PV}-1_${KERNEL_NAME}.deb > > # linux-libc-dev causes dependency problems if we downgrade > # remove it after the build so the downgraded version does not get > deployed Ahh this guy is still somehow in the patch. You might want to have a look at 7a1f14ca. My guess is that skipping the downgrade is still OK because the problem just shows once you install the libc-dev package.