From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6880180325712920576 X-Received: by 2002:a2e:9586:: with SMTP id w6mr234686ljh.78.1601916834393; 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-Google-Smtp-Source: ABdhPJw0y8nL6b+klh1nYiFRNcHfgnbIT/g5VvE4buXKETO38q8tOKzFyAn/xz15m14xv+nd4BAd 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 Return-Path: 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; 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: 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 Content-Type: text/plain Return-Path: Vijaikumar_Kanagarajan@mentor.com 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-TUID: AQ1sEacvpCQW 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.'): -- 2.17.1