Bug 4109

Summary: qemu image free space too small
Product: [Runtime] General Runtime Reporter: Ning Zhang <ning.zhang>
Component: General RuntimeAssignee: Chen Qi <Qi.Chen>
Status: RESOLVED NOTABUG QA Contact:
Severity: normal    
Priority: Medium+ CC: hongxu.jia, kai.kang, liezhi.yang, Qi.Chen, richard.purdie, sen.zhang, sgw, yi.zhao
Version: 1.4   
Target Milestone: 1.4 M6   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Ning Zhang 2013-03-26 08:34:14 UTC
Image location: http://autobuilder.yoctoproject.org/pub/nightly/20130321-2/

Branch: poky/master
Git rev: 9ffee9add2d0380f4025e7a678a166f25a7d659e

Test steps:
1. start a qemumips-sato, execute df -h, it has 91.5M free space.
2. run smart test, it should be pass. The smart downloads repodata_filelists.xml, repodata_filelists.xml and other files, these files need around 90M space.
3. start the qemumips-sato again, execute df -h, it has 0 free space.
4. Do other tests, many of them will failed because no free space lift.

Same issue happend on qemuppc-sato.

So I suggest to increase the qemu free space.

=========test log===============
start a qemumips-sato, execute df -h, it has 91.5M free space.

root@qemumips:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root               373.9M    263.4M     91.5M  74% /
devtmpfs                 58.4M      4.0K     58.4M   0% /dev
tmpfs                    40.0K         0     40.0K   0% /mnt/.psplash
tmpfs                    58.6M    184.0K     58.4M   0% /var/volatile
tmpfs                    58.6M         0     58.6M   0% /media/ram

after run smart test, it will use 87.7M space.

root@qemumips:/var/lib/smart# du -sh
87.6M	.

root@qemumips:/var/lib/smart/channels# ls -l
-rw-r--r--    1 root     root      42420977 Mar 26 07:05 myrpmmd%%http:__192.168.7.1_rpmrepo_qemumips_repodata_filelists.xml
-rw-r--r--    1 root     root       3772550 Mar 26 01:49 myrpmmd%%http:__192.168.7.1_rpmrepo_qemumips_repodata_filelists.xml.gz
-rw-r--r--    1 root     root      29450004 Mar 26 07:05 myrpmmd%%http:__192.168.7.1_rpmrepo_qemumips_repodata_primary.xml
-rw-r--r--    1 root     root       4059596 Mar 26 01:49 myrpmmd%%http:__192.168.7.1_rpmrepo_qemumips_repodata_primary.xml.gz
-rw-r--r--    1 root     root           951 Mar 26 01:49 myrpmmd%%http:__192.168.7.1_rpmrepo_qemumips_repodata_repomd.xml

After run smart test, execute df -h, it has 0 free space.

root@qemumips:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root               373.9M    373.9M         0 100% /
devtmpfs                 58.4M      4.0K     58.4M   0% /dev
tmpfs                    40.0K         0     40.0K   0% /mnt/.psplash
tmpfs                    58.6M    176.0K     58.4M   0% /var/volatile
tmpfs                    58.6M         0     58.6M   0% /media/ram
Comment 1 Chen Qi 2013-03-29 09:36:36 UTC
The image size is determined by the initial IMAGE_ROOTFS size and the IMAGE_OVERHEAD_FACTOR which defaults to 1.3.

meta/conf/bitbake.conf:IMAGE_OVERHEAD_FACTOR ?= "1.3"

Two solutions to solve this problem.

1. Resize the ext3 file locally

For example, if we want to add 100M to core-image-sato.ext3 image, we could use the following commands.

dd if=/dev/zero of=core-image-sato.ext3 bs=1M count=100 oflag=append conv=notrunc
e2fsck -f core-image-sato.ext3
resize2fs core-image-sato.ext3

2. override IMAGE_OVERHEAD_FACTOR in core-image-sato.bb file
IMAGE_OVERHEAD_FACTOR = "2.0"

I'll send out a patch using solution 2.
This problem will obviously occur to all sato images and block automatic testing, so these's enough reason to do so.

Any comment or suggestion is welcome.

//Chen Qi
Comment 2 Saul Wold 2013-04-03 17:58:13 UTC
I understand what you are trying to do here, do the tests clean-up after they run?

I am a little hesitant to add so much additional space, we have 2 conflicting goals with the size of the image. 

1) Show a compact example with graphical interface (not bloat-ware or full desktop).  

2) Use it for automated testing with enough space for running the tests.
Comment 3 Yi Zhao 2013-04-17 02:23:40 UTC
Now We use a small smart repository. Now the index file reduce to a small size. The test can pass.