【问题标题】:Can not install cronjob file in yocto build, run.do_install error无法在 yocto build 中安装 cronjob 文件,run.do_install 错误
【发布时间】:2022-01-27 22:18:35
【问题描述】:

我正在尝试将文件 my-cronjob.cron 添加到我的新元层内的 /etc/cron.d 中

文件树如下:

meta-customLayer
└── recipes-myCustomLayer
    └── myCustomLayer
        ├── files
        │   └── my-cronjob.cron
        └── myCustomLayer.bb

我的 CustomLayer.bb :

PR = "r0"
PACKAGES = "${PN} ${PN}-dev ${PN}-dbg ${PN}-staticdev"

RDEPENDS_${PN}-staticdev = ""
RDEPENDS_${PN}-dev = ""
RDEPENDS_${PN}-dbg = ""
RDEPENDS_${PN} = ""

do_install() {
    install -d ${D}/${sysconfdir}/cron.d
    install -m 755  "${THISDIR}/files/testApp-cronjob.cron" ${sysconfdir}/cron.d/

}

FILES_${PN} += "${sysconfdir}/cron.d/testApp-cronjob"

当我尝试构建 imahge 时,出现以下错误:

ERROR: myCustomLayer-1.0-r0 do_install: Execution of '/***/imx-yocto/build-core-image-base/tmp/work/cortexa35-poky-linux/myCustomLayer/1.0-r0/temp/run.do_install.16326' failed with exit code 1:
install: cannot create regular file '/etc/cron.d/testApp-cronjob.cron': Permission denied

知道为什么会出现此错误吗?有什么办法可以将此 cronjob 添加到 yocto 中?

【问题讨论】:

标签: linux cron yocto


【解决方案1】:

你错过了目的地后缀:

install -m 755  "${THISDIR}/files/testApp-cronjob.cron" ${D}${sysconfdir}/cron.d/

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-02-08
    • 2021-07-13
    • 1970-01-01
    • 2019-12-26
    • 1970-01-01
    • 1970-01-01
    • 2014-05-26
    相关资源
    最近更新 更多