From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 6543937367387930624 X-Received: by 10.80.204.5 with SMTP id m5mr5201572edi.12.1523629149388; Fri, 13 Apr 2018 07:19:09 -0700 (PDT) X-BeenThere: isar-users@googlegroups.com Received: by 10.80.204.68 with SMTP id n4ls4409725edi.5.gmail; Fri, 13 Apr 2018 07:19:08 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+91XNxPTsTn0i+IugOnlahSfp4NBhKW+bm6qSVUDoCUqEp132eIp69pPvhVCV/EBviyNPZ X-Received: by 10.80.141.196 with SMTP id s4mr2367350edh.8.1523629148977; Fri, 13 Apr 2018 07:19:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523629148; cv=none; d=google.com; s=arc-20160816; b=irra1Gn0f3Bnjwu9KQJUrt9QBMKw245uRZ1IADtoM3uOmWUYor2F3bEMH6A5n0EoJv mdac5/YZOPqy0yRN4Wo1e4uWM50Gwli6va430oyRJvBR95lv1UA33BApLiuJBzDo5Y+l lrz2LobrumS9sDhz5wpEsH5JBGHApRj7ZMozPTLjL/iZUP8s+cfZmvYuE73H6g+y74KC 73+PrnPhGi/mOBqvTwUa3cM8rwTeel7m2nu+rwKv7gYokdW/bxDDzxFdy7NJjqBJ3Ny8 lWXMnQGJJQWbLhhx2GsI52VpDoDSG9Tvi5hq1LyjB3yn2rSxFVpw7NYgESNzfIxTYHYw 6/4g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=/Mg3HfZg0EdGilW+oKKxpTeJMO3ZEuJSQKqD0Zw7pJY=; b=UyLIyxQmPWOAewXA+Pi8C7BPD9t7o+le22x/5f9PDyxIVwVvJLQn7JcJl0LXhAt8SY qzEivWuS0NjjJTb006pphguj1ntQ6VOlLgPsq8SvKBRn+7dN70dX+L4u7YO4JCiEw8GM //TZGfY/TNnW0ahmuXGSdcWB/KYin8YvJU7CxipikzQCPoTZjptgWQR4G8GTcDBV+oqw 0+IpZLYs2lHvzwSO6VvTolTjHMUonqYjfS7Cs5ZPhkHyPMG/WmMCzCwJQ0CS/5VXLDjH uWg8a6KG1O1uHFcv/jhQzGvVUzhuyiBowr+YSUC2Ul0q2xlWO3ZQLOTwMQtEg04INmlR awQQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Return-Path: Received: from goliath.siemens.de (goliath.siemens.de. [192.35.17.28]) by gmr-mx.google.com with ESMTPS id 40si71934edr.2.2018.04.13.07.19.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 13 Apr 2018 07:19:08 -0700 (PDT) Received-SPF: pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 as permitted sender) client-ip=192.35.17.28; Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of henning.schild@siemens.com designates 192.35.17.28 as permitted sender) smtp.mailfrom=henning.schild@siemens.com Received: from mail1.siemens.de (mail1.siemens.de [139.23.33.14]) by goliath.siemens.de (8.15.2/8.15.2) with ESMTPS id w3DEJ8R6015894 (version=TLSv1.2 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 13 Apr 2018 16:19:08 +0200 Received: from md1pvb1c.ad001.siemens.net (md1pvb1c.ad001.siemens.net [139.25.68.40] (may be forged)) by mail1.siemens.de (8.15.2/8.15.2) with ESMTP id w3DEJ8Vu011006; Fri, 13 Apr 2018 16:19:08 +0200 From: Henning Schild To: isar-users@googlegroups.com Cc: Cedric Hombourger , Andreas Reichel , Henning Schild Subject: [PATCH v2 04/17] Revert "wic: Use sudo instead of pseudo" Date: Fri, 13 Apr 2018 16:18:53 +0200 Message-Id: <165ec037905a68576eb72dbe8e525323e02b2f0c.1523628814.git.henning.schild@siemens.com> X-Mailer: git-send-email 2.16.1 In-Reply-To: References: In-Reply-To: References: X-TUID: JFEOPyqVwrwQ This reverts commit bf873d3b089474d9061df4c1f0985abfac038ff6. Not required if you run wic as root or set FAKEROOTCMD. Signed-off-by: Henning Schild --- scripts/lib/wic/partition.py | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-) diff --git a/scripts/lib/wic/partition.py b/scripts/lib/wic/partition.py index 34130d8..20bc4a2 100644 --- a/scripts/lib/wic/partition.py +++ b/scripts/lib/wic/partition.py @@ -201,6 +201,17 @@ class Partition(): Currently handles ext2/3/4, btrfs and vfat. """ + p_prefix = os.environ.get("PSEUDO_PREFIX", "%s/usr" % native_sysroot) + p_localstatedir = os.environ.get("PSEUDO_LOCALSTATEDIR", + "%s/../pseudo" % rootfs_dir) + p_passwd = os.environ.get("PSEUDO_PASSWD", rootfs_dir) + p_nosymlinkexp = os.environ.get("PSEUDO_NOSYMLINKEXP", "1") + pseudo = "export PSEUDO_PREFIX=%s;" % p_prefix + pseudo += "export PSEUDO_LOCALSTATEDIR=%s;" % p_localstatedir + pseudo += "export PSEUDO_PASSWD=%s;" % p_passwd + pseudo += "export PSEUDO_NOSYMLINKEXP=%s;" % p_nosymlinkexp + pseudo += "%s " % get_bitbake_var("FAKEROOTCMD") + rootfs = "%s/rootfs_%s.%s.%s" % (cr_workdir, self.label, self.lineno, self.fstype) if os.path.isfile(rootfs): @@ -226,7 +237,7 @@ class Partition(): self.source_file = rootfs # get the rootfs size in the right units for kickstart (kB) - du_cmd = "sudo du -Lbks %s" % rootfs + du_cmd = "du -Lbks %s" % rootfs out = exec_cmd(du_cmd) self.size = int(out.split()[0]) @@ -234,7 +245,7 @@ class Partition(): """ Prepare content for an ext2/3/4 rootfs partition. """ - du_cmd = "sudo du -ks %s" % rootfs_dir + du_cmd = "du -ks %s" % rootfs_dir out = exec_cmd(du_cmd) actual_rootfs_size = int(out.split()[0]) @@ -249,7 +260,7 @@ class Partition(): if self.label: label_str = "-L %s" % self.label - mkfs_cmd = "sudo mkfs.%s -F %s %s %s -d %s" % \ + mkfs_cmd = "mkfs.%s -F %s %s %s -d %s" % \ (self.fstype, extra_imagecmd, rootfs, label_str, rootfs_dir) exec_cmd(mkfs_cmd) @@ -262,7 +273,7 @@ class Partition(): Currently handles ext2/3/4 and btrfs. """ - du_cmd = "sudo du -ks %s" % rootfs_dir + du_cmd = "du -ks %s" % rootfs_dir out = exec_cmd(du_cmd) actual_rootfs_size = int(out.split()[0]) @@ -275,7 +286,7 @@ class Partition(): if self.label: label_str = "-L %s" % self.label - mkfs_cmd = "sudo mkfs.%s -b %d -r %s %s %s" % \ + mkfs_cmd = "mkfs.%s -b %d -r %s %s %s" % \ (self.fstype, rootfs_size * 1024, rootfs_dir, label_str, rootfs) exec_cmd(mkfs_cmd) @@ -283,7 +294,7 @@ class Partition(): """ Prepare content for a msdos/vfat rootfs partition. """ - du_cmd = "sudo du -bks %s" % rootfs_dir + du_cmd = "du -bks %s" % rootfs_dir out = exec_cmd(du_cmd) blocks = int(out.split()[0]) @@ -331,7 +342,7 @@ class Partition(): if self.label: label_str = "-L %s" % self.label - mkfs_cmd = "sudo mkfs.%s -F %s %s %s" % \ + mkfs_cmd = "mkfs.%s -F %s %s %s" % \ (self.fstype, extra_imagecmd, label_str, rootfs) exec_cmd(mkfs_cmd) @@ -347,7 +358,7 @@ class Partition(): if self.label: label_str = "-L %s" % self.label - mkfs_cmd = "sudo mkfs.%s -b %d %s %s" % \ + mkfs_cmd = "mkfs.%s -b %d %s %s" % \ (self.fstype, self.size * 1024, label_str, rootfs) exec_cmd(mkfs_cmd) -- 2.16.1