[bitbake-devel] task override
Trevor Woerner
twoerner at gmail.com
Sat Jan 19 15:33:50 UTC 2013
Hi Chris, thanks for your feedback.
On Fri, Jan 18, 2013 at 4:57 PM, Chris Larson <clarson at kergoth.com> wrote:
> Just override do_rootfs in your 'myimg' recipe and call it done.
I was afraid that's what you'd say. I'm obviously doing something wrong
somewhere because I can't seem to get the results I would like.
> Beyond that, a directory isn't a layer. You have to have conf/layer.conf
and
> add the layer to bblayers.conf for bitbake to see it as a layer.
:-) I cut it down to only show the relevant parts :-)
My goal is to write my own methods and procedures for creating file system
images. I would like to do this in a layer so as to not disturb the existing
image-creation routines which are provided. My understanding is that the
image creation work takes place in the "do_rootfs" task.
As a start, in order to prove to myself that my routines were completely
replacing the base ones, I thought that if I wrote an empty do_rootfs
routine in
my layer, I could run a build and essentially end up with nothing (or next
to
nothing) in the tmp/deploy/images directory. But this isn't the results I'm
seeing.
Here is my code:
meta-trevor/
|-- README
|-- classes
| `-- twrootfs.bbclass
| addtask rootfs
| twrootfs_do_rootfs() {
| echo "rootfs from meta-trevor!"
| }
| EXPORT_FUNCTIONS do_rootfs
|-- conf
| `-- layer.conf
| BBPATH := "${BBPATH}:${LAYERDIR}"
|
| BBFILES := "${BBFILES} ${LAYERDIR}/recipes-*/*/*.bb \
| ${LAYERDIR}/recipes-*/*/*.bbappend"
|
| BBFILE_COLLECTIONS += "trevor"
| BBFILE_PATTERN_trevor := "^${LAYERDIR}/"
| BBFILE_PRIORITY_trevor = "6"
`-- recipes-core
`-- images
`-- bboverride.bb
DESCRIPTION = "A small-ish image that starts with busybox,
but then adds as many of the 'real' programs as possible"
IMAGE_INSTALL = "packagegroup-core-boot
${ROOTFS_PKGMANAGE_BOOTSTRAP} ${CORE_IMAGE_EXTRA_INSTALL} \
trace-cmd bash util-linux coreutils vim-tiny
openssh procps grep iputils gzip bzip2 sed \
tar net-tools gawk findutils ncurses tzdata less bc
wget psmisc file"
IMAGE_LINGUAS = " "
LICENSE = "MIT"
inherit core-image
inherit twrootfs
ROOTFS_POSTPROCESS_COMMAND += "remove_packaging_data_files
; "
Then, in my build area:
conf/
|-- bblayers.conf
| # LAYER_CONF_VERSION is increased each time build/conf/bblayers.conf
| # changes incompatibly
| LCONF_VERSION = "6"
|
| BBPATH = "${TOPDIR}"
| BBFILES ?= ""
|
| BBLAYERS ?= " \
| /home/trevor/devel/yocto/git-method/poky/meta \
| /home/trevor/devel/yocto/git-method/poky/meta-yocto \
| /home/trevor/devel/yocto/git-method/poky/meta-yocto-bsp \
|
/home/trevor/devel/yocto/git-method/poky/meta-openembedded/meta-oe \
| /home/trevor/devel/yocto/meta-trevor \
| "
| BBLAYERS_NON_REMOVABLE ?= " \
| /home/trevor/devel/yocto/git-method/poky/meta \
| /home/trevor/devel/yocto/git-method/poky/meta-yocto \
| "
`-- local.conf
BB_NUMBER_THREADS = "1"
PARALLEL_MAKE = "-j 1"
MACHINE = "qemux86"
DL_DIR = "/home/trevor/devel/Downloads"
DISTRO = "poky"
PACKAGE_CLASSES = "package_ipk"
EXTRA_IMAGE_FEATURES = "debug-tweaks ssh-server-openssh"
USER_CLASSES = "buildstats image-mklibs image-prelink"
PATCHRESOLVE = "noop"
BB_DISKMON_DIRS = "\
STOPTASKS,${TMPDIR},1G,100K \
STOPTASKS,${DL_DIR},1G,100K \
STOPTASKS,${SSTATE_DIR},1G,100K \
ABORT,${TMPDIR},100M,1K \
ABORT,${DL_DIR},100M,1K \
ABORT,${SSTATE_DIR},100M,1K"
CONF_VERSION = "1"
BB_DANGLINGAPPENDS_WARNONLY = "yes"
IMAGE_FSTYPES = "vmdk"
IMAGE_ROOTFS_SIZE = "100000"
You might think my setting BB_NUMBER_THREADS and PARALLEL_MAKE to 1
is strange, but it makes it _so_ much easier to read the output logs when
running
bitbake with "-vvvD".
After performing a "bitbake -vvvD bboverride 2>&1 | tee build.log" I find
all the
regular suspects in my tmp/deploy/images directory. When I look through the
log file I see all the regular image-building commands taking place (e.g.
rootfs_ipk_do_rootfs etc.), and I don't find the "rootfs from meta-trevor"
that
I was expecting.
I realize that my inclusion of 'IMAGE_FSTYPES = "vmdk"' in my local.conf
might be suspect, but I assume the routines to build the vmdk are
"underneath"
the do_rootfs task. As such, if I really am replacing the base do_rootfs
with
my own (which does nothing) having this line in the configuration file
shouldn't
be kicking off any image-creation procedures (I would think).
Any and all help is much appreciated, thanks :-)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openembedded.org/pipermail/bitbake-devel/attachments/20130119/3f6ae6ac/attachment-0001.html>
More information about the bitbake-devel
mailing list