Patchwork [2/3] recipes-extended: add master image for testing purposes

login
register
mail settings
Submitter Stanacar, StefanX
Date March 30, 2014, 2:47 p.m.
Message ID <869ad3f92f849ae98d82d9c2aed397d0d323822f.1396188987.git.stefanx.stanacar@intel.com>
Download mbox | patch
Permalink /patch/69647/
State Accepted
Commit 2764a40093644595cad9c095fb344912f9dc60fa
Headers show

Comments

Stanacar, StefanX - March 30, 2014, 2:47 p.m.
Add a custom recipe with custom initramfs and installers, that makes
it easy to deploy a master image for testing purposes.
We need a master image running on the target hardware, that should be a
known good build, with a set of utilities installed so that we use it
to deploy the images under test.

This core-image-testmaster recipe isn't a requirement per se, any image can
be used as long as the required conditions are met.
The test code assumes:
 - that the device has a second rootfs labeled as testrootfs
 - it has a properly configured bootloader entry (called test) for the second kernel and rootfs
 - the master image has a /etc/masterimage file so it can differentiate between master
and test images
 - the master image has tar, mount, bash (basically the normal linux utilities not the busybox
ones)

[YOCTO #5614]

Signed-off-by: Stefan Stanacar <stefanx.stanacar@intel.com>
---
 .../images/core-image-testmaster-initramfs.bb         | 19 +++++++++++++++++++
 meta/recipes-extended/images/core-image-testmaster.bb | 18 ++++++++++++++++++
 2 files changed, 37 insertions(+)
 create mode 100644 meta/recipes-extended/images/core-image-testmaster-initramfs.bb
 create mode 100644 meta/recipes-extended/images/core-image-testmaster.bb

Patch

diff --git a/meta/recipes-extended/images/core-image-testmaster-initramfs.bb b/meta/recipes-extended/images/core-image-testmaster-initramfs.bb
new file mode 100644
index 0000000..563260d
--- /dev/null
+++ b/meta/recipes-extended/images/core-image-testmaster-initramfs.bb
@@ -0,0 +1,19 @@ 
+DESCRIPTION = "Small image capable of booting a device with custom install scripts, \
+adding a second rootfs, used for testing."
+
+# use -testfs live-install scripts
+PACKAGE_INSTALL = "initramfs-live-boot initramfs-live-install-testfs initramfs-live-install-efi-testfs busybox udev base-passwd ${ROOTFS_BOOTSTRAP_INSTALL}"
+
+# Do not pollute the initrd image with rootfs features
+IMAGE_FEATURES = ""
+
+export IMAGE_BASENAME = "core-image-testmaster-initramfs"
+IMAGE_LINGUAS = ""
+
+LICENSE = "MIT"
+
+IMAGE_FSTYPES = "${INITRAMFS_FSTYPES}"
+inherit core-image
+
+IMAGE_ROOTFS_SIZE = "8192"
+BAD_RECOMMENDATIONS += "busybox-syslog"
diff --git a/meta/recipes-extended/images/core-image-testmaster.bb b/meta/recipes-extended/images/core-image-testmaster.bb
new file mode 100644
index 0000000..ac2fdbe
--- /dev/null
+++ b/meta/recipes-extended/images/core-image-testmaster.bb
@@ -0,0 +1,18 @@ 
+DESCRIPTION = "A master image to be deployed on a target useful for testing other images"
+
+IMAGE_FEATURES += "ssh-server-openssh package-management"
+
+inherit core-image
+
+# the deploy code requires bash and
+# normal linux utilities not busybox ones
+IMAGE_INSTALL += "\
+    bash coreutils util-linux tar gzip kmod \
+    python-modules python-misc \
+    e2fsprogs e2fsprogs-mke2fs parted \
+    "
+# we need a particular initramfs for live images
+# that pulls custom install scripts which take
+# care of partitioning for us
+INITRD_IMAGE = "core-image-testmaster-initramfs"
+