I have a service created and working. However my current bitbake file makes my folder structure very ugly. To have it work I have to have all of my configuration files in my src folder. I would like to have two folders, src and configfiles.
If my tree is as follows
How can I edit my bb file to pull in my src directory and my configfiles?
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = "file://src"
S = "${WORKDIR}/src"
CF = "${WORKDIR}/configfiles"
inherit systemd autotools
SYSTEMD_SERVICE_${PN} = "helloworld.service"
do_install_append () {
echo "look at this PN ${PN}"
echo "look at this D ${D}"
echo "look at this S ${S}"
echo "look at this CF ${CF}"
install -d ${D}${systemd_system_unitdir}
install -m 0644 ${CF}/helloworld.service ${D}${systemd_system_unitdir}
sed -i -e 's,#BINDIR#,${bindir},g' ${D}${systemd_system_unitdir}/helloworld.service
}
Update 1:
I added a CF variable. Using bitbake -e helloworld > log.txt I can echo the values of variables and noticed we are not pointing to the config files.
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
SRC_URI = "file://src"
S = "${WORKDIR}/src"
CF = "${WORKDIR}/configfiles"
inherit systemd autotools
SYSTEMD_SERVICE_${PN} = "helloworld.service"
do_install_append () {
echo "look at this PN ${PN}"
echo "look at this D ${D}"
echo "look at this S ${S}"
echo "look at this CF ${CF}"
install -d ${D}${systemd_system_unitdir}
install -m 0644 ${CF}/helloworld.service ${D}${systemd_system_unitdir}
sed -i -e 's,#BINDIR#,${bindir},g' ${D}${systemd_system_unitdir}/helloworld.service
}
Bitbake still can not find my makefile.
Update 2:
The solution given works but I have one more question.
My makefile is very basic:
ACLOCAL_AMFLAGS = -I m4
AUTOMAKE_OPTIONS = foreign
SUBDIRS = app
CFLAGS = -Wall -pedantic
include_HEADERS = helloworld.h
bin_PROGRAMS = helloworld
helloworld_SOURCES = helloworld.c
I want to separate my files by folder. I want my main application in a folder /src/app. I edited my makefile to point to app/helloworld.h and app/helloworld.c However this does not find the files. My updated bb file follows
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
FILESEXTRAPATHS:prepend := "${THISDIR}/files/src:${THISDIR}/files/src/app:${THISDIR}/files/services:"
SRC_URI = "file://src \
file://src/app \
"
SRC_URI += "file://helloworld.service \
file://autogen.sh \
file://configure.ac \
file://Makefile.am"
S = "${WORKDIR}/src"
inherit systemd autotools
SYSTEMD_SERVICE_${PN} = "helloworld.service"
do_install_append () {
install -d ${D}${systemd_system_unitdir}
install -m 0644 ${WORKDIR}/helloworld.service ${D}${systemd_system_unitdir}
sed -i -e 's,#BINDIR#,${bindir},g' ${D}${systemd_system_unitdir}/helloworld.service
}
I understand the makefile should be packaged with the code, This just does not work when creating larger applications.
You need to let bitbake know where to look for files, it sounds like you want to keep the Makefile in a separate directory but in most cases the Makefile should be with the source files, feel free to play around with this, the concept is still the same as explained below.
Either way, your directory structure should look something like this:
recipes-core/
helloworld/
helloworld_0.1.bb
files/
configfiles/
helloworld.service
src/
autogen.sh
configure.ac
helloworld.c
helloworld.h
Makefile.am
And to let bitbake know where to pull files you use the FILESESXTRAPATHS variable [1]:
FILESEXTRAPATHS:prepend := "${THISDIR}/files/src:${THISDIR}/files/configfiles:"
At this point bitbake knows WHERE to pull the files from, but it doesn't know which files to pull, for this you use the SRC_URI variable (specifically the file:// fetcher) [2]:
SRC_URI += "file://helloworld.service \
file://autogen.sh \
file://configure.ac \
file://helloworld.c \
file://helloworld.h \
file://Makefile.am"
This assumes your Makefile will try to find files in the same directory.
The rest of your recipe is fine, the CF variable is no longer necessary, and you just need to change where you're installing the service file from, since SRC_URI[1] will pull it to ${WORKDIR}:
install -m 0644 ${WORKDIR}/helloworld.service ${D}${systemd_system_unitdir}
[1] https://docs.yoctoproject.org/singleindex.html#term-FILESEXTRAPATHS
[2] https://docs.yoctoproject.org/bitbake/singleindex.html#term-SRC_URI
Related
I'm currently using yocto to build the system imx6sxsabresd (IMX6 Solo X). I have successfully built the image however I want to add a script to init.d to turn on a led. I'm appending to the linux-imx recipes within the meta-fsl-bsp-release layer.
This is my linux-imx.bbappend file:
FILESEXTRAPATHS_prepend := "${THISDIR}/linux-imx:"
SRC_URI += "file://0001-added-pad-for-heartbeat-led.patch \
file://heartbeat.sh \
file://heartbeat "
PACKAGECONFIG_append = " heartbeat"
inherit update-rc.d
INITSCRIPT_PACKAGES = "${PN}"
INITSCRIPT_PARAMS = "start"
INITSCRIPT_NAME = "heartbeat.sh"
do_install_append()
{
install -d ${D}${sysconfdir}/init.d
install -m 0755 ${WORKDIR}/heartbeat.sh ${D}${sysconfdir}/init.d/heartbeat.sh
install -d ${D}/home/root
install -m 0755 ${WORKDIR}/heartbeat ${D}/home/root/heartbeat
}
FILES_${PN} += "${sysconfdir}/init.d/heartbeat.sh /home/root/heartbeat"
PACKAGES = "${PN}"
I'm able to create the sdcard image succesfully with the patch I've included in this bbappend file, however, the files heartbeat.sh and heartbeat are not copying to the final rootfs added to the output sdcard file. This is very odd because I'm able to see these files in their paths copied to ../tmp/work/imx6sxsabresd-poky-linux-gnueabi/linux-imx/4.14.98-r0/image/
As the comments suggests appending to the kernel recipe is the wrong way to go about this. You should instead add your own recipe and reference that recipe from the image definition (append to IMAGE_INSTALL).
Your recipe could look something like:
SUMMARY = "LED heartbeat init script"
inherit update-rc.d
SRC_URI += "\
file://heartbeat.sh \
"
do_install() {
install -d ${D}${sysconfdir}/init.d
install -m 0755 ${WORKDIR}/heartbeat.sh ${D}${sysconfdir}/init.d/
}
FILES_${PN} = "${sysconfdir}/init.d/heartbeat.sh"
INITSCRIPT_NAME = "heartbeat.sh"
INITSCRIPT_PARAMS = "start 90 5 . stop 20 0 1 6 ."
I am trying to install a simple file to /etc directory of target rootfs. I am building core-image-sato. "raxy_test" file(in below recipe) is not even being copied in WORKDIR also.
Am I doing anything wrong?
I am able to do same with normal recipe but not with image recipe.
What is the difference between normal and image recipe?
DESCRIPTION = "Image with Sato, a mobile environment and visual style for \
mobile devices. The image supports X11 with a Sato theme, Pimlico \
applications, and contains terminal, editor, and file manager."
IMAGE_FEATURES += "splash package-management x11-base x11-sato ssh-server-dropbear hwcodecs"
LICENSE = "MIT"
inherit core-image
TOOLCHAIN_HOST_TASK_append = " nativesdk-intltool nativesdk-glib-2.0"
TOOLCHAIN_HOST_TASK_remove_task-populate-sdk-ext = " nativesdk-intltool nativesdk-glib-2.0"
LICENSE="CLOSED"
LIC_FILES_CHKSUM=""
SRC_URI = "\
file://raxy_test \
"
do_install() {
install -d ${D}${sysconfdir}
install -m 0755 raxy_test ${D}${sysconfdir}
}
I expect "raxy_test" file to be present in WORKDIR as well as in /etc directory of target.
Any help will really be appreciated, Thanks...!!!
Multiple things:
You use a image recipe (core-image-sato) to add a file in your image. You should use a separate recipe for this modification;
The install is not correct (WORKDIR is not used);
You do not populate the packages (FILES_${PN} not present).
For the separate recipe, create a file (for example myrecipe.bb or whatever you want) in a recipes-* sub directory (you need to place it at the same folder level than other recipes !). I did not test it but I think this can be a base:
DESCRIPTION = "My recipe"
LICENSE="CLOSED"
PR = "r0"
PV = "0.1"
SRC_URI = " file://raxy_test "
# Create package specific skeleton
do_install() {
install -d ${D}${sysconfdir}
install -m 0755 ${WORKDIR}/raxy_test ${D}${sysconfdir}/raxy_test
}
# Populate packages
FILES_${PN} = "${sysconfdir}"
You can notice that some things have changed:
The install must include the ${WORKDIR} path:
install -m 0755 ${WORKDIR}/raxy_test ${D}${sysconfdir}
And we need to populate the package:
FILES_${PN} = "${sysconfdir}"
This will add the files in ${sysconfdir} into the package ${PN} (which is by default the recipe name).
I've got a makefile recipe that builds a shared library (an alsa plugin). If I build the library outside if yocto everything works correctly and alsa will link to the library.
However if I build it with yocto, even though the log is error free, when I try and run alsa, I get an error "Cannot open shared library". The library is installed in location referenced by the error message and it's permissions are correct.
From within the recipe if I print out what BUILD_LDFLAGS is set to I notice the it's pointing to the x86_64-linux (build system) libraries instead of the 'MACHINE' libraries (example: -L//.build-yocto/tmp/sysroots/x86_64-linux/lib"
My questions are:
Is the BUILD_LDFLAGS the source of my problem?
If so how do I remedy it?
If not BUILD_LDFLAGS, any idea what is the problem.
Here is a copy of my recipe bb file:
SUMMARY = "..."
LICENSE = "CLOSED"
#Package release number
PR = "r0"
###################################################################
#The following lines tell yocto where to get the source code from
# This section is for git. Comment out ALL this section if
# you DO NOT want to pull from a git repo (local or remote).
# If pulling from git uncomment and modify paths.
###################################################################
#Uncomment following line to pull from REMOTE git repo
#SRC_URI = "git://gitpath;protocol=ssh;branch=master"
#Uncomment following line and modify path to pull from LOCAL git repo clone
##SRC_URI = "git:///localgitpath;protocol=file;branch=master"
#Change hash to match the commit you want yocto to use
##SRCREV="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
##S = "${WORKDIR}/git/"
# End of git section
###################################################################
#The following lines tell yocto where to use a local file system
# for the source. Uncomment all lines and modify paths
###################################################################
SRC_URI = ""
inherit externalsrc
EXTERNALSRC = "/home/<my_path>"
EXTERNALSRC_BUILD = "/home/<my_path>"
# End of local file system section
##################################################################
#END of where to get source code
##################################################################
#Ignore vendor ldflags checking and use ours
INSANE_SKIP_${PN} = "ldflags"
#Don't strip debug symbols
INHIBIT_PACKAGE_STRIP = "1"
INHIBIT_SYSROOT_STRIP = "1"
SOLIBS = ".so"
#Tell yocto that the .so files are real and not sym-links.
FILES_SOLIBSDEV = ""
#/usr/lib/alsa-lib
FILES_${PN} += "${libdir}/alsa-lib"
#/usr/<PATH>
FILES_${PN} += "${prefix}/<PATH>"
DEPENDS += "alsa-lib"
EXTRA_OEMAKE += "'CC=${CC}' 'RANLIB=${RANLIB}' 'AR=${AR}' 'CFLAGS=${CFLAGS} -I${S}/include' 'BUILDDIR=${S}' 'DESTDIR=${D}'"
TARGET_CFLAGS += "-DPIC -fPIC -Wall -Wextra -O2 -g -I./include -I<path> -I-I<path2> -I<path3> -lasound"
TARGET_LDFLAGS += "-shared -lasound"
do_configure() {
oe_runmake -f Makefile.yocto clean
}
do_compile() {
# unset LDFLAGS TARGET_LDFLAGS BUILD_LDFLAGS
echo " Werkdir ${WORKDIR}"
echo " Compiler ${CC}"
echo " BUILD_LDFLAGS ${BUILD_LDFLAGS}"
echo " LDFLAGS ${LDFLAGS}"
echo " TARGET_LDFLAGS ${TARGET_LDFLAGS}"
oe_runmake -f Makefile.yocto all 'CC=${CC}'
}
do_install() {
install -d ${D}${libdir}
install -d ${D}${libdir}/alsa-lib
install -d ${D}${bindir}
install -d ${D}${prefix}
install -d ${D}${prefix}/<PATH>
install -m 0644 <path_n>lib1.so ${D}${libdir}
install -m 0644 <path_n>lib2.so.so ${D}${libdir}
install -m 0644 <path_n>lib3.so.so ${D}${libdir}
install -m 0644 <path_n>lib4.so.so ${D}${libdir}
install -m 0644 <path_n>lib1pcm_plugin.so ${D}${libdir}/alsa-lib
install -m 0755 <path_n>app1 ${D}${bindir}
install -m 0755 <path_n>app2 ${D}${bindir}
install -m 0755 <path_n>app3 ${D}${bindir}
install -m 0755 <path_n>app4 ${D}${bindir}
install -m 0755 <path_n>app5 ${D}${bindir}
install -m 0755 <path_n>app6 ${D}${bindir}
install -m 0755 <path_n>app7 ${D}${bindir}
install -m 0755 <path_n>app8 ${D}${bindir}
}
Makefile:
# Makefile template for shared library
#Yocto will pass in the CC flag so this is commented out. Otherwise the correct compiler won't be used
#CC = gcc # C compiler
#These are here to allow a build outside of Yocto (testing the build). Yocto's CFLAGS
#and LDFLAGS will override these.
CFLAGS += -fPIC -Wall -Wextra -O2 -g -I<path1> -I<path2> -I<path2> # C flags
LDFLAGS = -shared # linking flags
RM = rm -f # rm command
TARGET_LIB = libasoundplugin.so # target lib
LIB1=lib1
PATH1=<path1>
LIB2=lib2
PATH2=<path2>
INCLUDE_FLAGS = -L$(PATH1) -l$(LIB1I) \
-L$(PATH2) -l$(LIB2) \
-lasound
SRCS = source.c
OBJS = $(SRCS:.c=.o)
.PHONY: all
all: ${TARGET_LIB}
$(TARGET_LIB): $(OBJS)
$(CC) ${LDFLAGS} ${INCLUDE_FLAGS} -o $# $^
$(SRCS:.c=.d):%.d:%.c
$(CC) $(CFLAGS) -MM $< >$#
include $(SRCS:.c=.d)
.PHONY: clean
clean:
-${RM} ${TARGET_LIB} ${OBJS} $(SRCS:.c=.d)
Thanks!
Is the BUILD_LDFLAGS the source of my problem?
No. BUILD_LDFLAGS is used to build native packages, while you build a target package. In your case TARGET_LDFLAGS variable will be used as LDFLAGS source.
Here is a copy of my recipe bb file
Where does it come from? Did you write it from a template?
As I can see there is a recipe for alsa plugins, maybe you can add your plugin to this recipe?
You can also take as example the recipe for a2jmidid, it is close to what you are trying to do as I understand. It does nothing special, except for setting dependencies, getting sources, adding certain ld flags and passing resulting files to the package.
Regarding the Makefile (I suppose it is also your recipe):
First of all there is no need to have a separate Makefile for yocto.
#Yocto will pass in the CC flag so this is commented out. Otherwise the correct compiler won't be used
#CC = gcc # C compiler
You are passing CC from your .bb recipe (even twice: via EXTRA_OEMAKE and in do_compile). There is no need to comment out CC variable, as definitions inside Makefile have lower priority compared to definitions passed as command line arguments.
Why do you need INCLUDE_FLAGS variable? I don't understand what does it do (except for passing to gcc some flags for the third time).
Ultimately, you can go to the workdir, open file temp/log.do_compile and you will see which commands were executed to compile your plugin. Compare it to the settings you use to compile it manually, and you will see what is the difference between successful and unsuccessful builds.
I have the luxury of dealing with the endless error and warning paradise that is OpenEmbedded. Good news is that I am finally getting somewhere with my recipe, but I am hitting an issue where my recipe is including include and library paths from my host machine. This as I am aware is unsafe for cross-compilation. Would any of you fine people take like quick look at my recipe and tell me if I'm doing anything dumb? I'd really appreciate it, as this is making me feel like I'm a complete moron.
Here's my OpenEmbedded Recipe:
#TODO fixup license type
#Built by Rob.
DESCRIPTION = "librem"
HOMEPAGE = ""
SECTION = "meta-miku"
DEPENDS = "zlib re"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
# This tells bitbake where to find the files we're providing on the local filesystem
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:"
S = "${WORKDIR}/rem-0.5.2"
INSANE_SKIP_${PN}-dev += "dev-elf"
#INSANE_SKIP_${PN} += "installed-vs-shipped"
SRC_URI = "https://github.com/creytiv/rem/archive/v0.5.2.tar.gz"
SRC_URI[md5sum] = "4d63ab174fb7957b6805fd0de6991fd2"
SRC_URI[sha256sum] = "cef1b29631a35926982502f0eecc0950d40d2585241d0598ff18e70e2dfcfcb6"
do_compile() {
oe_runmake ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST}"
}
do_install () {
oe_runmake install ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST}" DESTDIR=${D}${libdir}
install -d ${D}${libdir}/
install -m 0644 ${S}/librem.a ${D}${libdir}/librem.a
install -m 0644 ${S}/librem.so ${D}${libdir}/librem.so
install -d ${D}${libdir}/pkgconfig
install -m 0644 ${S}/librem.pc ${D}${libdir}/pkgconfig/librem.pc
}
And here are my warnings:
WARNING: rem-1.0-r0 do_package: QA Issue: rem: Files/directories were installed but not shipped in any package:
/usr/lib64/usr/include
/usr/lib64/usr/include/rem
/usr/lib64/usr/include/rem/rem_auconv.h
/usr/lib64/usr/include/rem/rem_fir.h
/usr/lib64/usr/include/rem/rem_aumix.h
/usr/lib64/usr/include/rem/rem_video.h
/usr/lib64/usr/include/rem/rem_audio.h
/usr/lib64/usr/include/rem/rem_vidconv.h
/usr/lib64/usr/include/rem/rem_dtmf.h
/usr/lib64/usr/include/rem/rem_aubuf.h
/usr/lib64/usr/include/rem/rem_au.h
/usr/lib64/usr/include/rem/rem_dsp.h
/usr/lib64/usr/include/rem/rem_vidmix.h
/usr/lib64/usr/include/rem/rem_vid.h
/usr/lib64/usr/include/rem/rem_goertzel.h
/usr/lib64/usr/include/rem/rem_auresamp.h
/usr/lib64/usr/include/rem/rem_autone.h
/usr/lib64/usr/include/rem/rem_g711.h
/usr/lib64/usr/include/rem/rem_aufile.h
/usr/lib64/usr/include/rem/rem.h
/usr/lib64/usr/lib/librem.a
/usr/lib64/usr/lib/librem.so
/usr/lib64/usr/lib/pkgconfig
/usr/lib64/usr/lib/pkgconfig/librem.pc
Please set FILES such that these items are packaged. Alternatively if they are unneeded, avoid installing them or delete them within do_install.
rem: 24 installed and not shipped files. [installed-vs-shipped]
WARNING: rem-1.0-r0 do_package_qa: QA Issue: rem: The compile log indicates that host include and/or library paths were used.
Please check the log '/media/rob/a72581e8-3ca3-4dc1-b3b8-6db5464de098/qc_openEmbedded/apps_proc/build/tmp-glibc/work/aarch64-linaro-linux/rem/1.0-r0/temp/log.do_compile' for more information. [compile-host-path]
WARNING: rem-1.0-r0 do_package_qa: QA Issue: No GNU_HASH in the elf binary: '/media/rob/a72581e8-3ca3-4dc1-b3b8-6db5464de098/qc_openEmbedded/apps_proc/build/tmp-glibc/work/aarch64-linaro-linux/rem/1.0-r0/packages-split/rem-dev/usr/lib64/librem.so' [ldflags]
NOTE: Tasks Summary: Attempted 420 tasks of which 407 didn't need to be rerun and all succeeded.
NOTE: Writing buildhistory
Summary: There were 4 WARNING messages shown.
It is exactly what the warning is telling you in your bitbake output warning. The files are processed and installed however there is no reference to them in the output hence why they are not shipped.
Please set FILES such that these items are packaged. Alternatively if
they are unneeded, avoid installing them or delete them within
do_install. rem: 24 installed and not shipped files.
[installed-vs-shipped]
Include the files in your Yocto recipe:
#TODO fixup license type
#Built by Rob.
DESCRIPTION = "librem"
HOMEPAGE = ""
SECTION = "meta-miku"
DEPENDS = "zlib re"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/MIT;md5=0835ade698e0bcf8506ecda2f7b4f302"
# This tells bitbake where to find the files we're providing on the local filesystem
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}-${PV}:"
S = "${WORKDIR}/rem-0.5.2"
INSANE_SKIP_${PN}-dev += "dev-elf"
#INSANE_SKIP_${PN} += "installed-vs-shipped"
SRC_URI = "https://github.com/creytiv/rem/archive/v0.5.2.tar.gz"
SRC_URI[md5sum] = "4d63ab174fb7957b6805fd0de6991fd2"
SRC_URI[sha256sum] = "cef1b29631a35926982502f0eecc0950d40d2585241d0598ff18e70e2dfcfcb6"
do_compile() {
oe_runmake ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST}"
}
do_install () {
oe_runmake install ROOT=${STAGING_DIR_HOST} OFLAGS="--sysroot=${STAGING_DIR_HOST}" DESTDIR=${D}${libdir}
install -d ${D}${libdir}/
install -m 0644 ${S}/librem.a ${D}${libdir}/librem.a
install -m 0644 ${S}/librem.so ${D}${libdir}/librem.so
install -d ${D}${libdir}/pkgconfig
install -m 0644 ${S}/librem.pc ${D}${libdir}/pkgconfig/librem.pc
}
FILES_${PN} += "\
/usr/lib64/usr/include \
/usr/lib64/usr/include/rem \
/usr/lib64/usr/include/rem/rem_auconv.h \
/usr/lib64/usr/include/rem/rem_fir.h \
/usr/lib64/usr/include/rem/rem_aumix.h \
/usr/lib64/usr/include/rem/rem_video.h \
/usr/lib64/usr/include/rem/rem_audio.h \
/usr/lib64/usr/include/rem/rem_vidconv.h \
/usr/lib64/usr/include/rem/rem_dtmf.h \
/usr/lib64/usr/include/rem/rem_aubuf.h \
/usr/lib64/usr/include/rem/rem_au.h \
/usr/lib64/usr/include/rem/rem_dsp.h \
/usr/lib64/usr/include/rem/rem_vidmix.h \
/usr/lib64/usr/include/rem/rem_vid.h \
/usr/lib64/usr/include/rem/rem_goertzel.h \
/usr/lib64/usr/include/rem/rem_auresamp.h \
/usr/lib64/usr/include/rem/rem_autone.h \
/usr/lib64/usr/include/rem/rem_g711.h \
/usr/lib64/usr/include/rem/rem_aufile.h \
/usr/lib64/usr/include/rem/rem.h \
/usr/lib64/usr/lib/librem.a \
/usr/lib64/usr/lib/librem.so \
/usr/lib64/usr/lib/pkgconfig \
/usr/lib64/usr/lib/pkgconfig/librem.pc \
"
or alternatively the easier way would just be to use a wildcard which catches everything
FILES_${PN} += "/usr/lib64/usr/*"
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?
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.