From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6864480010557718528 X-Received: by 2002:a17:907:3301:: with SMTP id ym1mr23145637ejb.367.1599495645324; 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-Google-Smtp-Source: ABdhPJwCYoQqr1JhaKkFjaSddMGz3HOBR+Qqdqgz+3jbERtlULD0qHYXU6zb7ksqX3q1K4jzwKxx 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 Return-Path: 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; 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 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 Content-Type: text/plain Return-Path: Vijaikumar_Kanagarajan@mentor.com 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-TUID: bWHhun/xTI9v 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.'): -- 2.17.1