Bitbake不会将我的文件安装在我的rootfs中(Bitbake does not install my files in my rootfs)

编程入门 行业动态 更新时间:2024-10-25 06:25:10
Bitbake不会将我的文件安装在我的rootfs中(Bitbake does not install my files in my rootfs)

我的目标是创建Bitbake配方,它将在/ etc目录和脚本中安装配置文件,将此配置应用到/ect/init.d目录(并调用update-rc-d)。 我已经看到另一个类似的问题( Bitbake没有在rootfs映像中安装我的文件 )。 我几乎完成了这个人的工作,但不幸的是它没有奏效。 问题是Bitbake不会抱怨任何事情,只是不会将这些文件添加到rootfs。 这是我目前的食谱。 我还将脚本和配置文件放在两个目录中:文件和位于配方目录内的alsa-config。

SUMMARY = "Alsa Config" DESCRIPTION = "Adds alsa configuration file, and startup script that applies it." LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" SRC_URI += " \ file://my-alsa-config \ file://asound.state \ " PACKAGE_ARCH = "${MACHINE_ARCH}" S = "${WORKDIR}" INITSCRIPT_NAME = "my-alsa-config" INITSCRIPT_PARAMS = "defaults 99 01" inherit autotools update-rc.d do_install() { install -m 0644 ${WORKDIR}/asound.state ${D}${sysconfdir} } FILES_${PN} += "${sysconfdir}/asound.state"

在我的local.conf中我添加了一行:

CORE_IMAGE_EXTRA_INSTALL += "alsa-config "

请,任何人都可以帮忙吗?

My aim is to create Bitbake recipe, that will install config file in /etc directory, and script, that will apply this config into /ect/init.d directory (and invoke update-rc-d). I already saw another similar question (Bitbake not installing my file in the rootfs image). I did almost exactly what this guy did, but unfortunately it didn't work. The problem is that Bitbake does not complain on anything, but just not adds these files to rootfs. Here is my current recipe. I also put my script and config files to two directories: files, and alsa-config, which resides inside recipe directory.

SUMMARY = "Alsa Config" DESCRIPTION = "Adds alsa configuration file, and startup script that applies it." LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" SRC_URI += " \ file://my-alsa-config \ file://asound.state \ " PACKAGE_ARCH = "${MACHINE_ARCH}" S = "${WORKDIR}" INITSCRIPT_NAME = "my-alsa-config" INITSCRIPT_PARAMS = "defaults 99 01" inherit autotools update-rc.d do_install() { install -m 0644 ${WORKDIR}/asound.state ${D}${sysconfdir} } FILES_${PN} += "${sysconfdir}/asound.state"

In my local.conf I added line:

CORE_IMAGE_EXTRA_INSTALL += "alsa-config "

Please, can anybody help?

最满意答案

幸运的是,我能够解决这个问题。 解决方案如下:

SUMMARY = "Alsa Config" DESCRIPTION = "Adds alsa configuration file, and startup script that applies it." LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" SRC_URI += " \ file://my-alsa-config \ file://asound.state \ " PACKAGE_ARCH = "${MACHINE_ARCH}" S = "${WORKDIR}" INITSCRIPT_NAME = "my-alsa-config" INITSCRIPT_PARAMS = "defaults 99 01" inherit autotools update-rc.d do_install() { install -d ${D}${sysconfdir}/init.d/ install -m 0755 ${WORKDIR}/my-alsa-config ${D}${sysconfdir}/init.d/ install -m 0644 ${WORKDIR}/asound.state ${D}${sysconfdir}/ } FILES_${PN} += "${sysconfdir}/asound.state \ ${sysconfdir}/my-alsa-config"

一点评论:

PACKAGE_ARCH必须正确设置。 在我的情况下,当我没有它时,由于某种原因没有设置脚本文件的执行权限。 do_install()必须创建所需的每个目录。 即使我知道,在我的rootfs中会有/ etc目录,我必须创建它。 而且我不确定是否有必要,但最好在安装目录的末尾加上斜线,以防万一。 必须同时安装要在启动时启动的初始化脚本;) 脚本必须设置适当的权限。

Fortunately, I was able to solve the problem. Here is the solution:

SUMMARY = "Alsa Config" DESCRIPTION = "Adds alsa configuration file, and startup script that applies it." LICENSE = "MIT" LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302" SRC_URI += " \ file://my-alsa-config \ file://asound.state \ " PACKAGE_ARCH = "${MACHINE_ARCH}" S = "${WORKDIR}" INITSCRIPT_NAME = "my-alsa-config" INITSCRIPT_PARAMS = "defaults 99 01" inherit autotools update-rc.d do_install() { install -d ${D}${sysconfdir}/init.d/ install -m 0755 ${WORKDIR}/my-alsa-config ${D}${sysconfdir}/init.d/ install -m 0644 ${WORKDIR}/asound.state ${D}${sysconfdir}/ } FILES_${PN} += "${sysconfdir}/asound.state \ ${sysconfdir}/my-alsa-config"

A little bit of comments:

PACKAGE_ARCH has to be set properly. In my case, when I didn't have it, execute permissions for script file were not set for some reason. do_install() has to create every directory, that is needed. Even if I know, that in my rootfs there will be /etc directory, I have to create it. And I'm not sure if it is necessary, but it's better to have slash at the end of install directory, just in case. Init scripts that are to be installed to launch at startup has to be installed too;) Scripts must have proper permissions set.

更多推荐

本文发布于:2023-07-16 15:43:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1130483.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:将我   文件   安装在   Bitbake   install

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!