From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6864480010557718528 X-Received: by 2002:a17:906:3417:: with SMTP id c23mr4918850ejb.45.1598266773181; Mon, 24 Aug 2020 03:59:33 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a17:906:b01a:: with SMTP id v26ls4388434ejy.8.gmail; Mon, 24 Aug 2020 03:59:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy42ks9GjjRSaBGB0OVQpcJpVJj6K8ixuc4i1lRQEIVm+MAyC4egVj6srYomBzmvZEBIO40 X-Received: by 2002:adf:c64d:: with SMTP id u13mr5525183wrg.114.1598266772447; Mon, 24 Aug 2020 03:59:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598266772; cv=none; d=google.com; s=arc-20160816; b=Ts/VQomeTbO6KOOy72bytcuVfB4koRq+HmXjTe+V9BWNMgNAxO97OlD7yi7c/ihm6x 03o6nLSlYTyCHj2HcNhqICo72AZgLQHmCYpNZRDW0yfbYC3LTDU7q6tLyfsY8ABpqGhi u/GTiiuVgzkb2uyJfHyALlNQxEBSEZ7HAzzbDuuHXd9GjMcD8JerIuOFZUZ/YMZQD6ug 2+fH3aRkz2xYW086k6pJF5AVXmEsNoGsAbTBEHYgA6SS//LMYSyDfa8ap5FlvMZBeESQ alJTIDHqDYVdZFtrem7KiRm8pVs9Lg87+mPDFRZOnZsjCWNhmFyBNlYD5XSUg2G5ZlJN qEjw== 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=lusiCR1afZm5E1OySTnbDfbVA12dq3YI22jJnwtUozlBcDYa8abUyxI1dDhm3fFXoF i8V5n5JJE4NCfNk3JdDy6omj/sch64cuawjVYE+3evYZSdfcyqZEvALa6SJHZvwf3xAS XRKh6yKELcDE/ZxWbVN5fP9+5/15ljaMHsxYxvKWrYkyZIy/pw0ZjRdMLqukyQa8NPHd UIpqdTZbhVbiKzLsNef5YSyso5VafhET1GTzu/AcevuYY/rXnhIXw6JC41tKInb9XYvc Zr65PmPxUWXdNzAdpZ6rK9tiXqlpud0IwxY5R6ahxnYdTI0s8b58j9g4dCS72Ai7ie80 GpQQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.252 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com Return-Path: Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com. [68.232.137.252]) by gmr-mx.google.com with ESMTPS id i11si331160wra.3.2020.08.24.03.59.31 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 24 Aug 2020 03:59:32 -0700 (PDT) Received-SPF: pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.252 as permitted sender) client-ip=68.232.137.252; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of vijaikumar_kanagarajan@mentor.com designates 68.232.137.252 as permitted sender) smtp.mailfrom=Vijaikumar_Kanagarajan@mentor.com IronPort-SDR: OKFmO5JR4o8SdJ7VTgC+S4TaRZCXwUsxZSvkfHZKBXWl/ve+SczK6TYbHRCvzQB27MKsW6SSaA zpFkpsFsxYze1HZ4s75ZYCz9tTzFV480PYReBS4LoZjfwyYXZZafEsxb7aM9t0TC0fKs7rFl/r JQBJtYLD6x9eMp7guu5s3XI1iYag4qA6/xLIZkWSfqmsAiaY7lSx9xkV8KP8U0yLE+JYt3fSWm iizIe5yEXs7b9rvggz+hYkhBVQA+W46nDnG/r8Q7JO3IJGQ1QjgkbdnOnnKkEcd1jFJ2jdqgxf HiI= X-IronPort-AV: E=Sophos;i="5.76,348,1592899200"; d="scan'208";a="52309711" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa4.mentor.iphmx.com with ESMTP; 24 Aug 2020 02:59:31 -0800 IronPort-SDR: EnWzviNc82sWkv3RBD9CNJrgAJlVZ6aduEOsnkl3aJpvYs2gfhugfNh6tbec2ItbxPvaG9Gr4O TNQyCyi82srD9dEybBOdhm6Ks9evGs6bQPl5I5L9PXMbJwhHaPPmz9KEt8RzqamqLJxPmXebVQ ZLUV+9aweQPCi57lDn6L4XBDyJw9NlgnJeOXymmxmYxzMwIOjH9i7t2+Qqi0DHO3ZoW5qllgNX S1Q5I1lQqar4OLWVYiQIQDIdO0k1HavUdotSo0y7e6CVzPRc66b1dAHNYnrCegyvV0wsZVAyLx gjY= From: Vijai Kumar K To: , Subject: [RFC PATCH 06/10] wic_fakeroot: Handle standalone pseudo invocations Date: Mon, 24 Aug 2020 16:29:01 +0530 Message-ID: <20200824105905.21110-2-Vijaikumar_Kanagarajan@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200824105905.21110-1-Vijaikumar_Kanagarajan@mentor.com> References: <20200824092750.19642-5-Vijaikumar_Kanagarajan@mentor.com> <20200824105905.21110-1-Vijaikumar_Kanagarajan@mentor.com> MIME-Version: 1.0 Content-Type: text/plain Return-Path: Vijaikumar_Kanagarajan@mentor.com X-ClientProxiedBy: svr-orw-mbx-08.mgc.mentorg.com (147.34.90.208) To svr-orw-mbx-01.mgc.mentorg.com (147.34.90.201) X-TUID: sVHOpt4svyxs 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