From patchwork Wed Sep 2 10:56:20 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: 25 Return-Path: Delivered-To: ilbers.mnt@gmail.com Received: by 2002:a4a:eb04:0:0:0:0:0 with SMTP id f4csp654395ooj; Wed, 2 Sep 2020 11:57:17 -0700 (PDT) X-Received: by 2002:aa7:90c4:: with SMTP id k4mr1320448pfk.79.1599073037140; Wed, 02 Sep 2020 11:57:17 -0700 (PDT) ARC-Seal: i=3; a=rsa-sha256; t=1599073037; cv=pass; d=google.com; s=arc-20160816; b=UB9RuZfL+bfbQlAxTf6HX/z+eEdttCph19Qsa7hgspt5y7iFRBkUSbUbtEEGB4y3xg sJSCj6ZQNrIQkNNfk9MQE/LVuPQyZ5U0XY5sQxP4cnY+gsglYxAHQbzs4yE5oJwFacQP G80XCiyda3TIzheOXjNaOr6ptvmXGyiGDAQBFgHTPiMiAPURpctwM0EEaMSNQ76wXfyN xjPzr490ZaPcArE0qVmsuTsmXEsw+2ob/8YZI7+d9KC1dIQah5S9hnAVGR+ehoSBwC1X kctj5azwQ2u2mZMdA3rDWGeBkHyxwaJ1I3oFxflAjR/akLj5kWm9y4B0ioUULtWxMSDM 2d+A== 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=QcmkWtWgih83lEnHyPxNGUmuA0oIPQdsXlXX7CDco1U=; b=WhcrCT7mJYNPfc8aeAa3+2G9VHtnoUJI6KOZrfUVIONXwaSVn7pbFXd7kj7FORcmrY XkswdUiGK0vrY6OArBJO69c2tRu3h9vZy/krPwwh7AkuQM7pzSA4Ek+nF5n7cwhTMtve z+yn/ElsfnHd9MtiyDh8eXP6r1FiIcM+fNCYr/wad02g4XC6QVvEuP4a0aL6jzf+unhx Gh0WZ/i/TbepwGoaqCvHEiZXP/QKdcRzjNOxGFaTGFbZ2KeOS0fg1KgmJQYSORkTA9Nj V2ooZYeRfcWDrrNeAJu7Jfi5l4d49IQYcPZ4S9RMrvdVdbu+vz5/BgZIutB1HcG5MOCN YHVA== ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@googlegroups.com header.s=20161025 header.b=pLqBJJIo; arc=pass (i=2 spf=pass spfdomain=mentor.com); spf=pass (google.com: domain of isar-users+bncbcwp7lf37ukrbdgwx75akgqejxslqna@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCWP7LF37UKRBDGWX75AKGQEJXSLQNA@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 w4sor239836pjl.25.2020.09.02.11.57.16 (Google Transport Security); Wed, 02 Sep 2020 11:57:17 -0700 (PDT) Received-SPF: pass (google.com: domain of isar-users+bncbcwp7lf37ukrbdgwx75akgqejxslqna@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=pLqBJJIo; arc=pass (i=2 spf=pass spfdomain=mentor.com); spf=pass (google.com: domain of isar-users+bncbcwp7lf37ukrbdgwx75akgqejxslqna@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCWP7LF37UKRBDGWX75AKGQEJXSLQNA@googlegroups.com ARC-Seal: i=2; a=rsa-sha256; t=1599073036; cv=pass; d=google.com; s=arc-20160816; b=ZXoixJiZjB71dEzAz/MFR9N7ifVJv8UlAIP7CsBcLR5uPKteW4PIMqXktlTIphYyYS NR0zgpz9e0p8Zm/o6nNSCUusbsvwPDTCe4BRERQt08z+nv2b0ZBZS6ppR7ib2kmKPnBv xmNlI/nFtYxqeVs7m4XEYeisLBJTpJFexDY8TPkDJS0wKMrCCeNVUyMeeKGo1+CVE5vd 7ex4A7Y/DX+7NFw24oqd8J4kFELd1yJ1ah4ISdyEeVHin+w84WzEs7BUPFeqi5Uxb3D+ Af0H7Crytzao5ykRXvTV793gl3FmveUIHIL++sGtHY48iFvd1dN2kMKdZERGKtZSSAXu 3sPQ== 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=QcmkWtWgih83lEnHyPxNGUmuA0oIPQdsXlXX7CDco1U=; b=NL2FJHALqrdIAo/tAIEKxlR6DNVZopqEP+L8W4tuvYWD5pE09SeFcptueoHTtI3tbB ONHIYO+wz6Vhv/60SP+GhHcOfnaASxuuqty/RoPyIWjbstmbwhvs4HBpr6mGFCKP36dT z6F6HxZU9Dl3qP5uQgjFeZ0WjwXr5VtDgSMal/VBgsfpJA4x78Ng0k7fr9H4djOtrFd/ 8/aocwIm2ch43XWVmeWRSCnrGZPb0zEL7/ILd6pHs7V57FUCa+XAWAIgScoSDkhJ6Ykr faISxwbrAUzJGyrx/mE4PQY9yeVdVKoSlzUN/hHtil1xwOZjHTSc6VMnskUPUG/cXnhh hCuw== ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.129.153 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=QcmkWtWgih83lEnHyPxNGUmuA0oIPQdsXlXX7CDco1U=; b=pLqBJJIoYwFmJapZMT7/PmPXe29k8n2K2KaWOLaVcAbKCTjOY9TOBZrC1QMbX3vA1C gAqWlwtm7M0Dii58Lx69nqG5hwSbFcIrI6uOeOJbG0/5Hd+0S8y43ryynaxPyISY+X+0 rWgHGA8v/TZaadwYKX1nbJXkZrWOmIENT9bLyQknVCCuU7vgvhJAnzOBtKMAUCndzaCj spxZhhqzmsnwS+yM86+2diavox13/lreJv0+Wd1p/+nPxIIPi32SWUpampF/bS+3XIHm 0Q58V1NmRlUVS0m8SpRv15NdnDygBoLKcRgzNJyBYWn6UHfQS5mHtZG00DCwYS+GPMNf PozA== 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=QcmkWtWgih83lEnHyPxNGUmuA0oIPQdsXlXX7CDco1U=; b=qCbZuXCpWervtB/duTC3LhNVgkPgUbcx9V/QfZj/rRQ+vUrMJgexbILhTcZT9r1gKL AwhkN97LK184IuVKbVPDqVf14b36+yvhbUA0SoXme2gqC3cPrzU68N5s4f2ayWR/nd2j cTJrDBXHfn7pBDU78kp+9BZenlHLZvob83Bg6ctCvSKpLtdtJQ/pG9tgnsSv6fhsUgRx zIw9TU5lEz4fBodeob6uiBDaiyjnFgMlC+KdmG16E4Nhy/8PSTXV4D+mjE3CguTHWugo lzC/0nKJ5xkFyGZyic22CEnHRuqXsDuUAgZMNSmbz01VBNwY86nlN7MLDtnD3MvET0fR zssA== Sender: isar-users@googlegroups.com X-Gm-Message-State: AOAM530rihLVo/+8SXIl1s49SNnIScuCqiU3i+BX9YEV7O0zI20H16NV Q/6NHAtc3z4jYEeftgMEBYU= X-Google-Smtp-Source: ABdhPJwZbg5HLecpJV9dwWKtKHmStQCMPIgzEwPPMEsJOBsaC7bXr23V6E1iKiuMPSABLXYWHgCvFw== X-Received: by 2002:a17:90a:fcc:: with SMTP id 70mr3275636pjz.220.1599073036725; Wed, 02 Sep 2020 11:57:16 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:902:b602:: with SMTP id b2ls1621601pls.11.gmail; Wed, 02 Sep 2020 11:57:16 -0700 (PDT) X-Received: by 2002:a17:902:b602:: with SMTP id b2mr3320022pls.280.1599073036233; Wed, 02 Sep 2020 11:57:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599073036; cv=none; d=google.com; s=arc-20160816; b=aFfyvE2d00zw6txTFWaNk4Iucg3QKsqQuQeVqyyjME7ZsK867jdY3ZrxHAZFqgS1Y4 8zSl0ANW4S8ZUKJBtDD3qTk26NG71U/x+sypG7YVcsbAmNX2og4TTfSVCqCVzrC6T3lz 8Mw0ojs8gCfCPrgWQnGmXvDlJwHxl8o6BfjNBx7hA2mkcSce+CuUSMMbpQslsv/En9Df h5CRC9rnjkCyLggwq3astwElcO0+LjQEe5HS/ZgsQvX3dqBaw/kUm7VMX4eAOKjdI/UR UDffwqqu7lU+wFFf6v/FYfebnY6+QQJfrmOOipEhKv78VlW+U6LhC2ULC2JF0ztkUTg8 PGzg== 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=U1wItO/Rwqipy5D9WgxJeXhDu7GNPLbUyaWObE6DJpM=; b=cWSlA6dfw1kDm6aiCdAKfqaJxqzCS+G5uqo6UZi5CtPWwIr2m1sJpfB0JEvL0WL8Il Od+bUmmV4l/aet+WOHv2suN+YE9FL/Sn/2bWteEm8VjMsh8zB2HCxIPMWobdXm/WFsPR FJ56+ArlO6ET++7IvbFuKVRWaqHQrKZ6PUjj0qoPUYi22B+fgXiHDc6S9LO9t+vGZoJD hfCt3FoWSRBvN/KIU9OV3JQtO4nZTwyTfXh/MusmMz3+57hDI2qVN4Q0C610vNHShTzZ ar/XlNCFrXOzVA1yHGj/b4fdAygX3oXKVWsRopZFYRnsw7nZN+NwpJGYyOn0LwdMB+fU FPnw== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.129.153 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com Received: from esa1.mentor.iphmx.com (esa1.mentor.iphmx.com. [68.232.129.153]) by gmr-mx.google.com with ESMTPS id a199si43434pfd.1.2020.09.02.11.57.16 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 02 Sep 2020 11:57:16 -0700 (PDT) Received-SPF: pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.129.153 as permitted sender) client-ip=68.232.129.153; IronPort-SDR: HuGBSO3tqzu9Fxh6bqZ7AQTTVKn36HY+MGh2dzbeNHnkxa2lGk/76fKZs7ffRyS/YJu5E2tLcc UZcKYZ9jGxoEVqysb0uzmrdON9sL+ey9mWVJALHW/ROzMdY76CmbS0KEA/lf2V5XuK0OCocEkt fTKoni3cvWuu/Fd57q8nvm91/25nuQRyzB/GWm0cLxIXaJXKAFIBh87G9AE6SBkOxC25jYyZV8 bIsrnt+KyoCw5O/zt0WmmW9Y3Z49oZC+usmwyE5pzCFU08L7CogncjmJM0qcwWM7n/Lgy8V3Js IS0= X-IronPort-AV: E=Sophos;i="5.76,383,1592899200"; d="scan'208";a="54698488" Received: from orw-gwy-02-in.mentorg.com ([192.94.38.167]) by esa1.mentor.iphmx.com with ESMTP; 02 Sep 2020 10:57:15 -0800 IronPort-SDR: 4pbFb4qdImOHZCJYf5140eVo2khoWklsp2eZq4t1T7ajUkkiyHki9OCvFPpuVxpLOq15CUNmJv A9fgwCSFc32R1YDqjLYBeaKRwbNe3Rr7g0Rcrly254/0cep6TAT7DwFOSSQMgS3TgUfaYuwJYP 79NyIJ32oC+CST3RiEy+lZfFpntqc90Q/wvmRojOJKEOoYblXjMrGp8nmh3qi3g4ZP3z7H9ZHN h1mKjAHK8IqNvia9Wak529qGpeCmYLOTZJVrgt2eKgNCIkU8aOmjV5Lnhe6DgOe/CDf/6t091D 1n8= From: Vijai Kumar K To: , Subject: [PATCH v2 06/10] wic_fakeroot: Handle standalone pseudo invocations Date: Thu, 3 Sep 2020 00:26:20 +0530 Message-ID: <20200902185624.15044-7-Vijaikumar_Kanagarajan@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200902185624.15044-1-Vijaikumar_Kanagarajan@mentor.com> References: <20200902185624.15044-1-Vijaikumar_Kanagarajan@mentor.com> MIME-Version: 1.0 X-ClientProxiedBy: SVR-ORW-MBX-07.mgc.mentorg.com (147.34.90.207) 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.129.153 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?1676749608972441498?= X-GMAIL-MSGID: =?utf-8?q?1676749608972441498?= 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..16b011e 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 1 +# 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.'):