Bug 11163

Summary: Error "Rootfs is too small for BTRFS" when building image with IMAGE_FSTYPES=btrfs
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Jose Perez C <jose.perez.carranza>
Component: devtools / tool chainAssignee: Ed Bartosh <eduard.bartosh>
Status: VERIFIED FIXED QA Contact: oscar lopez arandas <oscarx.lopez.arandas>
Severity: normal    
Priority: Medium+ CC: meta.mr.watcher, meta.watcher
Version: 2.3   
Target Milestone: 2.3 M4   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)
Bug Depends on:    
Bug Blocks: 10745    
Attachments:
Description Flags
log.do_image_btrfs none

Description Jose Perez C 2017-03-15 14:51:01 UTC
Bitbake fails when trying to compile adding all the IMAGE_FSTYPES, Rootfs is too small for BTRFS (Rootfs Actual Size: 9740, BTRFS Minimum Size: 16384) 

Steps to reproduce
1. Edit conf/local.conf file, adding the following variable.
IMAGE_FSTYPES += "btrfs"

2. Compile a minimal image
$ bitbake core-image-minimal

Expected Result:
Should compile successfully

Actual Result:

The following error message is displayed:

ERROR: core-image-minimal-1.0-r0 do_image_btrfs: Rootfs is too small for BTRFS (Rootfs Actual Size: 9740, BTRFS Minimum Size: 16384)
ERROR: core-image-minimal-1.0-r0 do_image_btrfs: Function failed: do_image_btrfs (log file is located at /home/jgperezc/sandbox/poky-bugs/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/temp/log.do_image_btrfs.28944)
ERROR: Logfile of failure stored in: /home/jgperezc/sandbox/poky-bugs/build/tmp/work/qemux86-poky-linux/core-image-minimal/1.0-r0/temp/log.do_image_btrfs.28944
ERROR: Task (/home/jgperezc/sandbox/poky-bugs/meta/recipes-core/images/core-image-minimal.bb:do_image_btrfs) failed with exit code '1'
Comment 1 Ed Bartosh 2017-03-15 18:59:07 UTC
This error means that core-image-minimal rootfs is too small for BTRFS. Can you try if it works with bigger images like core-image-sato? 

Can you explain why do you need to create btrfs images for core-image-minimal? Did it work before?
Comment 2 Jose Perez C 2017-03-15 22:53:26 UTC
(In reply to comment #1)
> This error means that core-image-minimal rootfs is too small for BTRFS. Can
> you try if it works with bigger images like core-image-sato? 
Worked correctly on core-image-sato
> 
> Can you explain why do you need to create btrfs images for
> core-image-minimal? Did it work before?
This is part of a new test cased creation defined on Bug 10745, There is no documentation about not being supported for minimal. 

I think that if this is not supported for minimal should be advised since the beginning because currently many tasks are executed an completed successfully and the error is retrieved at the end.
Comment 3 Ed Bartosh 2017-03-16 10:04:31 UTC
The size of rootfs directory is known when rootfs directory is ready, i.e. when packages are built and installed into it. We can't know it at the beginning, I'm afraid.
Comment 4 Ed Bartosh 2017-03-17 11:50:22 UTC
Increased filesystem size for small rootfs directories:
http://lists.openembedded.org/pipermail/openembedded-core/2017-March/134276.html

This should make it possible to create btrfs image for core-image-minimal.

Please, review&test.
Comment 5 Jose Perez C 2017-03-17 13:53:09 UTC
(In reply to comment #4)
> Increased filesystem size for small rootfs directories:
> http://lists.openembedded.org/pipermail/openembedded-core/2017-March/134276.
> html
> 
> This should make it possible to create btrfs image for core-image-minimal.
> 
> Please, review&test.

Tested with the patch sent and is working correctly.
Comment 6 Ed Bartosh 2017-03-22 13:49:53 UTC
The fix has been merged to master.
Comment 7 oscar lopez arandas 2017-04-11 21:05:26 UTC
Created attachment 3714 [details]
log.do_image_btrfs
Comment 8 oscar lopez arandas 2017-04-11 21:05:58 UTC
 <bitbake> : <the IMAGE_FSTYPES> <Rootfs is too small for BTRFS>
 core-image-minimal-initramfs: core-image-minimal-1.0-r0 do_image_btrfs: Rootfs is too small for BTRFS.

Build Configuration:
BB_VERSION        = "1.33.3"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "ubuntu-16.04"
TARGET_SYS        = "x86_64-poky-linux"
MACHINE           = "intel-corei7-64"
DISTRO            = "poky"
DISTRO_VERSION    = "2.2+snapshot-20170411"
TUNE_FEATURES     = "m64 corei7"

Steps to reproduce
1. Edit conf/local.conf file, adding the following variable.
IMAGE_FSTYPES += "btrfs"

2. Compile a minimal image
$ bitbake core-image-minimal

commint
Expected Result:
Should compile successfully

Actual Result:
all succeeded.

commit: eff56e4f0d59b1d965a68e4f009b7f07717b7edd

log attachment.