All of lore.kernel.org
 help / color / mirror / Atom feed
* How to reduce rootfs image size?
@ 2019-11-27 11:12 JH
  2019-11-27 11:28 ` [yocto] " Josef Holzmayr
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: JH @ 2019-11-27 11:12 UTC (permalink / raw)
  To: Yocto discussion list

Hi,

Does the Yocto rootfs image size is based on real contents included in
the image-rootfs.tar.gz?

When I build the image with very large size of applications and
libraries such as boost, I have my image-rootfs.tr.gz about 44 MB,
then I removed all large size of applications and libraries, I changed
IMAGE_ROOTFS_SIZE to a small size IMAGE_ROOTFS_SIZE = 20000, I thought
the image-rootfs.tar.gz should be reduced to a small size, but it is
still 43 MB I don't believe it is that big, which variable I should
use to reduce the image size?

Thank you.

Kind regards,

- jh

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [yocto] How to reduce rootfs image size?
  2019-11-27 11:12 How to reduce rootfs image size? JH
@ 2019-11-27 11:28 ` Josef Holzmayr
  2019-11-27 11:49 ` Fabien Lahoudere
  2019-11-27 16:19 ` Rudolf J Streif
  2 siblings, 0 replies; 5+ messages in thread
From: Josef Holzmayr @ 2019-11-27 11:28 UTC (permalink / raw)
  To: JH; +Cc: Yocto discussion list

On Wed, Nov 27, 2019 at 10:12:13PM +1100, JH wrote:
> Hi,
> 
> Does the Yocto rootfs image size is based on real contents included in
> the image-rootfs.tar.gz?
> 
> When I build the image with very large size of applications and
> libraries such as boost, I have my image-rootfs.tr.gz about 44 MB,
> then I removed all large size of applications and libraries, I changed
> IMAGE_ROOTFS_SIZE to a small size IMAGE_ROOTFS_SIZE = 20000, I thought
> the image-rootfs.tar.gz should be reduced to a small size, but it is
> still 43 MB I don't believe it is that big, which variable I should
> use to reduce the image size?

tar.gz ist a content-based format, not a filesystem based one. So if the
tarball is that big, then you certainly have all those things in your
rootfs. Look at the manifest files to find out that goes in there, and
use buildhistory to find out the sizes of the things.

Greetz

-- 
———————————————
Josef Holzmayr
Software Developer Embedded Systems

Tel: +49 8444 9204-48
Fax: +49 8444 9204-50

R-S-I Elektrotechnik GmbH & Co. KG
Woelkestrasse 11
D-85301 Schweitenkirchen
www.rsi-elektrotechnik.de
———————————————
Amtsgericht Ingolstadt – GmbH: HRB 191328 – KG: HRA 170393
Geschäftsführer: Dr.-Ing. Michael Sorg, Dipl.-Ing. Franz Sorg
Ust-IdNr: DE 128592548 

