From patchwork Mon Sep 7 08:20:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vijai Kumar K X-Patchwork-Id: 40 Return-Path: Delivered-To: ilbers.mnt@gmail.com Received: by 2002:a4a:eb04:0:0:0:0:0 with SMTP id f4csp3467889ooj; Mon, 7 Sep 2020 09:20:45 -0700 (PDT) X-Received: by 2002:aa7:d815:: with SMTP id v21mr22972234edq.56.1599495645576; Mon, 07 Sep 2020 09:20:45 -0700 (PDT) ARC-Seal: i=3; a=rsa-sha256; t=1599495645; cv=pass; d=google.com; s=arc-20160816; b=G28jqnCOT5LmS4mMTaVz7nNUXrl950exqG9UAn46B06wbKerqhgJ8OpZwMhvC7Zd2v +OzSyacQ7Oj0+ECtFBzV0m25DpW3Oq9uRkDovnFL6lT+QVLBYhLnnQhA5zi9ixrlGAjs T8GXsGRyjnXY6/uzuKl5TMnxOKGZOjEASg4kK9azmFVyPDd1sBYF9Xlj0DUHgSWHpRim 2Au59I7zYwB+jjGTPW66oxHUppmAsn8E4u+EVqGs3qlebXaXY3Yf5gWTR3qO30QHnv2A CwKP7OL7F0KdwKT8jIpPSuG0oDNIM+uFFJb0ETg57sJNd+/xmoRnZHT185uNe+f7yunL Gwnw== ARC-Message-Signature: i=3; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:to:from:ironport-sdr:ironport-sdr:sender :dkim-signature; bh=FtpO6QhFbp+ViZ2eix4Qh0+TgRftJ4bVPT8po4BuAOs=; b=uYLQj54uvzGc4YfA72Tncn0AtpipQ8bgDYuDTUve8VQwKxSSCwr3Pe+5mIAzcqeYNK 6eZUuU3npRygrfA09t7F4zleR2qaEi1kifBVtm1NuzGOOV74u3Nb+lhPf3MWkTu+sbjA 11+P18Hujvw2Ob03+elk6aLf8cY7dO5HIX9XHqxSaGb0kOq+gWmHwuujxIZTKsR4wrab gyKRLGDzMVy/E2+VubBCDVHHoS+rCBuh4YioMzjTabSone5WgxNha0UcNw2XNWJR7bXD AhokeT37Kqv3J1wM0syM6JcUecVuegkVQpLd/TvKdJexKFgQ2XelgY9UwegFftRa+PYD OOYA== ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@googlegroups.com header.s=20161025 header.b=I10m4RYX; arc=pass (i=2 spf=pass spfdomain=mentor.com); spf=pass (google.com: domain of isar-users+bncbcwp7lf37ukrbxn33h5akgqe54rgfzq@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCWP7LF37UKRBXN33H5AKGQE54RGFZQ@googlegroups.com Received: from mail-sor-f55.google.com (mail-sor-f55.google.com. [209.85.220.55]) by mx.google.com with SMTPS id v23sor9061487ejg.15.2020.09.07.09.20.45 (Google Transport Security); Mon, 07 Sep 2020 09:20:45 -0700 (PDT) Received-SPF: pass (google.com: domain of isar-users+bncbcwp7lf37ukrbxn33h5akgqe54rgfzq@googlegroups.com designates 209.85.220.55 as permitted sender) client-ip=209.85.220.55; Authentication-Results: mx.google.com; dkim=pass header.i=@googlegroups.com header.s=20161025 header.b=I10m4RYX; arc=pass (i=2 spf=pass spfdomain=mentor.com); spf=pass (google.com: domain of isar-users+bncbcwp7lf37ukrbxn33h5akgqe54rgfzq@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCWP7LF37UKRBXN33H5AKGQE54RGFZQ@googlegroups.com ARC-Seal: i=2; a=rsa-sha256; t=1599495645; cv=pass; d=google.com; s=arc-20160816; b=mB8//9Mvwp4sxLjsFaa8QRLU2bNFtyrfMFX3BO9UgYGMoXGsND5bkxPnNgFDoMn7nH 9YFCTEIhG/T+qGJuf6o8fHKKQCQ84lfd4t2vPWDTE5+ypyZeRaHrfSktv3ODwkVFA84A 1Hr3uJq28tv8riYkR4cFJ/ByyfmhMMiRuT1Yy/7zdbz9Al7r7OT9pZ7kwo8YBcpeeuxH NCFQSe+1Uzs4YuzZHIBa2njQ8eq52VZoCm0QujfjMBbYrF+AdoYDA8IsEgOn0X3NmjO3 EXI+VgCf0iUOyHvFu0TNVHFL3qmdeF4+URLNMz3rIqVx7ykoevMY5JSguA6EoU/BMerr unIA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:mime-version:references:in-reply-to :message-id:date:subject:to:from:ironport-sdr:ironport-sdr:sender :dkim-signature; bh=FtpO6QhFbp+ViZ2eix4Qh0+TgRftJ4bVPT8po4BuAOs=; b=zPhW7/EEGSr4Kp9OHWzVcDjG359tx1ts6ZWxrbdWmHBBI7PdRenkCL7rneOeSiTC+c tgJWlQYerVE87i5UxWY4kWqFkus0JtiB/jeg4fFsFaQ4WJ98E4q5l1DGmSk7Eq3hf+Q5 zkLguA6HrtDk3+jUsuJ6rONyRhU8iUlnqkvo3NtlVq1P+O9Z5lvxxJnayaK1TkSFgb3D 2rV6iqzmersWSGIISh7PoYbkE7fHoU2mz5CEPXdZgEIYibluzAURVQst8QCR1ZPbYeUS mGkl961yVqpUpqQOgTCcBiWaRmKQFr+mbxQmqGKp2JAwI5WK24FIVxuESfyL80V+ukwl 9pRw== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.252 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:ironport-sdr:ironport-sdr:from:to:subject:date:message-id :in-reply-to:references:mime-version:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-subscribe:list-unsubscribe; bh=FtpO6QhFbp+ViZ2eix4Qh0+TgRftJ4bVPT8po4BuAOs=; b=I10m4RYXZdZuZisTgxHw12d06cUIcWV/Nfl+J4U6dLBij6N+OEENOF13qph/Vu5NSe A6d7Lm/SBGeqlxtjskvdyblJgMckcTwS/AOu5j9GZA8esfdxSXW81qziEhaIJeXd4SBA rixaPCb9yWw3ieLQgP1K7ffsm4kWQPkAZvfSEUA5xd9Z2uyA3vA9R+3tSDsD1WREVzbX IegQNWYHLrPI3FH/2sTFbsgIWjDfascWKAj7yM9YC1ha7B6SNyeA3tu22bIocYBhnyL3 PhQSJQfveJARe0M7/WYgf8+lGj2AtcJJl+u4dtejNJIMTa0MPMHtPR5LAKoGgs3BAeMk NUEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:ironport-sdr:ironport-sdr:from:to:subject :date:message-id:in-reply-to:references:mime-version :x-original-sender:x-original-authentication-results:precedence :mailing-list:list-id:x-spam-checked-in-group:list-post:list-help :list-archive:list-subscribe:list-unsubscribe; bh=FtpO6QhFbp+ViZ2eix4Qh0+TgRftJ4bVPT8po4BuAOs=; b=LJqAOYQXDYzGFowfaPlMRUHVHLvp4YZK3ZYkqhD1BfFsX0mFRvSaJ8SIn/uMOPXXV3 3cFPXDnWFhlPJVAKIpt/AhwR5jY9EQBXkvDbH7rjOxGTYq034pnqDT2KozTMppQ/2o1/ yf0qiQ6bBzTDASwHuOSG/Ry7SboNcxh+ShBKqCQ0o70okmrfnVB9LN7DY965LTTSdQ9l i2rtkNnjbkavkztfySMmNvWylXcVL9VBUTFml6Yd1vHLZUu5HrluqO9jXbQkNB3TO3ct A8pY2gVjiLncKtk+OpbFI+ORDHdr6Brgi7o+kXAzaOZNnFHIvRZmLpH26bLdlo55Faod IhTQ== Sender: isar-users@googlegroups.com X-Gm-Message-State: AOAM530pSaEMJTYHP6bG19E8m0XXvNMpugDRkRycp/dZE6QMqLrimQut TRJKRdNTBiFM3poAxu346KA= X-Google-Smtp-Source: ABdhPJw0UKGJdshBHGBR2ctwRF0HK/h/u9KWapmdu0mQp7I3ynSSxnlf2BLdIn3nZ6DdS6Kc7I3sIQ== X-Received: by 2002:a17:906:1c5b:: with SMTP id l27mr22684451ejg.283.1599495645221; Mon, 07 Sep 2020 09:20:45 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:aa7:c545:: with SMTP id s5ls234119edr.3.gmail; Mon, 07 Sep 2020 09:20:44 -0700 (PDT) X-Received: by 2002:a05:6402:1d29:: with SMTP id dh9mr7733455edb.124.1599495644302; Mon, 07 Sep 2020 09:20:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599495644; cv=none; d=google.com; s=arc-20160816; b=ykoxJK4QCUKPkPdea8bHSKB2xJ0PGV3qYx8iNV7tjKH9CA8+hjSyxzFiTEO/1VocQt 0i+zW2VGJXbi1+JCFQpWBykRhwuh6GjgxKECkwcEqZ8XSXtktfxzDDpMDsgUx1tzMFeG bXktlzIBH5vEFN042sLFq2gTEk624MiZBeJGXpDfo/kzFCX3ugzCLfqrEOV4oiLxC+tt GqK00lD7VKSrJBxtJmq7P1lPm4p37mZWXZjEWOsHqKW1OBJS2yA5dJn1AEV13UYU+pIg Hp8RsrQ29DaIN1ziaNeObILoF5wEaHXCBwxs3dXTATpivYsfjUcGEIKWhll6owdrmFhV VdqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:references:in-reply-to:message-id:date:subject:to:from :ironport-sdr:ironport-sdr; bh=EQh15bgyooqf2MBjKGIPk4B57aveNgEztPHDXv0IOvw=; b=pLM+bUh8Fi/cu6C+RlMlMlZrPwNaa3AH76ZwmwqcUfMvbr6tdXR5uVhBS3X53DGlFS FVpfk4O8uCFNQC9AePv6j4QvJQdwU/8YYiiYVIDrrwhUU+AQgxJ39Rd9Oky5mete+zQd ugrZ/NqarU2xcimjkcz2zhgKxPrihAnkCmGgz5jb8FhDJxe6X96FCufFfZSGu1SXmfwN 7V9RHeTXYuY/IuDkv9XlwfKkr0+VlbBxgL6wEYv38ffTwKsoMv5VT9P1Sg6sTaGfWLLL z4tisjOElAw7cnjIULrD7fzXinlvxOMESxlBac/rSMvF/AIbEFDwGce43WZJT0TxkOZ9 jnYw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.252 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com. [68.232.137.252]) by gmr-mx.google.com with ESMTPS id w16si466474edq.4.2020.09.07.09.20.43 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 07 Sep 2020 09:20:44 -0700 (PDT) Received-SPF: pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.252 as permitted sender) client-ip=68.232.137.252; IronPort-SDR: xEKUM/i2DgaJ39LRLJ06c72GsmXdFnK/wzq3c2MMY6qY3cA8DIsU5FRSQ2EPgsku0na87sQheL UYBOdrs5//yjDEXkpsNwrPAX9lWtEHI8CL+eFmrDqwRvG8bZhnfIhKbEhnGpr9+UQHFiz/N1cI oVYTDng9RaXEBB7vVDmDNQCsGGEaUILyOeK0112ilR9PohIo1ru0Jk0Vym4LMNqzhRzFafUaac YtzSdUq4wF/O6QaLQFx/9W856WHJCXurMU46yrmKoX17rxuKq0y35CZLAAvEVgZsRvmvElUyNa WGs= X-IronPort-AV: E=Sophos;i="5.76,402,1592899200"; d="scan'208";a="52770196" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa4.mentor.iphmx.com with ESMTP; 07 Sep 2020 08:20:43 -0800 IronPort-SDR: OMK5nsc+GxQa9yCr2w3SGNzT3fLXr/SZFCM6+5yerlQMsmAjo2JvLdG91yqhhcURI44SUrYz9P JQv5Crux/U4dFc7MYMSROQPMdXzzCmCnmhozOL6Bnw6oOBIWz7Jk9CMB8iySaD0HnBS89H062W IB4zTf+1BCQ2n+58oU7EP/g2yLqUibdyl/2/aiko7HUb3o8YYeZiK5+KLQYLVVRvWPPpLPY+HH y59pous+gZqwP+EDjCeyKdHwTKQAPOeq1s4GiPlPrA/5N55MoDNrfuVqTDWz+Jc5QBDSq1j1gR b/g= From: Vijai Kumar K To: , Subject: [PATCH v3 6/9] wic_fakeroot: Handle standalone pseudo invocations Date: Mon, 7 Sep 2020 21:50:15 +0530 Message-ID: <20200907162018.16636-3-Vijaikumar_Kanagarajan@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200907162018.16636-1-Vijaikumar_Kanagarajan@mentor.com> References: <20200907161756.16372-4-Vijaikumar_Kanagarajan@mentor.com> <20200907162018.16636-1-Vijaikumar_Kanagarajan@mentor.com> MIME-Version: 1.0 X-ClientProxiedBy: SVR-ORW-MBX-09.mgc.mentorg.com (147.34.90.209) To svr-orw-mbx-01.mgc.mentorg.com (147.34.90.201) X-Original-Sender: vijaikumar_kanagarajan@mentor.com X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.252 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com Precedence: list Mailing-list: list isar-users@googlegroups.com; contact isar-users+owners@googlegroups.com List-ID: X-Spam-Checked-In-Group: isar-users@googlegroups.com X-Google-Group-Id: 914930254986 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1677192745744354424?= X-GMAIL-MSGID: =?utf-8?q?1677192745744354424?= When using --exclude-path option wic copies the rootfs to a new location and invokes pseudo as a standalone command to rebuild the database in the new rootfs. This is not applicable when using wic_fakeroot. Return 0 for such standalone invocations in wic_fakeroot. It also looks for files.db inside the pseudo directory and throws an exception if it is not found. Handle that too. Signed-off-by: Vijai Kumar K --- meta/classes/wic-img.bbclass | 1 + scripts/wic_fakeroot | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/meta/classes/wic-img.bbclass b/meta/classes/wic-img.bbclass index a2c9627..b1a7259 100644 --- a/meta/classes/wic-img.bbclass +++ b/meta/classes/wic-img.bbclass @@ -144,6 +144,7 @@ EOSUDO export BUILDDIR=${BUILDDIR} export MTOOLS_SKIP_CHECK=1 mkdir -p ${IMAGE_ROOTFS}/../pseudo + touch ${IMAGE_ROOTFS}/../pseudo/files.db # create the temp dir in the buildchroot to ensure uniqueness WICTMP=$(cd ${BUILDCHROOT_DIR}; mktemp -d -p tmp) diff --git a/scripts/wic_fakeroot b/scripts/wic_fakeroot index 88a03fa..304f9e8 100755 --- a/scripts/wic_fakeroot +++ b/scripts/wic_fakeroot @@ -25,6 +25,11 @@ cmd = args[0] # rootfs/root ... assert os.geteuid() == 0, "wic_fakeroot must be run as root!" +# Check if we are calling the pseudo command itself. Return 0 +# for standalone pseudo operations. +if cmd.startswith('-'): + sys.exit(0) + # e2fsck <= 1.43.5 returns 1 on non-errors (stretch and before affected) # treat 1 as safe ... the filesystem was successfully repaired and is OK if cmd.startswith('fsck.'):