Skip to contentSkip to conversation

wic bugfix and improvements

PATCH New Ed Bartosh 1 participant 5 messages Sep 17, 2015

lore
Share & tools
lore

Ed Bartosh

author
#0 lore raw

v2 cover wic bugfix and improvements

Hi,

This patchset contains a changes suggested by QA team. Daniel, thank you for suggestions!

Changes in v2: added one more patch

The following changes since commit ea562de57590c966cd5a75fda8defecd397e6436:

qemu: Update to upstream patches (2015-09-14 20:46:40 +0100)

are available in the git repository at:

git://git.yoctoproject.org/poky-contrib ed/wic/misc
http://git.yoctoproject.org/cgit.cgi/poky-contrib/log/?h=ed/wic/misc

Ed Bartosh (4):
wic: add dependencies to wic-image-minimal recipe
wic: use ext4 in wic-image-minimal.wks
wic: fix partition size calculation
wic-image-minimal: add dependency to .wks

 meta-selftest/recipes-test/images/wic-image-minimal.bb  | 4 ++++
 meta-selftest/recipes-test/images/wic-image-minimal.wks | 6 +++---
 scripts/lib/wic/imager/direct.py                        | 3 +--
 3 files changed, 8 insertions(+), 5 deletions(-)

--
Ed

author
#2 lore raw

PATCH v2 2/4 wic: use ext4 in wic-image-minimal.wks

ext4 is used in canned wks files, so let's use it here too for the sake of consistency.

---
 meta-selftest/recipes-test/images/wic-image-minimal.wks | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
meta-selftest/recipes-test/images/wic-image-minimal.wks +3 -3
index 29cd8f2..8f9be09 100644
@@ -3,8 +3,8 @@
 # created from core-image-minimal and wic-image-minimal image recipes.
 
 part /boot --source bootimg-pcbios --ondisk sda --label boot --active --align 1024
-part / --source rootfs --ondisk sda --fstype=ext2 --label platform --align 1024
-part /core --source rootfs --rootfs-dir=core-image-minimal --ondisk sda --fstype=ext2 --label core --align 1024
-part /backup --source rootfs --rootfs-dir=wic-image-minimal --ondisk sda --fstype=ext2 --label backup --align 1024
+part / --source rootfs --ondisk sda --fstype=ext4 --label platform --align 1024
+part /core --source rootfs --rootfs-dir=core-image-minimal --ondisk sda --fstype=ext4 --label core --align 1024
+part /backup --source rootfs --rootfs-dir=wic-image-minimal --ondisk sda --fstype=ext4 --label backup --align 1024
 
 bootloader  --timeout=0  --append="rootwait console=tty0"
Signature · 1 line
2.1.4
author
#4 lore raw

PATCH v2 4/4 wic-image-minimal: add dependency to .wks

In reply to Ed Bartosh

Added dependency to wic-image-minimal.wks to the recipe. This makes bitbake to rebuild the image if .wks file changes.

---
 meta-selftest/recipes-test/images/wic-image-minimal.bb | 2 ++
 1 file changed, 2 insertions(+)
meta-selftest/recipes-test/images/wic-image-minimal.bb +2 -0
index 69236c4..89451bd 100644
@@ -1,5 +1,7 @@
 SUMMARY = "An example of partitioned image."
 
+SRC_URI = "file://${FILE_DIRNAME}/${BPN}.wks"
+
 IMAGE_INSTALL = "packagegroup-core-boot ${ROOTFS_PKGMANAGE_BOOTSTRAP}"
 
 IMAGE_FSTYPES = "wic.bz2"
Signature · 1 line
2.1.4
author
#1 lore raw

PATCH v2 1/4 wic: add dependencies to wic-image-minimal recipe

In reply to Ed Bartosh

Added "DEPENDS =" line to the recipe to ensure that all tools required for image creation are built.

---
 meta-selftest/recipes-test/images/wic-image-minimal.bb | 2 ++
 1 file changed, 2 insertions(+)
meta-selftest/recipes-test/images/wic-image-minimal.bb +2 -0
index 073c569..69236c4 100644
@@ -5,6 +5,8 @@ IMAGE_INSTALL = "packagegroup-core-boot ${ROOTFS_PKGMANAGE_BOOTSTRAP}"
 IMAGE_FSTYPES = "wic.bz2"
 RM_OLD_IMAGE = "1"
 
+DEPENDS = "syslinux syslinux-native parted-native dosfstools-native mtools-native"
+
 # core-image-minimal is referenced in .wks, so we need its rootfs
 # to be ready before our rootfs
 do_rootfs[depends] += "core-image-minimal:do_rootfs"
Signature · 1 line
2.1.4
author
#3 lore raw

PATCH v2 3/4 wic: fix partition size calculation

In reply to Ed Bartosh

It was wrongly assumed that part.size is meagured in Mb. In fact it's in Kb, so there is no need to convert bitbake variable ROOTFS_SIZE as it's also in Kb.

---
 scripts/lib/wic/imager/direct.py | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
scripts/lib/wic/imager/direct.py +1 -2
index 146a0d1..d5603fa 100644
@@ -241,8 +241,7 @@ class DirectImageCreator(BaseImageCreator):
                     # IMAGE_OVERHEAD_FACTOR and IMAGE_ROOTFS_EXTRA_SPACE
                     rsize_bb = get_bitbake_var('ROOTFS_SIZE', image_name)
                     if rsize_bb:
-                        # convert from Kb to Mb
-                        part.size = int(round(float(rsize_bb) / 1024.))
+                        part.size = int(round(float(rsize_bb)))
             # need to create the filesystems in order to get their
             # sizes before we can add them and do the layout.
             # Image.create() actually calls __format_disks() to create
Signature · 1 line
2.1.4