简体   繁体   中英

Yocto/Bitbake recipe for adding empty directory to rootfs Embedded Linux

Is there any recipe for adding a new, empty directory to the rootfs? I tried adding this into one of my bbappend file:

do_install() {
   install -d ${D}/tmp/myNewDir
}
FILES_${PN} += "/tmp/myNewDir"

but I am getting a non descriptive error, Function failed: do_install

There are several ways. The image command way is already described by StackedUser.

You can also try to extend some of your recipes (as you are doing in your question). I guess that you are seeing the error because you are overwriting the do_install task. You are probably wanting to extend it, so you should add _append to the task name, ie:

do_install_append () {
   install -d ${D}/tmp/myNewDir
}

BTW, the error "Function failed: do_install" you are hitting usually show an error code or a problematic command. Maybe there is something.

Another way is to create a simple recipe and add it to the image, here is a stub:

SUMMARY = "XXX project directory structure"
# FIXME - add proper license below
LICENSE = "CLOSED"
PV = "1.0"

S = "${WORKDIR}"

inherit allarch

do_install () {
        install -d ${D}/foo/bar
}

FILES_${PN} = "/foo/bar"

In our image recipe we have something like this to create a new directory:

create_data_dir() {
   mkdir -p ${IMAGE_ROOTFS}/data
}

IMAGE_PREPROCESS_COMMAND += "create_data_dir;"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM