Live Image Type - Please Review
cover Live Image Type - Please Review
This patch set removes the -directdisk and -live recipes in favor of having a "live" image part of IMAGE_FSTYPES. This is a first pass and is not 100% (currently missing the correct incantion to create the initrd file, it creates the initramfs.ext3 but missing a step).
Thanks
Sau!
The following changes since commit f10a3457cdfbb4a94978da998d178d4254632fa7:
Move architecture specific TARGET_OS mangling into tune files (2011-07-25 14:19:54 +0100)
are available in the git repository at:
git://git.openembedded.org/openembedded-core-contrib sgw/live
http://cgit.openembedded.org/cgit.cgi/openembedded-core-contrib/log/?h=sgw/live
Saul Wold (3):
classes/image*: Revamp creation of live images
Remove -live.bb recipes
Remove -directdisk.bb recipes
meta-rt/images/core-image-minimal-rt-directdisk.bb | 15 --------------
.../{bootimg.bbclass => image-live.bbclass} | 11 ++++++++++
meta/classes/image.bbclass | 3 ++
meta/classes/image_types.bbclass | 20 +++++++++++++++++-
meta/recipes-core/images/core-image-directdisk.inc | 11 ----------
meta/recipes-core/images/core-image-live.inc | 21 --------------------
.../images/core-image-minimal-directdisk.bb | 11 ----------
.../recipes-core/images/core-image-minimal-live.bb | 11 ----------
.../recipes-extended/images/core-image-lsb-live.bb | 11 ----------
.../images/core-image-lsb-sdk-live.bb | 11 ----------
.../images/core-image-sato-directdisk.bb | 9 --------
meta/recipes-sato/images/core-image-sato-live.bb | 11 ----------
.../images/core-image-sato-sdk-directdisk.bb | 9 --------
.../images/core-image-sato-sdk-live.bb | 11 ----------
14 files changed, 32 insertions(+), 133 deletions(-)
delete mode 100644 meta-rt/images/core-image-minimal-rt-directdisk.bb
create mode 100644 meta/classes/image-empty.bbclass
rename meta/classes/{bootimg.bbclass => image-live.bbclass} (91%)
delete mode 100644 meta/recipes-core/images/core-image-directdisk.inc
delete mode 100644 meta/recipes-core/images/core-image-live.inc
delete mode 100644 meta/recipes-core/images/core-image-minimal-directdisk.bb
delete mode 100644 meta/recipes-core/images/core-image-minimal-live.bb
delete mode 100644 meta/recipes-extended/images/core-image-lsb-live.bb
delete mode 100644 meta/recipes-extended/images/core-image-lsb-sdk-live.bb
delete mode 100644 meta/recipes-sato/images/core-image-sato-directdisk.bb
delete mode 100644 meta/recipes-sato/images/core-image-sato-live.bb
delete mode 100644 meta/recipes-sato/images/core-image-sato-sdk-directdisk.bb
delete mode 100644 meta/recipes-sato/images/core-image-sato-sdk-live.bbSignature · 1 line
1.7.3.4
PATCH 1/3 classes/image*: Revamp creation of live images
This creates a live image as an IMAGE_FSTYPES, thus removing the need to have additional -live.bb recipes. To create a live image one just needs to add live to the IMAGE_FSTYPES list
---
.../{bootimg.bbclass => image-live.bbclass} | 11 +++++++++++
meta/classes/image.bbclass | 3 +++
meta/classes/image_types.bbclass | 20 ++++++++++++++++++--
3 files changed, 32 insertions(+), 2 deletions(-)
create mode 100644 meta/classes/image-empty.bbclass
rename meta/classes/{bootimg.bbclass => image-live.bbclass} (91%)meta/classes/image-empty.bbclass new file +0 -0
meta/classes/image-live.bbclass renamed from meta/classes/bootimg.bbclass +11 -0
@@ -25,6 +25,17 @@ # ${APPEND} - an override list of append strings for each label # ${SYSLINUX_OPTS} - additional options to add to the syslinux file ';' delimited +AUTO_SYSLINUXCFG = "1" +INITRD = "${DEPLOY_DIR_IMAGE}/core-image-minimal-initramfs-${MACHINE}.cpio.gz" +APPEND += "root=/dev/ram0 " +TIMEOUT = "10" +LABELS += "boot install" + +ROOTFS = "${DEPLOY_DIR_IMAGE}/${IMAGE_BASENAME}-${MACHINE}.ext3" + +do_bootimg[depends] += "core-image-minimal-initramfs:do_rootfs" +do_bootimg[depends] += "${IMAGE_BASENAME}:do_rootfs" + do_bootimg[depends] += "dosfstools-native:do_populate_sysroot \ syslinux:do_populate_sysroot \ syslinux-native:do_populate_sysroot \
meta/classes/image.bbclass +3 -0
@@ -29,6 +29,9 @@ LDCONFIGDEPEND_libc-uclibc = "" do_rootfs[depends] += "makedevs-native:do_populate_sysroot virtual/fakeroot-native:do_populate_sysroot ${LDCONFIGDEPEND}" do_rootfs[depends] += "virtual/update-alternatives-native:do_populate_sysroot update-rc.d-native:do_populate_sysroot" +IMAGE_TYPE = ${@base_contains("IMAGE_FSTYPES", "live", "live", "empty", d)} +inherit image-${IMAGE_TYPE} + python () { deps = bb.data.getVarFlag('do_rootfs', 'depends', d) or "" for type in (bb.data.getVar('IMAGE_FSTYPES', d, True) or "").split():
meta/classes/image_types.bbclass +18 -2
@@ -1,7 +1,23 @@ + def get_imagecmds(d): cmds = "\n" old_overrides = bb.data.getVar('OVERRIDES', d, 0) - for type in bb.data.getVar('IMAGE_FSTYPES', d, True).split(): + + types = bb.data.getVar('IMAGE_FSTYPES', d, True).split() + try: + live_pos = types.index("live") + try: + ext3_pos = types.index("ext3") + except ValueError: + types.insert(live_pos, "ext3") + else: + if ext3_pos > live_pos: + types.pop(live_pos) + #types.append("live") + except ValueError: + pass + + for type in types: localdata = bb.data.createCopy(d) localdata.setVar('OVERRIDES', '%s:%s' % (type, old_overrides)) bb.data.update_data(localdata)
@@ -103,4 +119,4 @@ IMAGE_DEPENDS_ubi = "mtd-utils-native" IMAGE_DEPENDS_ubifs = "mtd-utils-native" # This variable is available to request which values are suitable for IMAGE_FSTYPES -IMAGE_TYPES = "jffs2 cramfs ext2 ext2.gz ext3 ext3.gz squashfs squashfs-lzma ubi" +IMAGE_TYPES = "jffs2 cramfs ext2 ext2.gz ext3 ext3.gz live squashfs squashfs-lzma ubi"
Signature · 1 line
1.7.3.4
PATCH 2/3 Remove -live.bb recipes
In reply to Saul Wold--- meta/recipes-core/images/core-image-live.inc | 21 -------------------- .../recipes-core/images/core-image-minimal-live.bb | 11 ---------- .../recipes-extended/images/core-image-lsb-live.bb | 11 ---------- .../images/core-image-lsb-sdk-live.bb | 11 ---------- meta/recipes-sato/images/core-image-sato-live.bb | 11 ---------- .../images/core-image-sato-sdk-live.bb | 11 ---------- 6 files changed, 0 insertions(+), 76 deletions(-) delete mode 100644 meta/recipes-core/images/core-image-live.inc delete mode 100644 meta/recipes-core/images/core-image-minimal-live.bb delete mode 100644 meta/recipes-extended/images/core-image-lsb-live.bb delete mode 100644 meta/recipes-extended/images/core-image-lsb-sdk-live.bb delete mode 100644 meta/recipes-sato/images/core-image-sato-live.bb delete mode 100644 meta/recipes-sato/images/core-image-sato-sdk-live.bb
meta/recipes-core/images/core-image-live.inc deleted +0 -21
@@ -1,21 +0,0 @@ -AUTO_SYSLINUXCFG = "1" -INITRD = "${DEPLOY_DIR_IMAGE}/core-image-minimal-initramfs-${MACHINE}.cpio.gz" -APPEND += "root=/dev/ram0 " -TIMEOUT = "10" - -EXCLUDE_FROM_WORLD = "1" - -LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \ - file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" - -do_bootimg[depends] += "core-image-minimal-initramfs:do_rootfs" - -inherit bootimg - -do_bootimg_prepend () { - import bb - fstypes = bb.data.getVar('IMAGE_FSTYPES', d, True) - if 'ext3' not in fstypes: - bb.msg.fatal(bb.msg.domain.Build, "ext3 not in IMAGE_FSTYPES") -} -
meta/recipes-core/images/core-image-minimal-live.bb deleted +0 -11
@@ -1,11 +0,0 @@ -DESCRIPTION = "Minimal Bootable Live Image" - -require core-image-live.inc - -LABELS += "boot install" - -ROOTFS = "${DEPLOY_DIR_IMAGE}/core-image-minimal-${MACHINE}.ext3" - -LICENSE = "MIT" - -do_bootimg[depends] += "core-image-minimal:do_rootfs"
meta/recipes-extended/images/core-image-lsb-live.bb deleted +0 -11
@@ -1,11 +0,0 @@ -DESCRIPTION = "LSB Bootable Live Image" - -require recipes-core/images/core-image-live.inc - -LABELS += "boot install" - -ROOTFS = "${DEPLOY_DIR_IMAGE}/core-image-lsb-${MACHINE}.ext3" - -LICENSE = "MIT" - -do_bootimg[depends] += "core-image-lsb:do_rootfs"
meta/recipes-extended/images/core-image-lsb-sdk-live.bb deleted +0 -11
@@ -1,11 +0,0 @@ -DESCRIPTION = "LSB SDK Bootable Live Image" - -require recipes-core/images/core-image-live.inc - -LABELS += "boot install" - -ROOTFS = "${DEPLOY_DIR_IMAGE}/core-image-lsb-sdk-${MACHINE}.ext3" - -LICENSE = "MIT" - -do_bootimg[depends] += "core-image-lsb-sdk:do_rootfs"
meta/recipes-sato/images/core-image-sato-live.bb deleted +0 -11
@@ -1,11 +0,0 @@ -DESCRIPTION = "Sato Bootable Live Image" - -require recipes-core/images/core-image-live.inc - -LABELS += "boot install" - -ROOTFS = "${DEPLOY_DIR_IMAGE}/core-image-sato-${MACHINE}.ext3" - -LICENSE = "MIT" - -do_bootimg[depends] += "core-image-sato:do_rootfs"
meta/recipes-sato/images/core-image-sato-sdk-live.bb deleted +0 -11
@@ -1,11 +0,0 @@ -DESCRIPTION = "Bootable Live Sato SDK Image" - -require recipes-core/images/core-image-live.inc - -LABELS += "boot install" - -ROOTFS = "${DEPLOY_DIR_IMAGE}/core-image-sato-sdk-${MACHINE}.ext3" - -LICENSE = "MIT" - -do_bootimg[depends] += "core-image-sato-sdk:do_rootfs"
Signature · 1 line
1.7.3.4
PATCH 3/3 Remove -directdisk.bb recipes
In reply to Saul Wold--- meta-rt/images/core-image-minimal-rt-directdisk.bb | 15 --------------- meta/recipes-core/images/core-image-directdisk.inc | 11 ----------- .../images/core-image-minimal-directdisk.bb | 11 ----------- .../images/core-image-sato-directdisk.bb | 9 --------- .../images/core-image-sato-sdk-directdisk.bb | 9 --------- 5 files changed, 0 insertions(+), 55 deletions(-) delete mode 100644 meta-rt/images/core-image-minimal-rt-directdisk.bb delete mode 100644 meta/recipes-core/images/core-image-directdisk.inc delete mode 100644 meta/recipes-core/images/core-image-minimal-directdisk.bb delete mode 100644 meta/recipes-sato/images/core-image-sato-directdisk.bb delete mode 100644 meta/recipes-sato/images/core-image-sato-sdk-directdisk.bb
meta-rt/images/core-image-minimal-rt-directdisk.bb deleted +0 -15
@@ -1,15 +0,0 @@ -# -# Copyright (C) 2010 Intel Corporation. -# - -require recipes-core/images/core-image-directdisk.inc - -DESCRIPTION = "Bootable Minimal Real-Time Direct Disk Image" - -ROOTFS = "${DEPLOY_DIR_IMAGE}/core-image-minimal-rt-${MACHINE}.ext3" - -LICENSE = "MIT" - -do_bootdirectdisk[depends] += "core-image-minimal-rt:do_rootfs" - -
meta/recipes-core/images/core-image-directdisk.inc deleted +0 -11
@@ -1,11 +0,0 @@ -inherit boot-directdisk - -LIC_FILES_CHKSUM = "file://${COREBASE}/LICENSE;md5=3f40d7994397109285ec7b81fdeb3b58 \ - file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420" - -do_bootdirectdisk_prepend () { - import bb - fstypes = bb.data.getVar('IMAGE_FSTYPES', d, True) - if 'ext3' not in fstypes: - bb.msg.fatal(bb.msg.domain.Build, "ext3 not in IMAGE_FSTYPES") -}
meta/recipes-core/images/core-image-minimal-directdisk.bb deleted +0 -11
@@ -1,11 +0,0 @@ -require core-image-directdisk.inc - -DESCRIPTION = "Minimal Bootable Direct Disk Image" - -ROOTFS = "${DEPLOY_DIR_IMAGE}/core-image-minimal-${MACHINE}.ext3" - -LICENSE = "MIT" - -do_bootdirectdisk[depends] += "core-image-minimal:do_rootfs" - -
meta/recipes-sato/images/core-image-sato-directdisk.bb deleted +0 -9
@@ -1,9 +0,0 @@ -require recipes-core/images/core-image-directdisk.inc - -DESCRIPTION = "Sato Direct Disk Image" - -LICENSE = "MIT" - -ROOTFS = "${DEPLOY_DIR_IMAGE}/core-image-sato-${MACHINE}.ext3" - -do_bootdirectdisk[depends] += "core-image-sato:do_rootfs"
meta/recipes-sato/images/core-image-sato-sdk-directdisk.bb deleted +0 -9
@@ -1,9 +0,0 @@ -require recipes-core/images/core-image-directdisk.inc - -DESCRIPTION = "Sato SDK Direct Disk Image" - -LICENSE = "MIT" - -ROOTFS = "${DEPLOY_DIR_IMAGE}/core-image-sato-sdk-${MACHINE}.ext3" - -do_bootdirectdisk[depends] += "core-image-sato-sdk:do_rootfs"
Signature · 1 line
1.7.3.4
Re: [RFC-WIP 1/3] classes/image*: Revamp creation of live images
In reply to Saul WoldQuoted 31 lines · Saul Wold
This creates a live image as an
IMAGE_FSTYPES, thus removing the need to have additional -live.bb recipes. To create a live image one just needs to add live to theIMAGE_FSTYPESlistSigned-off-by Saul Wold <[email protected]>--- .../{bootimg.bbclass => image-live.bbclass} | 11 +++++++++++ meta/classes/image.bbclass | 3 +++ meta/classes/image_types.bbclass | 20 ++++++++++++++++++-- 3 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 meta/classes/image-empty.bbclass rename meta/classes/{bootimg.bbclass => image-live.bbclass} (91%)meta/classes/image-empty.bbclass new file +0
-0meta/classes/image-live.bbclass renamed from meta/classes/bootimg.bbclass +4
-0@@ -25,6 +25,17 @@ # ${APPEND} - an override list of append strings for each label # ${SYSLINUX_OPTS} - additional options to add to the syslinux file ';' delimited +AUTO_SYSLINUXCFG = "1" +INITRD = "${DEPLOY_DIR_IMAGE}/core-image-minimal-initramfs-${MACHINE}.cpio.gz" +APPEND += "root=/dev/ram0 " +TIMEOUT = "10"
meta/classes/image-live.bbclass line 41
Quoted 10 lines
meta/classes/image-live.bbclass renamed from meta/classes/bootimg.bbclass +7
-0+LABELS += "boot install" + +ROOTFS = "${DEPLOY_DIR_IMAGE}/${IMAGE_BASENAME}-${MACHINE}.ext3" + +do_bootimg[depends] += "core-image-minimal-initramfs:do_rootfs" +do_bootimg[depends] += "${IMAGE_BASENAME}:do_rootfs" + do_bootimg[depends] += "dosfstools-native:do_populate_sysroot \ syslinux:do_populate_sysroot \ syslinux-native:do_populate_sysroot \
It might be an idea to leave bootimg.bbclass as is for anyone using it as it currently stands and make this image-xxx.bbclass inherit it?
Quoted 19 lines
meta/classes/image.bbclass +3
-0@@ -29,6 +29,9 @@ LDCONFIGDEPEND_libc-uclibc = "" do_rootfs[depends] += "makedevs-native:do_populate_sysroot virtual/fakeroot-native:do_populate_sysroot ${LDCONFIGDEPEND}" do_rootfs[depends] += "virtual/update-alternatives-native:do_populate_sysroot update-rc.d-native:do_populate_sysroot" +IMAGE_TYPE = ${@base_contains("IMAGE_FSTYPES", "live", "live", "empty", d)} +inherit image-${IMAGE_TYPE} + python () { deps = bb.data.getVarFlag('do_rootfs', 'depends', d) or "" for type in (bb.data.getVar('IMAGE_FSTYPES', d, True) or "").split():meta/classes/image_types.bbclass +0
-0
meta/classes/image_types.bbclass line 6
Quoted 7 lines
meta/classes/image_types.bbclass +3
-1@@ -1,7 +1,23 @@ + def get_imagecmds(d): cmds = "\n" old_overrides = bb.data.getVar('OVERRIDES', d, 0) - for type in bb.data.getVar('IMAGE_FSTYPES', d, True).split(): + + types = bb.data.getVar('IMAGE_FSTYPES', d, True).split()
Er, how about:
if "live" in types:
# For live images, ensure they get processed last # live images also depend on ext3 so ensure its present types.remove("live")
if "ext3" not in types:
types.append("ext3")
types.append("live")
Quoted 18 lines
meta/classes/image_types.bbclass +14
-0+ try: + live_pos = types.index("live") + try: + ext3_pos = types.index("ext3") + except ValueError: + types.insert(live_pos, "ext3") + else: + if ext3_pos > live_pos: + types.pop(live_pos) + #types.append("live") + except ValueError: + pass + + for type in types: localdata = bb.data.createCopy(d) localdata.setVar('OVERRIDES', '%s:%s' % (type, old_overrides)) bb.data.update_data(localdata)
meta/classes/image_types.bbclass IMAGE_DEPENDS_ubi = "mtd-utils-native" · line 122
Quoted 5 lines
meta/classes/image_types.bbclass +1
-1@@ -103,4 +119,4 @@ IMAGE_DEPENDS_ubi = "mtd-utils-native" IMAGE_DEPENDS_ubifs = "mtd-utils-native" # This variable is available to request which values are suitable for IMAGE_FSTYPES -IMAGE_TYPES = "jffs2 cramfs ext2 ext2.gz ext3 ext3.gz squashfs squashfs-lzma ubi" +IMAGE_TYPES = "jffs2 cramfs ext2 ext2.gz ext3 ext3.gz live squashfs squashfs-lzma ubi"
Otherwise looks good :)
Cheers,
Richard