From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6701739048874016768 X-Received: by 2002:a2e:9112:: with SMTP id m18mr47983400ljg.181.1560414753515; Thu, 13 Jun 2019 01:32:33 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:ac2:418e:: with SMTP id z14ls478288lfh.16.gmail; Thu, 13 Jun 2019 01:32:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqw7yDlgEJZEtxKgzhCn5S/y0fw8ZZbO9ciXHULkJWVEfixJ8pbDGSBLPcm569Yj6PvHFX7X X-Received: by 2002:ac2:4ac5:: with SMTP id m5mr20270175lfp.95.1560414753052; Thu, 13 Jun 2019 01:32:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560414753; cv=none; d=google.com; s=arc-20160816; b=x5rZCeE3DKHRMXnAnJ1Z0+nIGloH6NwlxEpzSB5iGJ9fo4K3vgZy/A6zXJ9ncJCQCe bNVmZjpcLzxVfxykEn1vdx7Gxi5bnqQOya/i9BaVuQ3BqRnBrSgrfnZ75uEj//yJaJzD fV0JOZyAm6ZnUhhGK5RH4E5vkljSSCkzOxLq/PcNt8u/U/Z70Vfm+Rhi3KDENiQoJvDS GiZQzXtVB9V/G+CawLlB6maFba9exrIMqObOxAdaT4z5YlYAbMvuVF1IHUJxX6bPl+y8 fLdWzytOV/PL6Z8D8vKa49UePcOLKuMO4QEDMaPng268iUuxGFLk/8x22DtnPc9e9hjT Vn6w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:content-transfer-encoding:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from; bh=/VMwMxcSxsSfKDFNOnA1GJk53FqPuXp3eSYO5gXvFxw=; b=TvXAVuJMBE4P8mKNGeYknQRngM6dtOAge8yvim1aI9njUgCyJiLaxHBW9PnzorHmUP 8BoprLbJ2vH+K6MUR8MqbIlk620bxgM3ngs6jdVnunO4PS9NTpJZ9QVSiQBa6VDVU1jf vImKyQDp/Jc4bqXfY/vhZvXE4kZ2CPU27pOdPvZxbuPbecfa8CQxPemfQ7eDkT3M6OrR 4P7rdGBElZAT8KC86Lhqy73TzghpjmPc74eBbg+P5ORE18CPaWceKVoXgjU+vCQlqwyO C++EYIFBHWVIiG9Hbl80YppX1cox29LsoyPW54r1OBazZaP3VOeiCleTRC560mFQ7eLo 6V+Q== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of cedric_hombourger@mentor.com designates 192.94.38.131 as permitted sender) smtp.mailfrom=Cedric_Hombourger@mentor.com Return-Path: Received: from relay1.mentorg.com (relay1.mentorg.com. [192.94.38.131]) by gmr-mx.google.com with ESMTPS id o20si91165lji.2.2019.06.13.01.32.32 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Jun 2019 01:32:32 -0700 (PDT) Received-SPF: pass (google.com: domain of cedric_hombourger@mentor.com designates 192.94.38.131 as permitted sender) client-ip=192.94.38.131; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of cedric_hombourger@mentor.com designates 192.94.38.131 as permitted sender) smtp.mailfrom=Cedric_Hombourger@mentor.com Received: from nat-ies.mentorg.com ([192.94.31.2] helo=svr-ies-mbx-02.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1hbL9q-000180-Ia from Cedric_Hombourger@mentor.com ; Thu, 13 Jun 2019 01:32:30 -0700 Received: from svr-ies-mbx-02.mgc.mentorg.com (139.181.222.2) by svr-ies-mbx-02.mgc.mentorg.com (139.181.222.2) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Thu, 13 Jun 2019 09:32:26 +0100 Received: from svr-ies-mbx-02.mgc.mentorg.com ([fe80::a01f:51c9:5b6c:e0c]) by svr-ies-mbx-02.mgc.mentorg.com ([fe80::a01f:51c9:5b6c:e0c%22]) with mapi id 15.00.1320.000; Thu, 13 Jun 2019 09:32:26 +0100 From: "Hombourger, Cedric" To: Henning Schild CC: "isar-users@googlegroups.com" Subject: Re: [PATCH] linux-custom: repack linux-libc-dev Thread-Topic: [PATCH] linux-custom: repack linux-libc-dev Thread-Index: AQHVIVrYM6Z4BmdXaUKU43Ho89f96KaZK3UAgAAU3eM= Date: Thu, 13 Jun 2019 08:32:26 +0000 Message-ID: <1560414746469.39403@mentor.com> References: <1560370202-632-1-git-send-email-Cedric_Hombourger@mentor.com>,<20190613101030.156ab5ac@md1za8fc.ad001.siemens.net> In-Reply-To: <20190613101030.156ab5ac@md1za8fc.ad001.siemens.net> Accept-Language: en-US, en-IE Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [137.202.0.90] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-TUID: 0QInmLsPQUHi Hi Henning=0A= =0A= Agreed but I would think we would need a work-around in Isar until the prop= osed change gets accepted by k.org folks=0A= (on a different note, I also need to submit a patch to arch/mips/Makefile f= or builddeb to succeed - my linux-custom recipe would not build without a p= atch as dtbs don't get built by default while they do on e.g. aarch64)=0A= =0A= I would therefore suggest to have build-kernel.sh do something like:=0A= =0A= if [ -d <...>/usr/include/asm ]; then=0A= echo "warning: your kernel has incorrectly packaged linux-libc-dev hea= ders" >&2=0A= # apply work-around and repack linux-libc-dev=0A= ...=0A= mv <...>/usr/include/asm <...>/usr/include/${LIBC_HEADERS_DIR}/=0A= ...=0A= fi=0A= =0A= I can submit a v2 if the approach is agreeable=0A= will roll-up my sleeves a prepare a patch for k.org=0A= =0A= Cedric=0A= ________________________________________=0A= From: Henning Schild =0A= Sent: Thursday, June 13, 2019 10:10 AM=0A= To: Hombourger, Cedric=0A= Cc: isar-users@googlegroups.com=0A= Subject: Re: [PATCH] linux-custom: repack linux-libc-dev=0A= =0A= Am Wed, 12 Jun 2019 22:10:02 +0200=0A= schrieb Cedric Hombourger :=0A= =0A= > Debian's linux-libc-dev package has "asm" headers in the following=0A= > directory: /usr/include//asm while the builddeb script=0A= > from the Linux kernel places them in: /usr/include/asm. Repack the=0A= > linux-libc-dev package (fixing a build error for packages built=0A= > against Isar-created distributions shipping a custom kernel in=0A= > lieu of Debian's).=0A= =0A= To me that sounds like an upstream bug that should not just get covered=0A= up by repacking. I would propose looking into a kernel patch for the=0A= "debpkg" step. That patch could be carried in your layer(s) and Isar=0A= while it is pending upstream.=0A= =0A= Looking at both ubuntu and debian, old and new .. it should never=0A= be /usr/include/asm/.=0A= =0A= > Signed-off-by: Cedric Hombourger =0A= > ---=0A= > meta/recipes-kernel/linux/files/build-kernel.sh | 38=0A= > +++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 3=0A= > deletions(-)=0A= >=0A= > diff --git a/meta/recipes-kernel/linux/files/build-kernel.sh=0A= > b/meta/recipes-kernel/linux/files/build-kernel.sh index=0A= > 8b7b23b..2c97932 100644 ---=0A= > a/meta/recipes-kernel/linux/files/build-kernel.sh +++=0A= > b/meta/recipes-kernel/linux/files/build-kernel.sh @@ -9,8 +9,20 @@=0A= >=0A= > source /isar/common.sh=0A= >=0A= > -host_arch=3D$(dpkg --print-architecture)=0A= > +unsupported_arch() {=0A= > + echo "error: unsupported architecture ($1)" >&2=0A= > + exit 1=0A= > +}=0A= > +=0A= > +case $target_arch in=0A= > + amd64) LIBC_HEADERS_DIR=3D"x86_64-linux-gnu" ;;=0A= > + armhf) LIBC_HEADERS_DIR=3D"arm-linux-gnueabihf" ;;=0A= > + arm64) LIBC_HEADERS_DIR=3D"aarch64-linux-gnu" ;;=0A= > + mipsel) LIBC_HEADERS_DIR=3D"mipsel-linux-gnu" ;;=0A= > + *) unsupported_arch "$target_arch" ;;=0A= > +esac=0A= =0A= Looks suspiciously like "${CROSS-COMPILE}gcc -dumpmachine". Using that=0A= would relieve us from carrying those magic strings around.=0A= =0A= =0A= > +host_arch=3D$(dpkg --print-architecture)=0A= > if [ "$host_arch" !=3D "$target_arch" ]; then=0A= > case $target_arch in=0A= > armhf)=0A= > @@ -26,8 +38,7 @@ if [ "$host_arch" !=3D "$target_arch" ]; then=0A= > export CROSS_COMPILE=3D"mipsel-linux-gnu-"=0A= > ;;=0A= > *)=0A= > - echo "error: unsupported architecture ($target_arch)"=0A= > - exit 1=0A= > + unsupported_arch "$target_arch"=0A= > ;;=0A= > esac=0A= > fi=0A= > @@ -35,6 +46,7 @@ fi=0A= > REPACK_DIR=3D"$1/../repack"=0A= > REPACK_LINUX_IMAGE_DIR=3D"${REPACK_DIR}/linux-image"=0A= > REPACK_LINUX_HEADERS_DIR=3D"${REPACK_DIR}/linux-headers"=0A= > +REPACK_LIBC_HEADERS_DIR=3D"${REPACK_DIR}/libc-headers"=0A= >=0A= > if [ -e .config ]; then=0A= > make olddefconfig=0A= > @@ -56,6 +68,7 @@ rm -rf "${REPACK_DIR}"=0A= > mkdir -p "${REPACK_DIR}"=0A= > mkdir -p "${REPACK_LINUX_IMAGE_DIR}"=0A= > mkdir -p "${REPACK_LINUX_HEADERS_DIR}"=0A= > +mkdir -p "${REPACK_LIBC_HEADERS_DIR}"=0A= >=0A= > cp -a debian "${REPACK_DIR}"=0A= >=0A= > @@ -67,6 +80,7 @@ cd ..=0A= >=0A= > dpkg-deb -R linux-image-${PV}_${PV}-1_*.deb=0A= > "${REPACK_LINUX_IMAGE_DIR}" dpkg-deb -R=0A= > linux-headers-${PV}_${PV}-1_*.deb "${REPACK_LINUX_HEADERS_DIR}"=0A= > +dpkg-deb -R linux-libc-dev_${PV}-1_*.deb=0A= > "${REPACK_LIBC_HEADERS_DIR}" dpkg-gencontrol -crepack/debian/control \=0A= > -lrepack/debian/changelog \=0A= > @@ -110,6 +124,10 @@ if [ "$target_arch" =3D "arm64" ]; then=0A= > gunzip "$vmlinuz.gz"=0A= > fi=0A= >=0A= > +# Move libc's asm headers where they are expected=0A= > +mkdir ${REPACK_LIBC_HEADERS_DIR}/usr/include/${LIBC_HEADERS_DIR}=0A= > +mv ${REPACK_LIBC_HEADERS_DIR}/usr/include/asm=0A= > ${REPACK_LIBC_HEADERS_DIR}/usr/include/${LIBC_HEADERS_DIR} +=0A= > dpkg-gencontrol -crepack/debian/control \=0A= > -lrepack/debian/changelog \=0A= > -frepack/debian/files \=0A= > @@ -121,12 +139,26 @@ dpkg-gencontrol -crepack/debian/control \=0A= > -DDepends=3D"${KERNEL_HEADERS_DEBIAN_DEPENDS}" \=0A= > -DArchitecture=3D$target_arch=0A= >=0A= > +dpkg-gencontrol -crepack/debian/control \=0A= > + -lrepack/debian/changelog \=0A= > + -frepack/debian/files \=0A= > + -plinux-libc-dev \=0A= > + -P"${REPACK_LIBC_HEADERS_DIR}" \=0A= > + -Vkernel:debarch=3D"${KERNEL_NAME}" \=0A= > + -DPackage=3D"linux-libc-dev" \=0A= > + -DSection=3Dkernel \=0A= > + -DDepends=3D"${LIBC_HEADERS_DEBIAN_DEPENDS}" \=0A= > + -DArchitecture=3D$target_arch=0A= > +=0A= > fakeroot dpkg-deb -b "${REPACK_LINUX_IMAGE_DIR}" \=0A= > linux-image-${KERNEL_NAME}_${PV}-1_${KERNEL_NAME}.deb=0A= > rm -f linux-image-${PV}_${PV}-1_*.deb=0A= > fakeroot dpkg-deb -b "${REPACK_LINUX_HEADERS_DIR}" \=0A= > linux-headers-${KERNEL_NAME}_${PV}-1_${KERNEL_NAME}.deb=0A= > rm -f linux-headers-${PV}_${PV}-1_*.deb=0A= > +rm -f linux-libc-dev_${PV}-1_*.deb=0A= > +fakeroot dpkg-deb -b "${REPACK_LIBC_HEADERS_DIR}" \=0A= > + linux-libc-dev_${PV}-1_${KERNEL_NAME}.deb=0A= >=0A= > # linux-libc-dev causes dependency problems if we downgrade=0A= > # remove it after the build so the downgraded version does not get=0A= > deployed=0A= =0A= Ahh this guy is still somehow in the patch. You might want to have a=0A= look at 7a1f14ca. My guess is that skipping the downgrade is still OK=0A= because the problem just shows once you install the libc-dev package.=0A= =0A=