summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorTom Zanussi <tom.zanussi@linux.intel.com>2013-10-22 09:24:05 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-12-12 17:00:01 +0000
commit34739daf7cedabfcaa6691c9309d571a17a7466f (patch)
tree484491a81e2cfb448f922de9b612b78cccf33be2 /scripts
parentf29fde153b36ad8ec3f7e8b1ef86008dcbecb9f8 (diff)
downloadpoky-34739daf7cedabfcaa6691c9309d571a17a7466f.tar.gz
wic: Update and generalize pseudo setup for rootfs generation
Remove unnecessary pseudo exports i.e. PSEUDO_DISABLED and move the setup to the top-level prepare_rootfs(). (From OE-Core master rev: 4bf11cd7d7301da664c098c8a0ae9c0294a6f423) (From OE-Core rev: 8d661f578276c70e1671edfc810aa4dad97de970) Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> Signed-off-by: Robert Yang <liezhi.yang@windriver.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/lib/mic/kickstart/custom_commands/partition.py28
1 files changed, 15 insertions, 13 deletions
diff --git a/scripts/lib/mic/kickstart/custom_commands/partition.py b/scripts/lib/mic/kickstart/custom_commands/partition.py
index 0eb0671356..4b11195160 100644
--- a/scripts/lib/mic/kickstart/custom_commands/partition.py
+++ b/scripts/lib/mic/kickstart/custom_commands/partition.py
@@ -204,25 +204,27 @@ class Wic_PartData(Mic_PartData):
204 204
205 Currently handles ext2/3/4 and btrfs. 205 Currently handles ext2/3/4 and btrfs.
206 """ 206 """
207 pseudo = "export PSEUDO_PREFIX=%s/usr;" % native_sysroot
208 pseudo += "export PSEUDO_LOCALSTATEDIR=%s/../pseudo;" % rootfs_dir
209 pseudo += "export PSEUDO_PASSWD=%s;" % rootfs_dir
210 pseudo += "export PSEUDO_NOSYMLINKEXP=1;"
211 pseudo += "%s/usr/bin/pseudo " % native_sysroot
212
207 if self.fstype.startswith("ext"): 213 if self.fstype.startswith("ext"):
208 return self.prepare_rootfs_ext(cr_workdir, oe_builddir, 214 return self.prepare_rootfs_ext(cr_workdir, oe_builddir,
209 rootfs_dir, native_sysroot) 215 rootfs_dir, native_sysroot,
216 pseudo)
210 elif self.fstype.startswith("btrfs"): 217 elif self.fstype.startswith("btrfs"):
211 return self.prepare_rootfs_btrfs(cr_workdir, oe_builddir, 218 return self.prepare_rootfs_btrfs(cr_workdir, oe_builddir,
212 rootfs_dir, native_sysroot) 219 rootfs_dir, native_sysroot,
220 pseudo)
213 221
214 def prepare_rootfs_ext(self, cr_workdir, oe_builddir, rootfs_dir, 222 def prepare_rootfs_ext(self, cr_workdir, oe_builddir, rootfs_dir,
215 native_sysroot): 223 native_sysroot, pseudo):
216 """ 224 """
217 Prepare content for an ext2/3/4 rootfs partition. 225 Prepare content for an ext2/3/4 rootfs partition.
218 """ 226 """
219 populate_script = "export PSEUDO_PREFIX=%s/usr;" % native_sysroot 227 populate_script = "%s/usr/bin/populate-extfs.sh" % native_sysroot
220 populate_script += "export PSEUDO_LOCALSTATEDIR=%s/../pseudo;" % rootfs_dir
221 populate_script += "export PSEUDO_PASSWD=%s;" % rootfs_dir
222 populate_script += "export PSEUDO_NOSYMLINKEXP=1;"
223 populate_script += "export PSEUDO_DISABLED=0;"
224 populate_script += "%s/usr/bin/pseudo %s/usr/bin/populate-extfs.sh" % \
225 (native_sysroot, native_sysroot)
226 228
227 image_extra_space = 10240 229 image_extra_space = 10240
228 230
@@ -245,7 +247,7 @@ class Wic_PartData(Mic_PartData):
245 rc, out = exec_native_cmd(mkfs_cmd, native_sysroot) 247 rc, out = exec_native_cmd(mkfs_cmd, native_sysroot)
246 248
247 populate_cmd = populate_script + " " + image_rootfs + " " + rootfs 249 populate_cmd = populate_script + " " + image_rootfs + " " + rootfs
248 rc, out = exec_native_cmd(populate_cmd, native_sysroot) 250 rc, out = exec_native_cmd(pseudo + populate_cmd, native_sysroot)
249 251
250 # get the rootfs size in the right units for kickstart (Mb) 252 # get the rootfs size in the right units for kickstart (Mb)
251 du_cmd = "du -Lbms %s" % rootfs 253 du_cmd = "du -Lbms %s" % rootfs
@@ -258,7 +260,7 @@ class Wic_PartData(Mic_PartData):
258 return 0 260 return 0
259 261
260 def prepare_rootfs_btrfs(self, cr_workdir, oe_builddir, rootfs_dir, 262 def prepare_rootfs_btrfs(self, cr_workdir, oe_builddir, rootfs_dir,
261 native_sysroot): 263 native_sysroot, pseudo):
262 """ 264 """
263 Prepare content for a btrfs rootfs partition. 265 Prepare content for a btrfs rootfs partition.
264 266
@@ -281,7 +283,7 @@ class Wic_PartData(Mic_PartData):
281 283
282 mkfs_cmd = "mkfs.%s -b %d -r %s %s" % \ 284 mkfs_cmd = "mkfs.%s -b %d -r %s %s" % \
283 (self.fstype, rootfs_size * 1024, image_rootfs, rootfs) 285 (self.fstype, rootfs_size * 1024, image_rootfs, rootfs)
284 rc, out = exec_native_cmd(mkfs_cmd, native_sysroot) 286 rc, out = exec_native_cmd(pseudo + mkfs_cmd, native_sysroot)
285 287
286 # get the rootfs size in the right units for kickstart (Mb) 288 # get the rootfs size in the right units for kickstart (Mb)
287 du_cmd = "du -Lbms %s" % rootfs 289 du_cmd = "du -Lbms %s" % rootfs