Skip to contentSkip to conversation

image: use du --apparent-size when calculating rootfs size

PATCH In review Ross Burton 2 participants 5 messages Jan 11, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 image: use du --apparent-size when calculating rootfs size

We should pass --apparent-size to du when calculating how large the rootfs is as otherwise we get the actual disk usage, which if the files are compressed by the file system (such as ZFS) may be sufficiently smaller than the space required by the image that construction will fail.

---
 meta/classes/image.bbclass | 1 +
 1 file changed, 1 insertion(+)
meta/classes/image.bbclass +1 -0
index 4531aa2a57a..8e763e4d543 100644
@@ -534,6 +534,7 @@ def get_rootfs_size(d):
     initramfs_maxsize = d.getVar('INITRAMFS_MAXSIZE')
 
     output = subprocess.check_output(['du', '-ks',
+                                      '--apparent-size',
                                       d.getVar('IMAGE_ROOTFS')])
     size_kb = int(output.split()[0])
 
Signature · 1 line
2.11.0
#1 lore raw
Quoted 15 lines · Ross Burton

We should pass --apparent-size to du when calculating how large the rootfs is as otherwise we get the actual disk usage, which if the files are compressed by the file system (such as ZFS) may be sufficiently smaller than the space required by the image that construction will fail.

---
  meta/classes/image.bbclass | 1 +
  1 file changed, 1 insertion(+)
meta/classes/image.bbclass +0 -0
index 4531aa2a57a..8e763e4d543 100644

meta/classes/image.bbclass def get_rootfs_size(d): · line 539

Quoted 6 lines
meta/classes/image.bbclass +1 -0
@@ -534,6 +534,7 @@ def get_rootfs_size(d):
      initramfs_maxsize = d.getVar('INITRAMFS_MAXSIZE')
 
      output = subprocess.check_output(['du', '-ks',
+                                      '--apparent-size',
                                        d.getVar('IMAGE_ROOTFS')])
      size_kb = int(output.split()[0])

Exactly same patch from Maxin caused failures previously, no?

Alex

#2 lore raw
Quoted 15 lines · Alexander Kanavin
Quoted 13 lines · Ross Burton

We should pass --apparent-size to du when calculating how large the rootfs is as
otherwise we get the actual disk usage, which if the files are compressed by the
file system (such as ZFS) may be sufficiently smaller than the space required by
the image that construction will fail.

---
  meta/classes/image.bbclass | 1 +
  1 file changed, 1 insertion(+)
Quoted 14 lines

meta/classes/image.bbclass def get_rootfs_size(d): · line 539

Quoted 11 lines
meta/classes/image.bbclass +1 -0
index 4531aa2a57a..8e763e4d543 100644
@@ -534,6 +534,7 @@ def get_rootfs_size(d):
      initramfs_maxsize = d.getVar('INITRAMFS_MAXSIZE')
        output = subprocess.check_output(['du', '-ks',
+                                      '--apparent-size',
                                        d.getVar('IMAGE_ROOTFS')])
      size_kb = int(output.split()[0])
 

Exactly same patch from Maxin caused failures previously, no?

Hm, I knew I remembered seeing this before, and found my patches from 2015, but didn't see the ones from Maxin. I'll dig the archives again.

Ross

#3 lore raw
Quoted 6 lines · Ross

Exactly same patch from Maxin caused failures previously, no?

Quoted 1 line

Hm, I knew I remembered seeing this before, and found my patches from 2015, but didn't see the ones from Maxin. I'll dig the archives again

Found it, bad search. Lets see what happens on the AB this time...

Ross