ilya1725
ilya1725

Reputation: 4938

Yocto: Create a directory after mount

I have a Yocto bitbake recipe in my layer - base-files_%.bbappend. It creates mount points:

do_install_append() {
    mknod -m 622 ${D}/dev/console c 5 1
    install -m 0755 -d ${D}/boot/EFI
    install -m 0755 -d ${D}/data
}

The /data/ directory is later mounted to the internal SD card.

I would like to create a directory ${D}/data/test. What is the best way to do it? I've added a line install -m 0755 -d ${D}/data/test to this function but it didn't do it.

Thanks so much.

Upvotes: 1

Views: 4175

Answers (2)

yoctotutor.com
yoctotutor.com

Reputation: 5511

In your do_install function

do_install(){
    mkdir -d ${D}/data/test
}

-d option creates the dir in your rootfs, and if you want to copy files, use below command in do_install function.

install -m 0777 ${s}/your files ${D}/data/test

The QA packaging process verification should be informed :

FILES_${PN} += "/data/test"

Upvotes: 0

Nayfe
Nayfe

Reputation: 2300

You have to ship those installed files by adding to your recipe:

FILES_${PN} += "/data/test"

Another solution is to add in your image recipe:

create_dirs() {
    mkdir -p ${IMAGE_ROOTFS}/data/test
}

ROOTFS_POSTPROCESS_COMMAND += "create_dirs ; "

Upvotes: 2

Related Questions