From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6864480010557718528 X-Received: by 2002:a17:902:704b:: with SMTP id h11mr3098911plt.307.1599073036802; 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-Google-Smtp-Source: ABdhPJx/lQDIWtrc3ew9v+gYKe5JwHXEXwY545GWbsJI1RLjYV+qVe3th9Ab2ZC37tEsLbhmF2wo 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 Return-Path: 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; 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 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 Content-Type: text/plain Return-Path: Vijaikumar_Kanagarajan@mentor.com 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-TUID: ZQ95b1us0E3T 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.'): -- 2.17.1