From patchwork Wed Sep 16 06:50:17 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: 53 Return-Path: Delivered-To: ilbers.mnt@gmail.com Received: by 2002:a4a:eb04:0:0:0:0:0 with SMTP id f4csp517916ooj; Wed, 16 Sep 2020 07:51:09 -0700 (PDT) X-Received: by 2002:a9d:6a4:: with SMTP id 33mr16343239otx.360.1600267869078; Wed, 16 Sep 2020 07:51:09 -0700 (PDT) ARC-Seal: i=3; a=rsa-sha256; t=1600267869; cv=pass; d=google.com; s=arc-20160816; b=eCsPe6smmX9N5szGQy+jW7aB3LnEsv3F+Kbgo3+zKctklwjgguRbPRWn9W/8KxSBan LKPzeQAydDYf7mKjKhEDOc1ofxzmtogqzh6Ymc91qW8jQKraMJJ282LSR2bFB8P8+6Io 3MLg+0DWbS8uptZHue/RkZeZUOngjiPLgO3SGAEs1msWwBIvCqkZYz65BL3auDuMIgLB z1qXhKGrKsJud4c4Ml63p5qV3hOipMruaZCCD9QqaGYAJgnbsOTGEc+oIvrUu9IJ37hm WLWv1lcsCMHzHXnARIZcqcrAYKjYqLsESWsozVbZvCTWbL99nBxqZTctoFGCuhO6hWct M6Yg== 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=Asd/SV+qDEooYTGBOC1aSUIWHm0d0R13swyhr17TbBI=; b=SKcNzbncWP+2mVzuDGZe+/6M/C74O8g7J4yAtORmGTAADch6VfD9iwhY7FdvaVpd6b BgmwKXmXXvzhabV6437iOM84L1ZOH6h+Jm/WLLtQd8MaFz5iwo/BIPtLUpIevtQQj0n3 djoOB53nkpWBHngFPM/ObU7PezDSM/8TxN8sWIq+26XTDL3c29a593zXp+cgMzdv60Uu 9d+8R2UCy8hQ2T3TUL85dg1Mhv/9/M36hdxcygaRIHjMMlfRxsyDWs5IDOo0PJ2LaUtc H5VlNK8baHbVnyPm2BggqGcTjuH3fDWhpyd7ICiHhZwlkP05PiNEnRKLbLiH6hv6J7Tc Z+aA== ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@googlegroups.com header.s=20161025 header.b=m4aKAPx8; arc=pass (i=2 spf=pass spfdomain=mentor.com); spf=pass (google.com: domain of isar-users+bncbcwp7lf37ukrbxgmrd5qkgqeyisso5y@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCWP7LF37UKRBXGMRD5QKGQEYISSO5Y@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 s10sor4261207oih.32.2020.09.16.07.51.08 (Google Transport Security); Wed, 16 Sep 2020 07:51:09 -0700 (PDT) Received-SPF: pass (google.com: domain of isar-users+bncbcwp7lf37ukrbxgmrd5qkgqeyisso5y@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=m4aKAPx8; arc=pass (i=2 spf=pass spfdomain=mentor.com); spf=pass (google.com: domain of isar-users+bncbcwp7lf37ukrbxgmrd5qkgqeyisso5y@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCWP7LF37UKRBXGMRD5QKGQEYISSO5Y@googlegroups.com ARC-Seal: i=2; a=rsa-sha256; t=1600267868; cv=pass; d=google.com; s=arc-20160816; b=vt04FoTT3jMB8FptGIeI/wneT7S74+W6VrPW3u46jkWsBZPIN8iBCYSSmb2s092XZR 5F39DnupswKE9dtHFtfn8dPaj0SpzN8WXcGsDn9hOx8hpt1wi8TNJZIrasqeMZd7DTP2 v9UjXnGzFA/+2t/5AqR+8ksIaGSdUUk+zvZRo7Y1BRV/W5CxSBCb340Kz6VcsYyNSKhf KvxdsBed6gvZx9FTcurf8mUURQ20kMRPQKnJNmb8TGVelz+tDwSKFZMhnwREm2fCiql+ ay26Xyeill9u5VmezIjBIrOzCn++W3imSUn/TxaAS8YRtBWjo/NDVPKcA7vBrdmAmbKx jxjg== 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=Asd/SV+qDEooYTGBOC1aSUIWHm0d0R13swyhr17TbBI=; b=mDHJuuPlTavC+tc3sE3P70nT0dRkZj7wM0OVKNJ83nK4xtxuYjqWCD+hRhwXyGioss DWhgFFsw7/dONq9t5SoRl2zSZXlyKonCLLDXqgo3J0acFNm1URJ5dfFZ765k4rUoJ+ME ckZTdlEQh/d9m6ae/p5EscOkYMupmuEyx69m3mAmvzASqixJdjfTTM1BBGMWuBTGcAuP 49POr3rs8VpyGUKeuXz6huJnKOSGts0S2IAx1V64/9nGVvXp352odUObTAQq6rQHykOF /PNmbcJBlCscR/McV0YZtg8wplnDLG8s7V4A+iEwP0mHBiXOA8wmW7Q2FL+Ya3V8X9dn a+HA== ARC-Authentication-Results: i=2; 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 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=Asd/SV+qDEooYTGBOC1aSUIWHm0d0R13swyhr17TbBI=; b=m4aKAPx8MVA1dxCFNHBi1DXY4G3SsIatL/NzV3kea6rYsOjvXQ4wLBj1byRyRO7qgJ 0FBivgFjQhboFJGzMb8uIiPJbLhOvAMFqDrboUcTMMPzQoFTMJnx2LZyWfjNCGB+T/w9 Lx8FVQHbecuydK+yjIbJQtaaa0RQCX2fqTLYzx2Ep90Irm2CERythonzgVFvyd/VUODU mlQfFAIetDo478BjewuOgDKcruuHcaW1lWFAsaNVRoZuko8H3IeqrXTsJCsv89pA7R/W VU7zrKsWEqXktMQJwDOW0D00VFxbV4EZ3nSTVaS7AMdVvX+oBLeHWBVpcNGEeldXx8TU WKHA== 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=Asd/SV+qDEooYTGBOC1aSUIWHm0d0R13swyhr17TbBI=; b=i3IZ63H+q0ErH4g8krjM9azK8wLMnWEbA3dHxMTdOdFJH0mLIZdDUJ67plbyVcqMh9 A28gs092MKIxTfNIEyPZs18xAIUatgnu//gAD/U4kQUAQKQm7TS90EFphI/Xy8a3VxCD 8/PsQcnME8PAYLL102cgR8QW7o8gOCY9865gmEcO7uDpmIkOneGqqPqX8MLVVxfNXz6B RrAgCs8JXvMAqbbA23/4rTw/9M8hQzVwD0ORBONke4Lf1T6cqN6qaEiG6YZwSCgPE+HA PA9vdThtGpwsv1NhGYbdT2dUqL9XJuyeHTOzLlZndvnkXpah8LodNeHtr9SL71AXoE3W flig== Sender: isar-users@googlegroups.com X-Gm-Message-State: AOAM530YuOncE+ChmHjWIiRlIsAQmTjAV8zSKXL1d0nowatFssUDp1OM uqj4Um5JEmKJV+jbMLK8QLg= X-Google-Smtp-Source: ABdhPJw7j/QPhsEOxWpCINAaL5rI6ZOE1ZkNxeGTPN2K6jUTdNW8M14KtjtMoT8rIvT2FuaywH18Mg== X-Received: by 2002:aca:4fcf:: with SMTP id d198mr3487777oib.83.1600267868738; 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-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 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; 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 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-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.141.98 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?1678002481172873929?= X-GMAIL-MSGID: =?utf-8?q?1678002481172873929?= 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.'):