_____________________________________________________________
Amtsgericht Ingolstadt - GmbH: HRB 191328 - KG: HRA 170363
Geschäftsführer: Dr.-Ing. Michael Sorg, Dipl.-Ing. Franz Sorg
USt-IdNr.: DE 128592548


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [yocto] How to reduce rootfs image size?
  2019-11-27 11:12 How to reduce rootfs image size? JH
  2019-11-27 11:28 ` [yocto] " Josef Holzmayr
@ 2019-11-27 11:49 ` Fabien Lahoudere
  2019-11-27 16:19 ` Rudolf J Streif
  2 siblings, 0 replies; 5+ messages in thread
From: Fabien Lahoudere @ 2019-11-27 11:49 UTC (permalink / raw)
  To: JH, Yocto discussion list

Hi

If you want to reduce the size of your root filesystem, you have to
remove software you don't need. IMAGE_ROOTFS_SIZE has no effect on the
size of your image-rootfs.tar.gz. Putting a smaller size will just lead
to a rootfs that don't fit in the expected IMAGE_ROOTFS_SIZE.

Fabien

Le mercredi 27 novembre 2019 à 22:12 +1100, JH a écrit :
> Hi,
> 
> Does the Yocto rootfs image size is based on real contents included
> in
> the image-rootfs.tar.gz?
> 
> When I build the image with very large size of applications and
> libraries such as boost, I have my image-rootfs.tr.gz about 44 MB,
> then I removed all large size of applications and libraries, I
> changed
> IMAGE_ROOTFS_SIZE to a small size IMAGE_ROOTFS_SIZE = 20000, I
> thought
> the image-rootfs.tar.gz should be reduced to a small size, but it is
> still 43 MB I don't believe it is that big, which variable I should
> use to reduce the image size?
> 
> Thank you.
> 
> Kind regards,
> 
> - jh
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> 
> View/Reply Online (#47433): 
> https://lists.yoctoproject.org/g/yocto/message/47433
> Mute This Topic: https://lists.yoctoproject.org/mt/62495609/3618224
> Group Owner: yocto+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub  [fabien.la
> houdere@collabora.co.uk]
> -=-=-=-=-=-=-=-=-=-=-=-


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [yocto] How to reduce rootfs image size?
  2019-11-27 11:12 How to reduce rootfs image size? JH
  2019-11-27 11:28 ` [yocto] " Josef Holzmayr
  2019-11-27 11:49 ` Fabien Lahoudere
@ 2019-11-27 16:19 ` Rudolf J Streif
  2019-11-28 10:07   ` JH
  2 siblings, 1 reply; 5+ messages in thread
From: Rudolf J Streif @ 2019-11-27 16:19 UTC (permalink / raw)
  To: JH, Yocto discussion list


[-- Attachment #1.1.1: Type: text/plain, Size: 2928 bytes --]

Hi JH,

The image root file system size is based on the actual content of the
root file system. Besides ROOTFS_SIZE there are other variables that
control how the root file system is sized:

IMAGE_ROOTFS_SIZE: Defines the size in kilobytes of the created root
filesystem image. The
build system uses this value as a request or recommendation. The final
root filesystem
image size may be larger depending on the actual space required. The
default value is
65536.

IMAGE_ROOTFS_ALIGNMENT: Defines the alignment of the root filesystem
image in
kilobytes. If the final size of the root filesystem image is not a
multiple of this value, it is
rounded up to the nearest multiple of it. The default value is 1.

IMAGE_ROOTFS_EXTRA_SPACE: Adds extra free space to the root filesystem
image. The
variable specifies the value in kilobytes. For example, to add an
additional 4 GB of space, set
the variable to IMAGE_ROOTFS_EXTRA_SPACE = "4194304". The default value
is 0.

IMAGE_OVERHEAD_FACTOR: This variable specifies a multiplicator for the
root filesystem
image. The factor is applied after the actual space required by the root
filesystem has been
determined. The default value is 1.3.


Here is some pseudo code on how these variables are used to determine
the final root file system size:

_get_rootfs_size():
    ROOTFS_SIZE =`du -ks IMAGE_ROOTFS`
    BASE_SIZE = ROOTFS_SIZE * IMAGE_OVERHEAD_FACTOR

    if (BASE_SIZE < IMAGE_ROOTFS_SIZE):
        IMG_SIZE = IMAGE_ROOTFS_SIZE + IMAGE_ROOTFS_EXTRA_SPACE
    else:
        IMG_SIZE = BASE_SIZE + IMAGE_ROOTFS_EXTRA_SPACE

    IMG_SIZE = IMG_SIZE + IMAGE_ROOTFS_ALIGNMENT – 1
    IMG_SIZE = IMG_SIZE % IMAGE_ROOTFS_ALIGNMENT

    return IMG_SIZE


:rjs

On 11/27/19 3:12 AM, JH wrote:
> Hi,
>
> Does the Yocto rootfs image size is based on real contents included in
> the image-rootfs.tar.gz?
>
> When I build the image with very large size of applications and
> libraries such as boost, I have my image-rootfs.tr.gz about 44 MB,
> then I removed all large size of applications and libraries, I changed
> IMAGE_ROOTFS_SIZE to a small size IMAGE_ROOTFS_SIZE = 20000, I thought
> the image-rootfs.tar.gz should be reduced to a small size, but it is
> still 43 MB I don't believe it is that big, which variable I should
> use to reduce the image size?
>
> Thank you.
>
> Kind regards,
>
> - jh
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
>
> View/Reply Online (#47433): https://lists.yoctoproject.org/g/yocto/message/47433
> Mute This Topic: https://lists.yoctoproject.org/mt/62495609/3617932
> Group Owner: yocto+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub  [rudolf.streif@ibeeto.com]
> -=-=-=-=-=-=-=-=-=-=-=-

-- 
-----
Rudolf J Streif
CEO/CTO ibeeto
+1.855.442.3386 x700


[-- Attachment #1.1.2: Type: text/html, Size: 4299 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 499 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [yocto] How to reduce rootfs image size?
  2019-11-27 16:19 ` Rudolf J Streif
