From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6864480010557718528 X-Received: by 2002:aca:ac14:: with SMTP id v20mr3586772oie.40.1600267868784; Wed, 16 Sep 2020 07:51:08 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a05:6830:1f0b:: with SMTP id u11ls548390otg.3.gmail; Wed, 16 Sep 2020 07:51:08 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyXhDEGlpXaIJokMZW6aaMjhmvWjmW7vnp8iilisSQVUKG0OXjAr1VXyFW9zFLIbpILxrmE X-Received: by 2002:a05:6830:551:: with SMTP id l17mr17745841otb.61.1600267868325; Wed, 16 Sep 2020 07:51:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600267868; cv=none; d=google.com; s=arc-20160816; b=u9Txc4rjj5+2+e52QrE9d6bj6z4TqlsGo1qtQKwOKcElu3zfLVahw7Lp2CcteSCmWX r7CZTbHYBMt4zMeLI0/Qn8VrH6gnsLPIDbbh3H0OgmY6uR7KX0siUEQtR0xeLgUY0xSV TUGE3ibbAFOgEBYr08eVu5WQdto84uEOBtH690sYgjNahfUtRRMWcDqzz0YbtegdUp58 2FPUheTgnqnfwr3kj7HKP/B2BNHf74ribLAnVIhVRom3yh2tFOm8JVtWuDmF0DqC5x5f OtflMLESsddSYIbsQH44JWA3dgcT0t4IP1pVTXI01lNGGuS3sh0eHSoq0GEOl9PdYwn1 H2jg== 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=OW1FsJuau1tIePkkNkrQ/tESVPM5Lqiw+EhbCM51mA10exF0N8TJf8eONsXALKm7DB otpAmXU0DedjACQ6fSYSNHcgf+kD/NCdRIYurrURWYPWOC8Sq9J5mZk2H8OQvaAozCH9 4QZRQIz7hbaixl104Pj2F0ICym/JKa+TwdWkV/xMXkzOjunMtzepmxkOqDCm/pJyuo8v THnzcYMganE6o8leWjJaB6SGbX2xsLS26Me/4a/nrspXArGuUKJiuSsS0s0k71eabWux smTcDGQyPw3kbCgCOpqjx9cLbFJ3GVVly9rkXcf4nPmNAxySpAqXFbmBYuRnKaestVSY tk5A== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.141.98 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com Return-Path: Received: from esa2.mentor.iphmx.com (esa2.mentor.iphmx.com. [68.232.141.98]) by gmr-mx.google.com with ESMTPS id q10si1058241oov.2.2020.09.16.07.51.08 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 16 Sep 2020 07:51:08 -0700 (PDT) Received-SPF: pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.141.98 as permitted sender) client-ip=68.232.141.98; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.141.98 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com IronPort-SDR: phsw57ECBXLVinrbjB4/WQrcRBWCAeiNQL82Uo1K6VUWL191xWUtf9jpACd37qAZj6kf7K+CbH UpBKY3faVWnW1axkNk2P6ohtPfQmBn2sk03LpzfQ/CMw7GXpgew8XibRgBwMlJ+2Rj4AlACjc3 FUgmkvwwgG32zQhT+HJuwzdw4Qu3b/bcw5zaSDe5+RRslw0DCMwOFWNlgr8tmqy8sDk2tlfria Z2QX3aPkps4djsRCup76p4vZEFW6hgk1hxj9JqntBKoc5BDnAxN7KwQCpnMVdVPtT0p4NWxbG+ AA8= X-IronPort-AV: E=Sophos;i="5.76,433,1592899200"; d="scan'208";a="52989557" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa2.mentor.iphmx.com with ESMTP; 16 Sep 2020 06:51:07 -0800 IronPort-SDR: +GqgKNPrj4lHNuF1aVZT/qcIELb16ett90NC6FVTStbPVk8b5jb4pFpjPU9v3S0e7YHBGFrptc kPESbHCkIYUEipw8C7e6WfhKyZyVqaQrU9TKNDcLmhS5vbI/jHr6Ex2tTcBHItJuYaF4lMS1Nw swS/S+ooxr7+3SJBzMz9fYAz/6rd6QEJxlsu/ZwwuLNYiyE8i7KkOkuNwT0PCZj96tBvwUPcla 1tosNRZe2ENSUEGCfRV31pTgvL9GFvbL4cb/e9gjej2txd6uqvnBZrEG5ANGcHuZ9RBG6APgqy Hm4= From: Vijai Kumar K To: , , Subject: [PATCH v4 4/8] wic_fakeroot: Handle standalone pseudo invocations Date: Wed, 16 Sep 2020 20:20:17 +0530 Message-ID: <20200916145021.5856-5-Vijaikumar_Kanagarajan@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200916145021.5856-1-Vijaikumar_Kanagarajan@mentor.com> References: <20200916145021.5856-1-Vijaikumar_Kanagarajan@mentor.com> MIME-Version: 1.0 Content-Type: text/plain Return-Path: Vijaikumar_Kanagarajan@mentor.com X-ClientProxiedBy: SVR-ORW-MBX-06.mgc.mentorg.com (147.34.90.206) To svr-orw-mbx-01.mgc.mentorg.com (147.34.90.201) X-TUID: fqCUVhtqfHj4 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