{"id":591,"date":"2014-06-23T08:00:42","date_gmt":"2014-06-23T06:00:42","guid":{"rendered":"http:\/\/www.thelins.se\/johan\/blog\/?p=591"},"modified":"2014-06-21T18:02:45","modified_gmt":"2014-06-21T16:02:45","slug":"yocto-part-ii-baseline-image-size","status":"publish","type":"post","link":"https:\/\/www.thelins.se\/johan\/blog\/2014\/06\/yocto-part-ii-baseline-image-size\/","title":{"rendered":"Yocto part II &#8211; baseline image size"},"content":{"rendered":"<p>In the <a href=\"https:\/\/www.thelins.se\/johan\/blog\/2014\/06\/yocto-part-i-baseline-boot-time\/\">first installment<\/a> of this series, we established a base line image and had a look at the initial boot performance. This time, we will establish a baseline for the image size. In an embedded system, these two factors often go hand in hand, as reading data from FLASH often consumes a considerable amount of time during boot.<\/p>\n<p>It is fairly easy to see how large the resulting root file system and kernel are, but we need more detail. To enable some statistics for the sizes of the various packages built, we first need to <a href=\"http:\/\/www.yoctoproject.org\/docs\/current\/ref-manual\/ref-manual.html#enabling-and-disabling-build-history\">enable build history<\/a> and rebuild our baseline image. Build history is enabled by adding the following lines to the local.conf file.<\/p>\n<p><code> INHERIT += \"buildhistory\"<br \/>\nBUILDHISTORY_COMMIT = \"1\"<br \/>\n<\/code><\/p>\n<p>This produces <a href=\"http:\/\/www.yoctoproject.org\/docs\/current\/ref-manual\/ref-manual.html#build-history-image-information\">a set of files with statistics<\/a> in buildhistory\/images\/qemux86\/eglibc\/core-image-minimal. The files-in-image.txt file, a detailed list of all the files of the system, along with their sizes, is listed. In the installed-package-sizes.txt, we get a list of responsible packages. The list for a baseline image can be seen below.<\/p>\n<p><code> 8641\u00a0KiB systemd<br \/>\n4487\u00a0KiB udev-hwdb<br \/>\n3042\u00a0KiB libc6<br \/>\n1290\u00a0KiB libx11-6<br \/>\n1221\u00a0KiB e2fsprogs-e2fsck<br \/>\n1153\u00a0KiB shadow<br \/>\n798\u00a0\u00a0KiB dbus-1<br \/>\n547\u00a0\u00a0KiB kmod<br \/>\n532\u00a0\u00a0KiB busybox<br \/>\n398\u00a0\u00a0KiB udev<br \/>\n350\u00a0\u00a0KiB libkmod2<br \/>\n299\u00a0\u00a0KiB libdbus-1-3<br \/>\n297\u00a0\u00a0KiB libext2fs2<br \/>\n261\u00a0\u00a0KiB libmount1<br \/>\n249\u00a0\u00a0KiB udev-utils<br \/>\n241\u00a0\u00a0KiB libblkid1<br \/>\n233\u00a0\u00a0KiB systemd-analyze<br \/>\n161\u00a0\u00a0KiB liblzma5<br \/>\n159\u00a0\u00a0KiB libexpat1<br \/>\n133\u00a0\u00a0KiB libxcb1<br \/>\n110\u00a0\u00a0KiB v86d<br \/>\n94\u00a0\u00a0\u00a0KiB util-linux-fsck<br \/>\n86\u00a0\u00a0\u00a0KiB libz1<br \/>\n83\u00a0\u00a0\u00a0KiB libgcc1<br \/>\n36\u00a0\u00a0\u00a0KiB systemd-binfmt<br \/>\n32\u00a0\u00a0\u00a0KiB kernel-module-uvesafb<br \/>\n31\u00a0\u00a0\u00a0KiB util-linux-mount<br \/>\n31\u00a0\u00a0\u00a0KiB libwrap0<br \/>\n30\u00a0\u00a0\u00a0KiB libacl1<br \/>\n29\u00a0\u00a0\u00a0KiB util-linux-agetty<br \/>\n27\u00a0\u00a0\u00a0KiB libe2p2<br \/>\n23\u00a0\u00a0\u00a0KiB netbase<br \/>\n20\u00a0\u00a0\u00a0KiB kernel-3.14.0-yocto-standard<br \/>\n19\u00a0\u00a0\u00a0KiB libxdmcp6<br \/>\n16\u00a0\u00a0\u00a0KiB libattr1<br \/>\n15\u00a0\u00a0\u00a0KiB libcap2<br \/>\n14\u00a0\u00a0\u00a0KiB libuuid1<br \/>\n11\u00a0\u00a0\u00a0KiB kernel-module-binfmt-misc<br \/>\n10\u00a0\u00a0\u00a0KiB libcom-err2<br \/>\n9\u00a0\u00a0\u00a0\u00a0KiB libxau6<br \/>\n5\u00a0\u00a0\u00a0\u00a0KiB update-rc.d<br \/>\n4\u00a0\u00a0\u00a0\u00a0KiB update-alternatives-opkg<br \/>\n4\u00a0\u00a0\u00a0\u00a0KiB base-files<br \/>\n3\u00a0\u00a0\u00a0\u00a0KiB busybox-udhcpc<br \/>\n2\u00a0\u00a0\u00a0\u00a0KiB shadow-securetty<br \/>\n2\u00a0\u00a0\u00a0\u00a0KiB run-postinsts<br \/>\n1\u00a0\u00a0\u00a0\u00a0KiB systemd-serialgetty<br \/>\n1\u00a0\u00a0\u00a0\u00a0KiB busybox-syslog<br \/>\n0\u00a0\u00a0\u00a0\u00a0KiB systemd-compat-units<br \/>\n0\u00a0\u00a0\u00a0\u00a0KiB packagegroup-core-boot<br \/>\n0\u00a0\u00a0\u00a0\u00a0KiB base-passwd<br \/>\n<\/code><\/p>\n<p>In addition to this, the bz kernel image is 6.2MiB.<\/p>\n<p>My approach to this system will be that of a gadget maker, so when trying to optimize the size of the system, I will try to use as much as possible of what I know of the target hardware to minimize the size. This ought to make it possible to reduce the kernel, the udev-hwdb and more. In addition to this, <a href=\"http:\/\/freedesktop.org\/wiki\/Software\/systemd\/Optimizations\/\">Lennart says that systemd is tweakable<\/a> when it comes to size. I&#8217;m looking forward to trying this.<\/p>\n<p>That is all for this installment. Next time we will have a look at setting up our own meta layer to start playing with, then we will try to create a truly minimalist and fast booting image.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the first installment of this series, we established a base line image and had a look at the initial boot performance. This time, we will establish a baseline for the image size. In an embedded system, these two factors often go hand in hand, as reading data from FLASH often consumes a considerable amount &hellip; <a href=\"https:\/\/www.thelins.se\/johan\/blog\/2014\/06\/yocto-part-ii-baseline-image-size\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Yocto part II &#8211; baseline image size<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9],"tags":[],"class_list":["post-591","post","type-post","status-publish","format-standard","hentry","category-yocto"],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/posts\/591","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/comments?post=591"}],"version-history":[{"count":6,"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/posts\/591\/revisions"}],"predecessor-version":[{"id":600,"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/posts\/591\/revisions\/600"}],"wp:attachment":[{"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/media?parent=591"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/categories?post=591"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.thelins.se\/johan\/blog\/wp-json\/wp\/v2\/tags?post=591"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}