From patchwork Wed Oct 14 04:27:25 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: 146 Return-Path: Delivered-To: ilbers.mnt@gmail.com Received: by 2002:a4a:e04f:0:0:0:0:0 with SMTP id v15csp550415oos; Wed, 14 Oct 2020 06:28:16 -0700 (PDT) X-Received: by 2002:a5d:508f:: with SMTP id a15mr5484786wrt.417.1602682096567; Wed, 14 Oct 2020 06:28:16 -0700 (PDT) ARC-Seal: i=3; a=rsa-sha256; t=1602682096; cv=pass; d=google.com; s=arc-20160816; b=DVniXjVMiu6/dSFPnxvkofDB5gL+lnySNp0bnebbvW01+C9ax6L/FO3XgH6ZrBlkrY +JKBbPIrmHYHPEX96yEx4YYWcYKThAicJWt0TwKBfMd84aCxYkDd+r5BeH0yM+lO1O5l PKPiDxPbC7o2bWfPM6GvpbHMKZ++Mm++FStGEqwFlt5ovvcWnUnJuX183BRIZEkXjO5i y7+O4Ob7XBhg2TVKxGUjGJbZGiwxMa7GKg4KNrBR+aepeU8OPgD4bce+TkZ1/4R83/KX ogDG8JhWJmAvp6Mj5LC05N1j1Q9xK85LEYQuNdbTVvoEw5gbzQqM77cGyQJMYwnLH1jq cgpA== 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:cc:to:from:ironport-sdr:ironport-sdr:sender :dkim-signature; bh=+To4JH+k2nG0SJ2zgT8qVgLSROmj7B1ektWq9LM9L3o=; b=bnU9kHQx9Ompb1JOEeu94clJDLhOraU1wX/bkMYLjej+ODzG+W6ZadHoC/35AIAbEL 8R7OkPcM6Idy1zDpngLtFZSHF8/XDYbZ4YnPd3Ym45FskDNNik+Da53sr7nGkLkf176y yZp9rSxjEvBE/jbhDuyrQzsXxKY5BbiLigJh1L1RHsk3nFw+nUJuRVOKC4nqqDmFW5jw BQChQ1xomzuqtqJEHr1MKEaIuTf72nlgNgLOANrU76n1rAZYNB0Yo1K6dH1yo6kiHwxp JiQ4rRXPW0Hb2MlDiNhXg8p+gzw2asLjgppJ4yE2ZNWEYTdfAwuL92xb0ZQA35OSpUGj P+Sw== ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@googlegroups.com header.s=20161025 header.b=WiigiOa3; arc=pass (i=2 spf=pass spfdomain=mentor.com); spf=pass (google.com: domain of isar-users+bncbcwp7lf37ukrb4hztp6akgqe3g52afi@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCWP7LF37UKRB4HZTP6AKGQE3G52AFI@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 b18sor2195414wrv.29.2020.10.14.06.28.16 (Google Transport Security); Wed, 14 Oct 2020 06:28:16 -0700 (PDT) Received-SPF: pass (google.com: domain of isar-users+bncbcwp7lf37ukrb4hztp6akgqe3g52afi@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=WiigiOa3; arc=pass (i=2 spf=pass spfdomain=mentor.com); spf=pass (google.com: domain of isar-users+bncbcwp7lf37ukrb4hztp6akgqe3g52afi@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCWP7LF37UKRB4HZTP6AKGQE3G52AFI@googlegroups.com ARC-Seal: i=2; a=rsa-sha256; t=1602682096; cv=pass; d=google.com; s=arc-20160816; b=xlIsRSrRlr/Iy8yTy3tJ4sXuybF1mR6NKyUHLI/EyLhNh0KmP0KFKW6hObPlja7n5O rmahS89zrWfsX3AF2eOH33K6dD8wBW9/E76e/VNTryrjZXadTL1NDVIF4v+Lp0Js5E2O c5zU4z8hOIO/vsOnq3AvoNvIYabvWS+jn3DvStjg+YmKiYw2go334w7cOXjXiJbpCmgZ L6kpeO5bK0bmpOiiFiJbFGiEVpvYRPX6wmRGRIpTaUKqTpF/evfhywo+6pWBG+kH34k4 nY9EZ4HyI5A+krOTxZAA2rv3acesMn7xEUs8918dKGaqB4c1nNYcjOqrc/pO8Maq9f7U qkIQ== 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:cc:to:from:ironport-sdr:ironport-sdr:sender :dkim-signature; bh=+To4JH+k2nG0SJ2zgT8qVgLSROmj7B1ektWq9LM9L3o=; b=E7fG+cNyiX9kF4UFzhGo4j1vg9w6ImQlu6bajuNIk2MFV9kqQzgekz3euWTnQHDTnH Yf/GBEFLChExuyt+ta9Bu9NKcykNUCNWitaZr9kia79PA8zKD9Y8gk2oZLVXC0f6qAxN A9dNYuAyD7j0a6f2/eflWOD6d/G601oH8jN0ZreewmWjcuIYpoTxGtIa1MJKvoO+m+od gpio8uVshE1RvngTYbBq/XZLdXbDtIS5SbE37S3yYeYn1/Gl/UG4hV1i0zHGNp9tSvnu YdJvY4wck03EPEZoaqjYxp/XqiDNORgmv0tCyN4AFHM4Ner/yu8aGVI3vSijp9L4oWlg /zLw== ARC-Authentication-Results: i=2; 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20161025; h=sender:ironport-sdr:ironport-sdr:from:to:cc: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=+To4JH+k2nG0SJ2zgT8qVgLSROmj7B1ektWq9LM9L3o=; b=WiigiOa3cFuiFUrXJRHzB2n3hSOMTtPMVVg1LETbFg5BLGLK1j22s8oMlM9HuSpIBN F3Jp+LagA1zqoObcixXqdAy8aIp0noxH73pWlGcKYdvRzyiFEkAyFG9PZoinEWzONx5z OKTSJU1XkiEsWLevWcaIvNwImW75jmHg+KemLF7JJkb9jvAU8RFkQ2c3913lGClpyLX7 C400SGEhNiykX1niVMxpf2cdjGG/YsgF2NFKHw/YsTimGCJhTiL4uaBJ1qqsSLpjHVW7 hy5un0cN+f455Ym1cS/33SgK4Z0a7SQ8ARMdQEC1LWKgrgAo9+G/iWBivSZvGexsGYui 5Z+Q== 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:cc :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=+To4JH+k2nG0SJ2zgT8qVgLSROmj7B1ektWq9LM9L3o=; b=V3EMfHAAKdEBfqRmhelNwYD1y1eRmpcU84gAc39leXSKitKmN5XyMBKR0Jjf1DDTnT OGsLsHXMfad6IIyZl295erq9xHfgC067gRFJxyuR3c8v6bt3u0epF+xeA2SZrvcmDPQv ZJTo7fyLUfqbS4G8pPj8NkKe4dBMeN3z1ghHQl+WFiiAit1JnLn+csMdKM6RBT/aoImv le5WXRr3xz/Fgaxj6bpGQB+cOovkx+dhV9zuCs6POkoyCWgGQXAyuVXdAp1tQIxk2SU0 b+PFdxyxnydMvlXj1VtclNDP5VOg7aQS6JXCQuSBYqaWySS6/sFmFSipOQRooW4k0MT7 jYpA== Sender: isar-users@googlegroups.com X-Gm-Message-State: AOAM531vFLdzB2+F8BQldXuSrTtGrp068/4JWXMrxTwN/x3YQBLZhZ2I WKcI67N9pErK8WYGWUAfj34= X-Google-Smtp-Source: ABdhPJw/JniITDMigO1iIa+zDmsWkNMPoAmN1mX8tOqhvoMh3/kGndM+xRzTLOj3ZLUy/IeelrzIFA== X-Received: by 2002:adf:bbd2:: with SMTP id z18mr5992188wrg.166.1602682096176; 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-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 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; 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 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.180 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?1680533981948849518?= X-GMAIL-MSGID: =?utf-8?q?1680533981948849518?= 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.'):