diff options
author | Ed Bartosh <ed.bartosh@linux.intel.com> | 2015-06-27 12:40:13 +0300 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-07-02 23:08:37 +0100 |
commit | 73d0d23014e041f206cfaa3cd40c7ba9fc35d5d6 (patch) | |
tree | 1c36b18d6b686b5e61a6cdb53239dc66e716182c | |
parent | 1e307c3b400f407726d937cf474e55857a76a25e (diff) | |
download | poky-73d0d23014e041f206cfaa3cd40c7ba9fc35d5d6.tar.gz |
wic: Get rid of useless variable 'image_rootfs'
Removed useless variable 'image_rootfs' from 4 prepare_rootfs_* methods.
(From OE-Core rev: 4570412f70188d36312a5f9944d81df884302520)
Signed-off-by: Ed Bartosh <ed.bartosh@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r-- | scripts/lib/wic/kickstart/custom_commands/partition.py | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/scripts/lib/wic/kickstart/custom_commands/partition.py b/scripts/lib/wic/kickstart/custom_commands/partition.py index 489ebe359c..e3ae3ce765 100644 --- a/scripts/lib/wic/kickstart/custom_commands/partition.py +++ b/scripts/lib/wic/kickstart/custom_commands/partition.py | |||
@@ -246,10 +246,7 @@ class Wic_PartData(Mic_PartData): | |||
246 | """ | 246 | """ |
247 | Prepare content for an ext2/3/4 rootfs partition. | 247 | Prepare content for an ext2/3/4 rootfs partition. |
248 | """ | 248 | """ |
249 | 249 | du_cmd = "du -ks %s" % rootfs_dir | |
250 | image_rootfs = rootfs_dir | ||
251 | |||
252 | du_cmd = "du -ks %s" % image_rootfs | ||
253 | out = exec_cmd(du_cmd) | 250 | out = exec_cmd(du_cmd) |
254 | actual_rootfs_size = int(out.split()[0]) | 251 | actual_rootfs_size = int(out.split()[0]) |
255 | 252 | ||
@@ -274,7 +271,7 @@ class Wic_PartData(Mic_PartData): | |||
274 | label_str = "-L %s" % self.label | 271 | label_str = "-L %s" % self.label |
275 | 272 | ||
276 | mkfs_cmd = "mkfs.%s -F %s %s %s -d %s" % \ | 273 | mkfs_cmd = "mkfs.%s -F %s %s %s -d %s" % \ |
277 | (self.fstype, extra_imagecmd, rootfs, label_str, image_rootfs) | 274 | (self.fstype, extra_imagecmd, rootfs, label_str, rootfs_dir) |
278 | exec_native_cmd(pseudo + mkfs_cmd, native_sysroot) | 275 | exec_native_cmd(pseudo + mkfs_cmd, native_sysroot) |
279 | 276 | ||
280 | # get the rootfs size in the right units for kickstart (kB) | 277 | # get the rootfs size in the right units for kickstart (kB) |
@@ -294,9 +291,7 @@ class Wic_PartData(Mic_PartData): | |||
294 | 291 | ||
295 | Currently handles ext2/3/4 and btrfs. | 292 | Currently handles ext2/3/4 and btrfs. |
296 | """ | 293 | """ |
297 | image_rootfs = rootfs_dir | 294 | du_cmd = "du -ks %s" % rootfs_dir |
298 | |||
299 | du_cmd = "du -ks %s" % image_rootfs | ||
300 | out = exec_cmd(du_cmd) | 295 | out = exec_cmd(du_cmd) |
301 | actual_rootfs_size = int(out.split()[0]) | 296 | actual_rootfs_size = int(out.split()[0]) |
302 | 297 | ||
@@ -319,7 +314,7 @@ class Wic_PartData(Mic_PartData): | |||
319 | label_str = "-L %s" % self.label | 314 | label_str = "-L %s" % self.label |
320 | 315 | ||
321 | mkfs_cmd = "mkfs.%s -b %d -r %s %s %s" % \ | 316 | mkfs_cmd = "mkfs.%s -b %d -r %s %s %s" % \ |
322 | (self.fstype, rootfs_size * 1024, image_rootfs, label_str, rootfs) | 317 | (self.fstype, rootfs_size * 1024, rootfs_dir, label_str, rootfs) |
323 | exec_native_cmd(pseudo + mkfs_cmd, native_sysroot) | 318 | exec_native_cmd(pseudo + mkfs_cmd, native_sysroot) |
324 | 319 | ||
325 | # get the rootfs size in the right units for kickstart (kB) | 320 | # get the rootfs size in the right units for kickstart (kB) |
@@ -335,9 +330,7 @@ class Wic_PartData(Mic_PartData): | |||
335 | """ | 330 | """ |
336 | Prepare content for a vfat rootfs partition. | 331 | Prepare content for a vfat rootfs partition. |
337 | """ | 332 | """ |
338 | image_rootfs = rootfs_dir | 333 | du_cmd = "du -bks %s" % rootfs_dir |
339 | |||
340 | du_cmd = "du -bks %s" % image_rootfs | ||
341 | out = exec_cmd(du_cmd) | 334 | out = exec_cmd(du_cmd) |
342 | blocks = int(out.split()[0]) | 335 | blocks = int(out.split()[0]) |
343 | 336 | ||
@@ -365,7 +358,7 @@ class Wic_PartData(Mic_PartData): | |||
365 | dosfs_cmd = "mkdosfs %s -S 512 -C %s %d" % (label_str, rootfs, blocks) | 358 | dosfs_cmd = "mkdosfs %s -S 512 -C %s %d" % (label_str, rootfs, blocks) |
366 | exec_native_cmd(dosfs_cmd, native_sysroot) | 359 | exec_native_cmd(dosfs_cmd, native_sysroot) |
367 | 360 | ||
368 | mcopy_cmd = "mcopy -i %s -s %s/* ::/" % (rootfs, image_rootfs) | 361 | mcopy_cmd = "mcopy -i %s -s %s/* ::/" % (rootfs, rootfs_dir) |
369 | exec_native_cmd(mcopy_cmd, native_sysroot) | 362 | exec_native_cmd(mcopy_cmd, native_sysroot) |
370 | 363 | ||
371 | chmod_cmd = "chmod 644 %s" % rootfs | 364 | chmod_cmd = "chmod 644 %s" % rootfs |
@@ -384,10 +377,8 @@ class Wic_PartData(Mic_PartData): | |||
384 | """ | 377 | """ |
385 | Prepare content for a squashfs rootfs partition. | 378 | Prepare content for a squashfs rootfs partition. |
386 | """ | 379 | """ |
387 | image_rootfs = rootfs_dir | ||
388 | |||
389 | squashfs_cmd = "mksquashfs %s %s -noappend" % \ | 380 | squashfs_cmd = "mksquashfs %s %s -noappend" % \ |
390 | (image_rootfs, rootfs) | 381 | (rootfs_dir, rootfs) |
391 | exec_native_cmd(pseudo + squashfs_cmd, native_sysroot) | 382 | exec_native_cmd(pseudo + squashfs_cmd, native_sysroot) |
392 | 383 | ||
393 | # get the rootfs size in the right units for kickstart (kB) | 384 | # get the rootfs size in the right units for kickstart (kB) |