diff options
Diffstat (limited to 'distribution/yocto-advanced/meta-schulung-extended/recipes-core/images')
| -rw-r--r-- | distribution/yocto-advanced/meta-schulung-extended/recipes-core/images/core-image-schulung.bb | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/distribution/yocto-advanced/meta-schulung-extended/recipes-core/images/core-image-schulung.bb b/distribution/yocto-advanced/meta-schulung-extended/recipes-core/images/core-image-schulung.bb new file mode 100644 index 0000000..516bca3 --- /dev/null +++ b/distribution/yocto-advanced/meta-schulung-extended/recipes-core/images/core-image-schulung.bb @@ -0,0 +1,50 @@ +# use the core-image class (poky/meta/core-image.bbclass) +inherit core-image + +# add package management to the image +# (the package management type depends on PACKAGE_CLASSES) +IMAGE_FEATURES += "package-management" + +# do not install any particular locales +# (they are big and we don't need them) +IMAGE_LINUGUAS = " " + +# set the size of the partition for the image +# (see image.bbclass for related limits) +IMAGE_ROOTFS_SIZE ?= "32768" + +# specify packages for the root filesystem +# (IMAGE_INSTALL is defined in and used by core-image.bbclass +# for a list of packages to be installed, use = to ignore the +# packages added by 'packagegroup-core-boot') +# IMAGE_INSTALL += "hello schulung-rootfs openssh" +IMAGE_INSTALL = "hello schulung-rootfs" + +# set a root password +# inherit extrausers +# EXTRA_USERS_PARAMS = "usermod -P foo root;" + +# busybox must be installed so we have access to busybox.links +# (for DEPENDS packages, the -dev variant of the package +# is also installed in the sysroot) +DEPENDS += "busybox" + +# create a function to create the busybox links +# - anything copied to ${IMAGE_ROOTFS} will also appear in the root filesystem +# (this is set in bitbake.conf to ${WORKDIR}/rootfs) +setup_busybox_links () { + for lnfile in `cat ${PKG_CONFIG_SYSROOT_DIR}${datadir}/busybox/busybox.links`; do + # do not create /linuxrc link, we do not need it + test $lnfile = /linuxrc && continue + + # create parent directory if necessary + install -d ${IMAGE_ROOTFS}`dirname $lnfile` + + # link creation is allowed to fail if a file is already there + ln -s ${base_bindir}/busybox ${IMAGE_ROOTFS}$lnfile || true + done +} +# ...and have it called after the rootfs task is finished +do_rootfs[postfuncs] += "setup_busybox_links" + +# using "do_rootfs_append ()" as function would have the same effect |
