From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6612472042631462912 X-Received: by 2002:adf:f449:: with SMTP id f9-v6mr207356wrp.22.1539778429451; Wed, 17 Oct 2018 05:13:49 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a1c:138f:: with SMTP id 137-v6ls227477wmt.14.canary-gmail; Wed, 17 Oct 2018 05:13:49 -0700 (PDT) X-Google-Smtp-Source: ACcGV62ntiDOlmU2EF0grfH9gkW2dOmCgGfIPuwYAOG770NC8yalMhJopPGx0uapVEY74jVzsuth X-Received: by 2002:a1c:7ece:: with SMTP id z197-v6mr244221wmc.0.1539778429094; Wed, 17 Oct 2018 05:13:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539778429; cv=none; d=google.com; s=arc-20160816; b=b60CLHf6RwhXppXpwIXWAo9UtoTHHD6hzooSvSmUSRDgtAeS7JdsE5peTVqgqjh+8X ypSiTFrhypNQfXs8cLgrV82rydybua8iDG9iVn5mgFwTFJnJD/kr7ey2IdDT0VbCg1Qy 6zxMBGwy4O/SU5P2ZuKkDjKY+SlkgdTmsrdjBkXLRBvQHupI1bF1WBh4xovImQ6In9TS ewzPFCpPht8IfvR/pA2ynwMqlJX1Y7Qx8gxxHZwLVtclQlH7bve8IxVhIZ9NFZDkHrnd KrWkh9MmKDz+23yAA7Ocw5E7Zc3rMYL8229B8XdTVmY2xgKP13xQVMtndtKh0O/GwIyC /Nrw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:organization:from:references:to:subject; bh=Lvk5bSutmSYcvVHhf4J9CJa//uSKLB5jUXtKfuBIVyg=; b=z8Wvkq36swaBMC3cp1p8SlLJKzeCf4GinWHxUlgVgOQoWVMz6V4VVmYD4KnCSP0Ucy o5cYC+K5MF7iWEWfbZuZXyBBOIKhyXFwP3iL8O+19ptaTsE/yJNrg51n3OJ8tIrRUyWe rNHo/aaftJqiLkN2lwjVsAsVS8pzWK/vldQl3Q1YmUwUB168jZXcX+m8RJSBPZzHFFhV 3iENo/gQyJTQx4Rp6qJVLWnG6W5JzyYZ3K1uJL12f3eLQm5+5pfNvM9b++OPBVXVPqA4 3+D4R5VUWzHhsj47ZMKsLTJABAAHzKEVIQo56ftfILmRkR27elojKYz4RSM8yAkd5T+u StiA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: best guess record for domain of mosipov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=mosipov@ilbers.de Return-Path: Received: from aqmola.ilbers.de (aqmola.ilbers.de. [85.214.62.211]) by gmr-mx.google.com with ESMTPS id h74-v6si71381wmd.4.2018.10.17.05.13.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Oct 2018 05:13:49 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of mosipov@ilbers.de designates 85.214.62.211 as permitted sender) client-ip=85.214.62.211; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: best guess record for domain of mosipov@ilbers.de designates 85.214.62.211 as permitted sender) smtp.mailfrom=mosipov@ilbers.de Received: from [192.168.50.180] (nat-ppp-217.71.235.199-satnet-spb.ru [217.71.235.199] (may be forged)) (authenticated bits=0) by aqmola.ilbers.de (8.14.4/8.14.4/Debian-4+deb7u1) with ESMTP id w9HCDk4r001644 (version=TLSv1/SSLv3 cipher=AES128-SHA bits=128 verify=NOT); Wed, 17 Oct 2018 14:13:47 +0200 Subject: Re: [PATCH] wic: refactor to use buildchroot_do_mounts To: Cedric Hombourger , isar-users@googlegroups.com References: <1539586108-213-1-git-send-email-Cedric_Hombourger@mentor.com> From: "Maxim Yu. Osipov" Organization: ilbers GmbH Message-ID: Date: Wed, 17 Oct 2018 15:13:41 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0 MIME-Version: 1.0 In-Reply-To: <1539586108-213-1-git-send-email-Cedric_Hombourger@mentor.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-TUID: Igthy7l21nmy On 10/15/18 9:48 AM, Cedric Hombourger wrote: > The wic code needs to bind mount buildchroot directories. Leverage the newly > added buildchroot_do_mounts function instead of binding required directories > ourselves. > > For additional mounts (such as layer directories), use mountpoint to check if > they were already mounted before bind mounting them. Applied to the 'next'. Thanks, Maxim. > Signed-off-by: Cedric Hombourger > --- > meta/classes/wic-img.bbclass | 9 ++++----- > 1 file changed, 4 insertions(+), 5 deletions(-) > > diff --git a/meta/classes/wic-img.bbclass b/meta/classes/wic-img.bbclass > index 5ff8b45..d0747e2 100644 > --- a/meta/classes/wic-img.bbclass > +++ b/meta/classes/wic-img.bbclass > @@ -9,6 +9,7 @@ python () { > bb.fatal("WKS_FILE must be set") > } > > +inherit buildchroot > inherit wks-file > > WKS_FULL_PATH = "${@get_wks_full_path(d)}" > @@ -67,13 +68,11 @@ WIC_IMAGE_FILE ="${DEPLOY_DIR_IMAGE}/${PN}-${DISTRO}-${MACHINE}.wic.img" > do_build[stamp-extra-info] = "${DISTRO}-${DISTRO_ARCH}" > > do_wic_image() { > - if ! grep -q ${BUILDCHROOT_DIR}/dev /proc/mounts; then > - sudo mount -t devtmpfs -o mode=0755,nosuid devtmpfs ${BUILDCHROOT_DIR}/dev > - sudo mount -t proc none ${BUILDCHROOT_DIR}/proc > - fi > + buildchroot_do_mounts > for dir in ${BBLAYERS} ${STAGING_DIR} ${ISARROOT}/scripts; do > sudo mkdir -p ${BUILDCHROOT_DIR}/$dir > - sudo mount --bind $dir ${BUILDCHROOT_DIR}/$dir > + mountpoint ${BUILDCHROOT_DIR}/$dir >/dev/null 2>&1 \ > + || sudo mount --bind $dir ${BUILDCHROOT_DIR}/$dir > done > export FAKEROOTCMD=${FAKEROOTCMD} > export BUILDDIR=${BUILDDIR} > -- Maxim Osipov ilbers GmbH Maria-Merian-Str. 8 85521 Ottobrunn Germany +49 (151) 6517 6917 mosipov@ilbers.de http://ilbers.de/ Commercial register Munich, HRB 214197 General Manager: Baurzhan Ismagulov