From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6880180325712920576 X-Received: by 2002:adf:f289:: with SMTP id k9mr6118835wro.0.1602682096275; Wed, 14 Oct 2020 06:28:16 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:adf:82ab:: with SMTP id 40ls4449616wrc.1.gmail; Wed, 14 Oct 2020 06:28:15 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy7zaRwCxFeM2Wj27X/nYAoiA31H55SFM2KJdz2XqS357FP+0UYBGQ6ytFhnP0kCGBHibMe X-Received: by 2002:adf:ed07:: with SMTP id a7mr5867255wro.326.1602682095256; Wed, 14 Oct 2020 06:28:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1602682095; cv=none; d=google.com; s=arc-20160816; b=Jtjjk84hhTEX7yExZEIb2OPrkyuXTUZMwJeVI4X7G4CxJQckIGAWl/ruO2FH2FrpO4 C3lRuUtLrjULYIs1HYDnHJoY9cmY3L6ccLha63AnpRJaGFb+cFvvtBCWRu9xau3gQ8kg wFljvRJike0FCFrqIZSJtdve/ok3g4v62CP/VFCc1/E07Tb1hS1tdXl6/rtHPEHcBUoa 6EiSi/Sntb6DLxIhHg3eKwP/3cexx1mhh63UAQmNtavwLDNbAp3Y/3dxfaozKACoSLP+ ccgpUCIeZuLysE/Qxv6+2tmJWS0OFRAjah6aJCeJD/yu9RGhZUmwt7Cf9BwimDzNZYQR KR2g== 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:cc:to :from:ironport-sdr:ironport-sdr; bh=WdWl1PtsYw+TMP2+HfvRj5K/ajlyL9OJKuvkvl2hxs4=; b=pquhyipHKB9JbW7Wmr6XbcQyJEtRxWqcUEpfz1YLRhO8qALWcXNc3/5Cvbm/5JC/6h jUCq5FgiEiVjjcQQeKT3L9r0MA2e+d81uLYS3nZTw55kxXEdPX2Egckpe9Ahhmbd2krh dM9LgZDCy0iIAtdonNQxWVjWct2jT3M/jOJ2/uPzvb1nLGEbYGyiDZ7CiE9i9HZzogzQ u0OxPjYmnhAV3deL7UMEbcRhYFz56TMEYmOLyiVmzahOMmbE72tcFMzE4gMF76s3mYoV tyha7Vb13u+TxtyqwSbtLYDThwB0/u0cnVI0QzDy1I0hTFbS39xJKC6puo4YaF+Tnq4E ZusA== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.180 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com Return-Path: Received: from esa3.mentor.iphmx.com (esa3.mentor.iphmx.com. [68.232.137.180]) by gmr-mx.google.com with ESMTPS id 63si57552wrc.0.2020.10.14.06.28.14 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 14 Oct 2020 06:28:15 -0700 (PDT) Received-SPF: pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.180 as permitted sender) client-ip=68.232.137.180; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.180 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com IronPort-SDR: 8D++SQm8IUdvWrG051aDn+c9xhnlvUDcF+EaTkNaOU4aJZ1FMlCVG/RG24cSHH5iAmz262D2yN euhrYFWhQE313i6kwJdkGHamoShaaaxwLT6r4gHC+n3hZ1i68bjyWaIPB1qxYqPyadCooguzxR j0i6GZoZC1OR6qNCXsHQz+AkQin0PSKULvuanYRyKxjPLg4JAj4WDV/ck2dft6BkCczPMXhFOt DaV0A1pztZltAQVAwiHoYBf+EeGiDtp7vRqnbfC7VF3DOfNMMMboWEbELS42qJeubZANNGx42q D7Y= X-IronPort-AV: E=Sophos;i="5.77,374,1596528000"; d="scan'208";a="53925692" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa3.mentor.iphmx.com with ESMTP; 14 Oct 2020 05:28:14 -0800 IronPort-SDR: Xz6nBDZqZkLDFZ7ZUgXI+AL3VhSB9WkEFJ1K4/CaKqbtSXtx/cKIE/ci7aPSHAiamAuc8bpQKG NSvxq8H0oeOLIqnhe5AhR+pnT2dM4a2N3Zo3TZSmtPDv31D0lNM+lUni7TS9LzWVeCgkQYA5G3 2LNNKfek+clnugv7mqcIlTveQQEV2c8Z5dfHwDuX4bXvYw4Ib2dQ1uGVn+f8bAMiPBLTUXDxTx 2dyW29BYxwDSB6ecaH8b5PwvcYh29r5+ZTny2umFTbBW4nlHmk7HiiO4QJCVrotp+f4mUYdHZH Rc4= From: Vijai Kumar K To: CC: Vijai Kumar K Subject: [PATCH v6 4/8] wic_fakeroot: Handle standalone pseudo invocations Date: Wed, 14 Oct 2020 18:57:25 +0530 Message-ID: <20201014132729.18571-5-Vijaikumar_Kanagarajan@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201014132729.18571-1-Vijaikumar_Kanagarajan@mentor.com> References: <20201014132729.18571-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: MHEBuPZji1ct 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 057429f..985137f 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