From patchwork Mon Oct 5 07:53:03 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: 110 Return-Path: Delivered-To: ilbers.mnt@gmail.com Received: by 2002:a4a:eb04:0:0:0:0:0 with SMTP id f4csp3887394ooj; Mon, 5 Oct 2020 09:53:54 -0700 (PDT) X-Received: by 2002:a19:344:: with SMTP id 65mr110665lfd.393.1601916834742; Mon, 05 Oct 2020 09:53:54 -0700 (PDT) ARC-Seal: i=3; a=rsa-sha256; t=1601916834; cv=pass; d=google.com; s=arc-20160816; b=EaBjV/KCaW6m/dBsIlmzNAllPZkefXGSniJzArelsbCqaKkS3DPC1Q8QN673BhhDTm HxZosGGDDFd1uLRyj/7g1e0kNZyZUYGL9NRVe+E++cFNTOJ+LXT6DUnHnxLI5DTmD4UK UFx24/ZEeS3CiZIWsvq7CdiFRLCM7ltYXWKDhGJLWkwT5zYAI9NUEU0h7Ghg0je9mu2m 8WjDhUCP7E/oVRQ1oZBUBFiKtBE5HnQeuYTw2rwMQ43TVtXd5BKJuEReAJxQ0jCiKjxQ jUWwydTisTN2GMSZiEPPbG/gx2Xq1kleMVLLF5BcAcCpqJym6WjcPrIE3D/ohqpMQxjC GLgg== 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=nbTEyzT6p+Ltsiq766K7q97pcPwylJuZo/lCsfiSDcM=; b=ZjKwMK66biq9q74qidl8q8zVjIDv81Cky17NgxVB6qwmL6Glok1AwfnCNBlpK+HwAA RsYC0LeE8Dnmv6tyZdOgFIrwcZbmHp8gnb9FUkPzp5ASX+lP1VrVBpKatH5mg6AkZyWx mE3XxZ+hHA4l2u9Mi29x9q9lIHvXOlfuta34mZQI+KnFDerk9BFm5Dp64bGhOUARas9E j8AturnWh0O40NjGuA5ZvBa0pRtQdMomKAojxiyfINm4/0M4jlft/ps44XzkHJGn+Nag 4hc0Z1rP39YjACt8vD/E5ZTgs1e0SIeiq20yynTvRLdid+tSJDjwkHW9TGYALWfKbs8K J9nA== ARC-Authentication-Results: i=3; mx.google.com; dkim=pass header.i=@googlegroups.com header.s=20161025 header.b=Y7ZolN9J; arc=pass (i=2 spf=pass spfdomain=mentor.com); spf=pass (google.com: domain of isar-users+bncbcwp7lf37ukrbiu75x5qkgqes7mim3y@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCWP7LF37UKRBIU75X5QKGQES7MIM3Y@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 2sor113069ljq.56.2020.10.05.09.53.54 (Google Transport Security); Mon, 05 Oct 2020 09:53:54 -0700 (PDT) Received-SPF: pass (google.com: domain of isar-users+bncbcwp7lf37ukrbiu75x5qkgqes7mim3y@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=Y7ZolN9J; arc=pass (i=2 spf=pass spfdomain=mentor.com); spf=pass (google.com: domain of isar-users+bncbcwp7lf37ukrbiu75x5qkgqes7mim3y@googlegroups.com designates 209.85.220.55 as permitted sender) smtp.mailfrom=isar-users+bncBCWP7LF37UKRBIU75X5QKGQES7MIM3Y@googlegroups.com ARC-Seal: i=2; a=rsa-sha256; t=1601916834; cv=pass; d=google.com; s=arc-20160816; b=qevInCvJvpixRZ3jROmcxSgwbH7PPt4UkJpRF3C/O63WNjwPjSFoJdFv0Dw6t9smqc JoylMin4uwKEEbhgPAanhteMIei8QBIunXbKCC30eQJqJBw95d+t8dEuuAsWQe1Z25AQ XE1m8qAnqwWjkqHL/l3+FRE2vfIu0vg9cSzGS68EBOeyEHKO9l0N9HzXckoauW+cHaRS GEU3vqTxD0Vlp36b3pZ9XFoId74ropBLe5lo3qUZ4YkawGLFacZ75IUlIT8AnwNpSkFR nV2A9JQ3tZ4s5LLeGb6P2S5GAkYjupLczxg5oAQ53PH8Fq7YLB0znBjWi2fH8WslkQ3p cIkw== 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=nbTEyzT6p+Ltsiq766K7q97pcPwylJuZo/lCsfiSDcM=; b=fj4tyaV7D0oQkuT/CS4MeXByoUNLXUbXoCVEOrT+tLIcrmUatPMOSpN1yg2YUrv/S7 /S5hShUIa8BaEy4XKRCGVRZKHbUKPyh3FPYqCVn2ttB25hBzHGCj0zXYYqIYG8/gWjkb lpixFA22SxxWBRLJxt/4Hk86wGfph5Excnm3Qiy0UeJnhuT9y9D9gmuRlEMNl+6nXqkR jcUkGr30twA/qyiK2TmL+RNR+lOzTd2LJQwasOcPMAAM2aKCCpApdlTEcHWlMJR/1JeG A/HqFcfiyCvm6ynZzS1+vRocI1SshOGp1bF3XxMBE3z5tqqS7TZDMR3cLf6Sf0dKNXnr LokA== ARC-Authentication-Results: i=2; 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 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=nbTEyzT6p+Ltsiq766K7q97pcPwylJuZo/lCsfiSDcM=; b=Y7ZolN9JZJWhHkw7wVPp9yJIBROBJgggpvKZS/W6ytfNewYNHJ3akBrfm8e49xBI3W XfL5PBBYFvQeUYAm0h7D5rUHZ5ZVXEpSp/ldpco9mcdjbEdYOGaDB7A6o0rI7B1BwNft bbqrFQI0aTDDhQVcI9mqZN/1fXuiq5TihuGNsNbrRF75fHjYoyCghmFCPX1n7Iq0OTo0 0MMOi1MIUs1jW5SaZ0oVsTigdstX+vOF/5AaDe2PiQ8Gz7HFzTadumm1cTj5oufX7rTT ls5FnCDIrBT4dthLDC+YEYSVtJNup6DqvDZSyyyNSukVZlwLWiIjht/kQF+w+KgqOy6h iNAg== 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=nbTEyzT6p+Ltsiq766K7q97pcPwylJuZo/lCsfiSDcM=; b=NopRVm/YHBVg8Y1jV0MRxH44X/cHu3jUDInrmN2D19GDJYgvCTMwS0D2cgEq01Kb54 NIPL1AUV1WMD++cb3QeH7fEFJHjrnXScTLpuh/6B2/ybKmokZClZwhrhHwbNLurPz72a OcIF56jq8bHmAAfwXABkoGx1Esg4ZSBLg7Am2e179dOwk9nwtYcCaWyDVF5mrmoojoL/ SWjm4o2JRC+EV6C3KMXVWW8cXRFezrIJMpFl3i48+huvqz300X+GV3m7a3zH5r3brudF Ji0Sj3/nAoW+8rdDCSQPLRxrzvwZgdSgr3sIdKue0YznhLkxydZ+rGiQbyk5VtKU8xPB OPHg== Sender: isar-users@googlegroups.com X-Gm-Message-State: AOAM531/MfzDr9DSdPTM4ndLJEhE21QNHc+0CCQhP1Ja9EMzNKQUQOHs ILRsCVwFa8CQDQWg1zLq5zQ= X-Google-Smtp-Source: ABdhPJyBY34RsJY8SGrpJnMBnqcqjfpTrtBwczKC02L6xZUlEqqlxXzrhRt6DME9qgMClzG58dCIjw== X-Received: by 2002:a2e:2ac3:: with SMTP id q186mr202736ljq.419.1601916834315; Mon, 05 Oct 2020 09:53:54 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a19:c7c8:: with SMTP id x191ls508025lff.0.gmail; Mon, 05 Oct 2020 09:53:53 -0700 (PDT) X-Received: by 2002:ac2:51a8:: with SMTP id f8mr138571lfk.472.1601916833316; Mon, 05 Oct 2020 09:53:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601916833; cv=none; d=google.com; s=arc-20160816; b=Ld50A6vulCjIW+2N6woYhruFDg2Mzbw9yFp9hWUtkH9AqEhXK2ZT4wVe9/s9IjJsJ5 XMwdZwKEUtZb+Mjn05zpXevP8jklRwlv2KUdePyqrc0551ZcWwqvSN1EbTjMPimukG4p HxtCO6yzewBTyowXx6B8bA4+ztp+686htdazQHKGHvRHbBu0LOVlbao47WJ+sIJ902yv jS/voSSZM55rTg4ltju+fxq0j7N//DaO6XfXX/HZgELYL1hR5/k1M5l1YfFiOfDhUrsb BrlmI2lbwRcjOmlA+77PamaPIakEcpRI9W3rToAFokvYi5pHXDDs5hiB8EM9du1mjRkF htaw== 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=eH9tGc5oZ1KtUoHNhnAgqd0mkRTiX3VsJoklWigTvSM=; b=jnIrsj34UFwO7DuXsY+rWroT1z3k5P582x1uj9qW+VnONAPB4LYV9+POsrMRNMDlnJ 2htHB8E3mBiQPqRKGzDQuyHWlAlExRsFxgum5heF6PxO08SyI7z9iOLUl6ExtEzHHTsY PjtecHVoQbRFDhsmuAarCQjGo05aLI/tOtl00B/T+UaF9vfCaUxMqL7QiVpOWd5o9w7U RPQMluMj4/L1DFQOHsPxRK/t1eGUExjZXxHT9kSUfSP33e6BW6OAdNhGn9MICE+gf2AM FS3G1D4lbrW69hdJ954rOHf3NM8i2wBDe6wy5cyBx7NlI2Ps2DkX6m7G03/UhPAhvIZQ 6B3Q== 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 Received: from esa4.mentor.iphmx.com (esa4.mentor.iphmx.com. [68.232.137.252]) by gmr-mx.google.com with ESMTPS id j75si16955lfj.5.2020.10.05.09.53.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 05 Oct 2020 09:53:53 -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; IronPort-SDR: R09LM+UGAhXd6dcIKQHOM0Suxn0TcFHARKE3tei5cmU/6R5JXIzZ18ExWYgFvGECnD47MYxM7O 2oouQCspiaF4ZsKuBcZhkZWIluI1m326LCW/gcGYuXO3zOfGObkAQwUF6qCDgLzHXMOJAR+iFn l2rJ9gPJfq38grbXJnvyqdgVOhrOWbf4ivrqadY/AIA/j4oSCGrua+SBttyrrLmcb1XbLe8gRY ShX+T/MbwiaS0qqz0P6DWlLAGFV8RGEloShvbSpziO1toYgAWrl4Le/l4tDdRbANxAgH4hQpLs 2aU= X-IronPort-AV: E=Sophos;i="5.77,340,1596528000"; d="scan'208";a="53722787" Received: from orw-gwy-01-in.mentorg.com ([192.94.38.165]) by esa4.mentor.iphmx.com with ESMTP; 05 Oct 2020 08:53:52 -0800 IronPort-SDR: O5RsHf+ANwQnWwG/0VPQXArs6B1Q8Q4FxAlL+c0QXbRfpKJPftNQIDNeefMu+gxEk6fBC2iaQ2 dV9w6Yu4O9yA1uTWKG1cPYUqsK0cZtaNsJulQp66pElw+uzMcj84X5VCy2TVW2u19tCAwsscSI HEbNXvYZzJSqkVXsVPFjjOkaEWOPiRu8zO27kmUluW+4irxGoTAX+DA92m2OFNsxyXm6dddENw Sx4jL+dPOSJjQdLbJm6dAu8WtK/DSME2SE4g+Qm0VH4jGUR5pzAX78ZiRZQxUdQ2WGvWx+hufh GGE= From: Vijai Kumar K To: , CC: Vijai Kumar K Subject: [PATCH v5 4/8] wic_fakeroot: Handle standalone pseudo invocations Date: Mon, 5 Oct 2020 22:23:03 +0530 Message-ID: <20201005165307.14668-5-Vijaikumar_Kanagarajan@mentor.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20201005165307.14668-1-Vijaikumar_Kanagarajan@mentor.com> References: <20201005165307.14668-1-Vijaikumar_Kanagarajan@mentor.com> MIME-Version: 1.0 X-ClientProxiedBy: SVR-ORW-MBX-05.mgc.mentorg.com (147.34.90.205) 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.252 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?1679731546954762229?= X-GMAIL-MSGID: =?utf-8?q?1679731546954762229?= 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 29956e5..33ab53e 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.'):