summaryrefslogtreecommitdiffstats
path: root/scripts/lib/wic/plugins
diff options
context:
space:
mode:
authorIoan-Adrian Ratiu <adrian.ratiu@ni.com>2018-06-28 16:58:33 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2018-06-29 11:07:45 +0100
commit870fbbd5c0b299a840566070a99f3dc25094c506 (patch)
tree5db854e6d3d605900ba3836b0a7583b6defeb85e /scripts/lib/wic/plugins
parentb591fb889b02ba82e6e35bb64b9fcb313f4bb5cb (diff)
downloadpoky-870fbbd5c0b299a840566070a99f3dc25094c506.tar.gz
wic: isoimage-isohybrid: debloat image of redundant rootfs
There's no reason to have that rootfs.img filesystem in the image: it's not used for anything because both the EFI and legacy boot paths use the /initrd which contains the same contents as the rootfs.img, only compressed. It was probably forgotten in there :) My iso went down from 224 to 94 mb. Tested using UEFI/legacy boots on CD-roms, usb dongle and qemu VM's. (From OE-Core rev: 4c784379524cb12807ef87a02ef1514ed45c1cc3) Signed-off-by: Ioan-Adrian Ratiu <adrian.ratiu@ni.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/lib/wic/plugins')
-rw-r--r--scripts/lib/wic/plugins/source/isoimage-isohybrid.py27
1 files changed, 1 insertions, 26 deletions
diff --git a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
index b119c9c2fd..0d4f50d1f7 100644
--- a/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
+++ b/scripts/lib/wic/plugins/source/isoimage-isohybrid.py
@@ -47,7 +47,7 @@ class IsoImagePlugin(SourcePlugin):
47 47
48 Example kickstart file: 48 Example kickstart file:
49 part /boot --source isoimage-isohybrid --sourceparams="loader=grub-efi, \\ 49 part /boot --source isoimage-isohybrid --sourceparams="loader=grub-efi, \\
50 image_name= IsoImage" --ondisk cd --label LIVECD --fstype=ext2 50 image_name= IsoImage" --ondisk cd --label LIVECD
51 bootloader --timeout=10 --append=" " 51 bootloader --timeout=10 --append=" "
52 52
53 In --sourceparams "loader" specifies the bootloader used for booting in EFI 53 In --sourceparams "loader" specifies the bootloader used for booting in EFI
@@ -253,33 +253,8 @@ class IsoImagePlugin(SourcePlugin):
253 raise WicError("Couldn't find IMAGE_ROOTFS, exiting.") 253 raise WicError("Couldn't find IMAGE_ROOTFS, exiting.")
254 254
255 part.rootfs_dir = rootfs_dir 255 part.rootfs_dir = rootfs_dir
256
257 # Prepare rootfs.img
258 deploy_dir = get_bitbake_var("DEPLOY_DIR_IMAGE") 256 deploy_dir = get_bitbake_var("DEPLOY_DIR_IMAGE")
259 img_iso_dir = get_bitbake_var("ISODIR") 257 img_iso_dir = get_bitbake_var("ISODIR")
260 rootfs_img = "%s/rootfs.img" % img_iso_dir
261 if not os.path.isfile(rootfs_img):
262 # check if rootfs.img is in deploydir
263 deploy_dir = get_bitbake_var("DEPLOY_DIR_IMAGE")
264 image_name = get_bitbake_var("IMAGE_LINK_NAME")
265 rootfs_img = "%s/%s.%s" \
266 % (deploy_dir, image_name, part.fstype)
267
268 if not os.path.isfile(rootfs_img):
269 # create image file with type specified by --fstype
270 # which contains rootfs
271 du_cmd = "du -bks %s" % rootfs_dir
272 out = exec_cmd(du_cmd)
273 part.size = int(out.split()[0])
274 part.extra_space = 0
275 part.overhead_factor = 1.2
276 part.prepare_rootfs(cr_workdir, oe_builddir, rootfs_dir, \
277 native_sysroot)
278 rootfs_img = part.source_file
279
280 install_cmd = "install -m 0644 %s %s/rootfs.img" \
281 % (rootfs_img, isodir)
282 exec_cmd(install_cmd)
283 258
284 # Remove the temporary file created by part.prepare_rootfs() 259 # Remove the temporary file created by part.prepare_rootfs()
285 if os.path.isfile(part.source_file): 260 if os.path.isfile(part.source_file):