Skip to contentSkip to conversation

Empty image: core-image-empty recipe

PATCH In review Alex Franco 2 participants 3 messages Sep 24, 2015 – Sep 28, 2015

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 Empty image: core-image-empty recipe

Added core-image-empty recipe in meta-selftest/recipes-test/images

[YOCTO #7664]

---
 meta-selftest/recipes-test/images/core-image-empty.bb | 7 +++++++
 1 file changed, 7 insertions(+)
 create mode 100644 meta-selftest/recipes-test/images/core-image-empty.bb
meta-selftest/recipes-test/images/core-image-empty.bb new file +7 -0
new file mode 100644
index 0000000..550567c
@@ -0,0 +1,7 @@
+SUMMARY = "An empty image."
+IMAGE_INSTALL = ""
+IMAGE_LINGUAS = ""
+PACKAGE_INSTALL = ""
+LICENSE = "MIT"
+
+inherit image
Signature · 1 line
2.5.3
#1 lore raw

PATCH v2 2/2 Empty image:rootfs.py:handle empty PACKAGE_INSTALL

rootfs.py: added a test in DpkgOpkgRootfs which skips the get package post installs step (get_pkgs_postinsts), when PACKAGE_INSTALL is empty.

[YOCTO #7664]

---
 meta/lib/oe/rootfs.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
meta/lib/oe/rootfs.py +5 -1
index 3b53fce..4e81263 100644
@@ -595,7 +595,11 @@ class DpkgOpkgRootfs(Rootfs):
 
         pkg_list = []
 
-        pkgs = self._get_pkgs_postinsts(status_file)
+        pkgs = None
+        if not self.d.getVar('PACKAGE_INSTALL', True).strip():
+            bb.note("Building empty image")
+        else:
+            pkgs = self._get_pkgs_postinsts(status_file)
         if pkgs:
             root = "__packagegroup_postinst__"
             pkgs[root] = pkgs.keys()
Signature · 1 line
2.5.3
#2 lore raw
In reply to Alex Franco

Hi Alex,

Quoted 17 lines · On Thursday 24 September 2015 10:23:15 Alex Franco wrote:

Added core-image-empty recipe in meta-selftest/recipes-test/images

[YOCTO #7664]

---
 meta-selftest/recipes-test/images/core-image-empty.bb | 7 +++++++
 1 file changed, 7 insertions(+)
 create mode 100644 meta-selftest/recipes-test/images/core-image-empty.bb
(quoted diff) +0 -0

b/meta-selftest/recipes-test/images/core-image-empty.bb new file mode 100644
index 0000000..550567c

meta-selftest/recipes-test/images/core-image-empty.bb line 7

Quoted 7 lines
meta-selftest/recipes-test/images/core-image-empty.bb new file +7 -0
@@ -0,0 +1,7 @@
+SUMMARY = "An empty image."
+IMAGE_INSTALL = ""
+IMAGE_LINGUAS = ""
+PACKAGE_INSTALL = ""
+LICENSE = "MIT"
+
+inherit image

Can we call this "test-empty-image.bb" instead?

Also it's not necessary to specify LICENSE, image.bbclass already sets LICENSE = "MIT" as the default.

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre