我的目标是创建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.更多推荐
发布评论