Phi*_*Bot 5 linux build-system bitbake yocto
我正在尝试将开源“procps”包添加到我的工作 Yocto 构建中。这个包安装了一堆二进制文件,替换了 BusyBox 提供的二进制文件。我只想要这些二进制文件之一 - pgrep
.
在我的图层中,我创建了一个名为“procps_%bbappend”的 bbappend 文件。它被构建选中,编译成功,但安装失败。错误消息似乎表明do_install()
和do_install_append()
钩子没有被完全覆盖。
如何更改我的 bitbake bbappend 文件以仅安装该pgrep
实用程序,而不安装来自“procps”包的其他标准安装?
这是我失败的 bbappend 文件:
do_install () {
install -d ${D}${base_bindir}
mv ${D}/../build/pgrep ${D}/bin/pgrep
}
do_install_append () {
install -d ${D}${base_bindir}
mv ${D}/../build/pgrep ${D}/bin/pgrep
}
bindir_progs = ""
base_bindir_progs = ""
base_sbindir_progs = ""
Run Code Online (Sandbox Code Playgroud)
这是整个“procps”bitbake 配方:
SUMMARY = "System and process monitoring utilities"
DESCRIPTION = "Procps contains a set of system utilities that provide system information about processes using \
the /proc filesystem. The package includes the programs ps, top, vmstat, w, kill, and skill."
HOMEPAGE = "https://gitorious.org/procps"
SECTION = "base"
LICENSE = "GPLv2+ & LGPLv2+"
LIC_FILES_CHKSUM="file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263 \
file://COPYING.LIB;md5=4cf66a4984120007c9881cc871cf49db \
"
DEPENDS = "ncurses"
inherit autotools gettext pkgconfig update-alternatives
SRC_URI = "http://downloads.sourceforge.net/project/procps-ng/Production/procps-ng-${PV}.tar.xz \
file://sysctl.conf \
"
SRC_URI[md5sum] = "6cc5b94c1c5b8cbc89ad345a7b522f74"
SRC_URI[sha256sum] = "e9493169a2d2adc0bc045538707310c8e877b385e4e296143b62607d2bb044ed"
S = "${WORKDIR}/procps-ng-${PV}"
EXTRA_OECONF = "--enable-skill --disable-modern-top"
CPPFLAGS += "-I${S}"
do_install_append () {
install -d ${D}${base_bindir}
[ "${bindir}" != "${base_bindir}" ] && for i in ${base_bindir_progs}; do mv ${D}${bindir}/$i ${D}${base_bindir}/$i; done
install -d ${D}${base_sbindir}
[ "${sbindir}" != "${base_sbindir}" ] && for i in ${base_sbindir_progs}; do mv ${D}${sbindir}/$i ${D}${base_sbindir}/$i; done
if [ "${base_sbindir}" != "${sbindir}" ]; then
rmdir ${D}${sbindir}
fi
install -d ${D}${sysconfdir}
install -m 0644 ${WORKDIR}/sysctl.conf ${D}${sysconfdir}/sysctl.conf
if ${@bb.utils.contains('DISTRO_FEATURES','systemd','true','false',d)}; then
install -d ${D}${sysconfdir}/sysctl.d
ln -sf ../sysctl.conf ${D}${sysconfdir}/sysctl.d/99-sysctl.conf
fi
}
CONFFILES_${PN} = "${sysconfdir}/sysctl.conf"
bindir_progs = "free pkill pmap pgrep pwdx skill snice top uptime"
base_bindir_progs += "kill pidof ps watch"
base_sbindir_progs += "sysctl"
ALTERNATIVE_PRIORITY = "200"
ALTERNATIVE_${PN} = "${bindir_progs} ${base_bindir_progs} ${base_sbindir_progs}"
ALTERNATIVE_${PN}-doc = "kill.1 uptime.1"
ALTERNATIVE_LINK_NAME[kill.1] = "${mandir}/man1/kill.1"
ALTERNATIVE_LINK_NAME[uptime.1] = "${mandir}/man1/uptime.1"
python __anonymous() {
for prog in d.getVar('base_bindir_progs', True).split():
d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_bindir', True), prog))
for prog in d.getVar('base_sbindir_progs', True).split():
d.setVarFlag('ALTERNATIVE_LINK_NAME', prog, '%s/%s' % (d.getVar('base_sbindir', True), prog))
}
Run Code Online (Sandbox Code Playgroud)
Run Code Online (Sandbox Code Playgroud)do_install () { install -d ${D}${base_bindir} mv ${D}/../build/pgrep ${D}/bin/pgrep } do_install_append () { install -d ${D}${base_bindir} mv ${D}/../build/pgrep ${D}/bin/pgrep }
这里有一些混乱:
install
它就是它的用途。${D}/../build/
是不正确的,您可能想要${B}
- 但这也应该是 do_install() 的默认目录,因此您根本不需要它。你可以让原来的 do_install() 做它想做的事,然后在 do_install_append() 中删除你不想要的位......但我认为修改包不是一个好主意:如果另一个包运行时依赖在 procps 上并期望您删除的工具?
一些替代方案:
PACKAGES =+ ${PN}-pgrep
并设置FILES_${PN}-pgrep = "${bindir}/pgrep"
:然后您可以只安装新的小 procps-pgrep 包而不是 procps。由于系统 procps 使用的替代方案,这可能需要进行一些调整才能正确... 归档时间: |
|
查看次数: |
18949 次 |
最近记录: |