@ 2019-11-28 10:07   ` JH
  0 siblings, 0 replies; 5+ messages in thread
From: JH @ 2019-11-28 10:07 UTC (permalink / raw)
  To: Rudolf J Streif; +Cc: Yocto discussion list

Thanks Josef, Fabien and Rudolf, it's been great help to clarify it,
very appreciated.

On 11/28/19, Rudolf J Streif <rudolf.streif@ibeeto.com> wrote:
> Hi JH,
>
> The image root file system size is based on the actual content of the
> root file system. Besides ROOTFS_SIZE there are other variables that
> control how the root file system is sized:
>
> IMAGE_ROOTFS_SIZE: Defines the size in kilobytes of the created root
> filesystem image. The
> build system uses this value as a request or recommendation. The final
> root filesystem
> image size may be larger depending on the actual space required. The
> default value is
> 65536.
>
> IMAGE_ROOTFS_ALIGNMENT: Defines the alignment of the root filesystem
> image in
> kilobytes. If the final size of the root filesystem image is not a
> multiple of this value, it is
> rounded up to the nearest multiple of it. The default value is 1.
>
> IMAGE_ROOTFS_EXTRA_SPACE: Adds extra free space to the root filesystem
> image. The
> variable specifies the value in kilobytes. For example, to add an
> additional 4 GB of space, set
> the variable to IMAGE_ROOTFS_EXTRA_SPACE = "4194304". The default value
> is 0.
>
> IMAGE_OVERHEAD_FACTOR: This variable specifies a multiplicator for the
> root filesystem
> image. The factor is applied after the actual space required by the root
> filesystem has been
> determined. The default value is 1.3.
>
>
> Here is some pseudo code on how these variables are used to determine
> the final root file system size:
>
> _get_rootfs_size():
>     ROOTFS_SIZE =`du -ks IMAGE_ROOTFS`
>     BASE_SIZE = ROOTFS_SIZE * IMAGE_OVERHEAD_FACTOR
>
>     if (BASE_SIZE < IMAGE_ROOTFS_SIZE):
>         IMG_SIZE = IMAGE_ROOTFS_SIZE + IMAGE_ROOTFS_EXTRA_SPACE
>     else:
>         IMG_SIZE = BASE_SIZE + IMAGE_ROOTFS_EXTRA_SPACE
>
>     IMG_SIZE = IMG_SIZE + IMAGE_ROOTFS_ALIGNMENT – 1
>     IMG_SIZE = IMG_SIZE % IMAGE_ROOTFS_ALIGNMENT
>
>     return IMG_SIZE
>
>
> :rjs
>
> On 11/27/19 3:12 AM, JH wrote:
>> Hi,
>>
>> Does the Yocto rootfs image size is based on real contents included in
>> the image-rootfs.tar.gz?
>>
>> When I build the image with very large size of applications and
>> libraries such as boost, I have my image-rootfs.tr.gz about 44 MB,
>> then I removed all large size of applications and libraries, I changed
>> IMAGE_ROOTFS_SIZE to a small size IMAGE_ROOTFS_SIZE = 20000, I thought
>> the image-rootfs.tar.gz should be reduced to a small size, but it is
>> still 43 MB I don't believe it is that big, which variable I should
>> use to reduce the image size?
>>
>> Thank you.
>>
>> Kind regards,
>>
>> - jh
>>
>> -=-=-=-=-=-=-=-=-=-=-=-
>> Links: You receive all messages sent to this group.
>>
>> View/Reply Online (#47433):
>> https://lists.yoctoproject.org/g/yocto/message/47433
>> Mute This Topic: https://lists.yoctoproject.org/mt/62495609/3617932
>> Group Owner: yocto+owner@lists.yoctoproject.org
>> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub
>> [rudolf.streif@ibeeto.com]
>> -=-=-=-=-=-=-=-=-=-=-=-
>
> --
> -----
> Rudolf J Streif
> CEO/CTO ibeeto
> +1.855.442.3386 x700
>
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2019-11-28 10:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-27 11:12 How to reduce rootfs image size? JH
2019-11-27 11:28 ` [yocto] " Josef Holzmayr
2019-11-27 11:49 ` Fabien Lahoudere
2019-11-27 16:19 ` Rudolf J Streif
2019-11-28 10:07   ` JH

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.