do_rootfs failed on yocto build - yocto

I have integrated a makefile based project into custom recipes within yocto but there was an issue: do_rootfs failed.
Please find library source and I try to integrate this library into oe-core: http://libiec61850.com/libiec61850/wp-content/uploads/2016/02/libiec61850-0.9.0.2.tgz
.bb file:
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
DESCRIPTION = "simple Hello World program" PR = "r0" LICENSE = "CLOSED"
S = "${WORKDIR}"
DEPEND = "libpthread-stubs libiec61883 libraw1394" SRC_URI += " \
file://config \
file://demos \
file://dotnet \
file://examples \
file://make \
file://Makefile \
file://src \
file://third_party \
file://tools \
"
EXTRA_OEMAKE = "'CC=${CC}' 'RANLIB=${RANLIB}' 'AR=${AR}' 'CFLAGS=${CFLAGS} -I${S}/include -DWITHOUT_XATTR' 'BUILDDIR=${S}'"
do_compile() {
oe_runmake ${S}/make } do_install () {
oe_runmake install DESTDIR=${D} SBINDIR=${sbindir} MANDIR=${mandir} \
INCLUDEDIR=${includedir}
install -d ${D}${includedir}/libiec61850/
install -d ${D}${localedir}
for f in ${S}/.install/include/*.h; do
install -m 0644 $f ${D}${includedir}/libiec61850/
done
install -m 0644 ${S}/.install/lib/* ${D}${localedir}/ }
The error looks like:
Configuring volatile-binds.
Configuring libxcb-xkb1.
Configuring libxkbcommon.
Configuring libidn11.
Configuring libattr1.
Configuring libacl1.
Configuring libz1.
Configuring libkmod2.
Configuring udev.
Configuring kmod.
Configuring iptables.
Configuring libcap2.
Configuring liblzma5.
Configuring util-linux-fsck.
Configuring systemd-compat-units.
Configuring systemd-serialgetty.
Configuring angstrom-version.
Configuring udev-hwdb.
Configuring libe2p2.
Configuring libext2fs2.
Configuring e2fsprogs-e2fsck.
Configuring systemd.
Configuring kernel-image-4.1.15-v2.5b3+ge6d111c.
Configuring angstrom-feed-configs.
Configuring netbase.
Configuring packagegroup-core-boot.
Collected errors:
* opkg_install_cmd: Cannot install package libiec61850.
ERROR: Function failed: do_rootfs
ERROR: Logfile of failure stored in: /media/kanji/edb1a7c2-288e-488e-abce-24d478f6cd46/workspace/kanji/oe-core/build/out-glibc/work/colibri_vf-angstrom-linux-gnueabi/core-image-minimal/1.0-r0/temp/log.do_rootfs.8560
ERROR: Task 7 (/media/kanji/edb1a7c2-288e-488e-abce-24d478f6cd46/workspace/kanji/oe-core/build/../stuff/openembedded-core/meta/recipes-core/images/core-image-minimal.bb, do_rootfs) failed with exit code '1'
NOTE: Tasks Summary: Attempted 1865 tasks of which 1864 didn't need to be rerun and 1 failed.
NOTE: Writing buildhistory
No currently running tasks (1864 of 1866)
Summary: 1 task failed:
/media/kanji/edb1a7c2-288e-488e-abce-24d478f6cd46/workspace/kanji/oe-core/build/../stuff/openembedded-core/meta/recipes-core/images/core-image-minimal.bb, do_rootfs
Summary: There was 1 WARNING message shown.
Summary: There were 2 ERROR messages shown, returning a non-zero exit code.

It's hard to provide an exact answer here as there's a few things which are likely wrong or at least problematic. So lets work backwards:
Collected errors: * opkg_install_cmd: Cannot install package libiec61850.
This means that when installing the list of packages it could not find a literal libiec61850 file. I assume that you created libiec61850_0.9.0.2.bb and that is what the bb file contents above represent. Aside from whitepace problems that I assume are due to copy/paste into here, it looks OK. But check out the log.do_compile and log.do_install To make it easier to see if there were any problems building just that package, do:
bitbake -c cleansstate libiec61850
bitbake libiec61850
and see if it complains about empty packages.
Next, you may be having a problem with recipe name -> binary output renames. Do:
ls tmp/deploy/ipk/*/*iec61850*
And see what the results are. If you would like to examine the contents of a particular ipk file they are just 'ar' archives so you can extract them:
mkdir temp
cd temp
ar -x ../foo.ipk
tar zxf data.tar.gz

I had find the solution of above mention issue :
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"
FILESEXTRAPATHS_prepend := "${THISDIR}/files:"
DESCRIPTION = "libiec61850 library support added"
PR = "r0"
LICENSE = "CLOSED"
S = "${WORKDIR}"
SRC_URI += " \
file://config \
file://demos \
file://dotnet \
file://examples \
file://make \
file://Makefile \
file://src \
file://third_party \
file://tools \
"
DEPEND = "libpthread-stubs"
RDEPENDS_${PN} += " \
update-alternatives-opkg \
opkg-arch-config \
run-postinsts \
"
EXTRA_OEMAKE = "'CC=${CC}' 'RANLIB=${RANLIB}' 'AR=${AR}' 'CFLAGS=${CFLAGS} -I${S}/include -DWITHOUT_XATTR' 'BUILDDIR=${S}'"
do_compile() {
oe_runmake ${S}/make
}
do_install () {
oe_runmake install DESTDIR=${D} SBINDIR=${sbindir} MANDIR=${mandir} \
INCLUDEDIR=${includedir}
install -d ${D}${includedir}/libiec61850/
install -d ${D}${libdir}/
for f in ${S}/.install/include/*.h; do
install -m 0644 $f ${D}${includedir}/libiec61850/
done
install -m 0644 ${S}/.install/lib/* ${D}${libdir}/
}
FILES_${PN} += "${includedir}/libiec61850/* ${libdir}/*"
PACKAGES = "${PN}"

Related

Bitbake service file organization

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

Old version of library is included in image after updating bitbake file

After updating dotnet-runtime in our Yocto based Linux distribution to version 2.1.12, I saw that the resulting image had increased significantly in size. On closer inspection i found that the image contained both the new 2.1.12 version and the older 2.1.11 version of the dotnet-runtime library. How can I ensure that older version are not included in the image? Do I have to change more that just the SRC_URI and checksum?
Here is the content of dotnet-runtime.bb
DESCRIPTION = ".NET Core Runtime, SDK & CLI tools"
HOMEPAGE = "https://www.microsoft.com/net/core"
LICENSE = "MIT"
LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=42b611e7375c06a28601953626ab16cb"
COMPATIBLE_HOST ?= "x86_64.*-linux"
RDEPENDS_${PN} = "glibc zlib libunwind icu libcurl openssl krb5 libgssglue"
INSANE_SKIP_${PN} += "already-stripped staticdev file-rdeps libdir"
INHIBIT_PACKAGE_STRIP = "1"
INHIBIT_SYSROOT_STRIP = "1"
INHIBIT_PACKAGE_DEBUG_SPLIT = "1"
SRC_URI = "https://download.visualstudio.microsoft.com/download/pr/c1b620fe-7d8e-4685-b6ae-82b444dbc7a7/3d5610f0607da49ee014c61c6cd4e9af/aspne
tcore-runtime-2.1.12-linux-x64.tar.gz"
SRC_URI[sha256sum] = "cdb8816a437de168b25500b14ea32169abe610675ced08ca31f77f9542c2149a"
S = "${WORKDIR}"
do_install() {
install -d ${D}${bindir}
install -d ${D}${datadir}/dotnet
install -d ${D}${datadir}/dotnet/host/
install -d ${D}${datadir}/dotnet/shared/
install -m 0755 ${S}/dotnet ${D}${datadir}/dotnet
install -m 0644 ${S}/LICENSE.txt ${D}${datadir}/dotnet
install -m 0644 ${S}/ThirdPartyNotices.txt ${D}${datadir}/dotnet
cp -r --no-preserve=ownership ${S}/host/ ${D}${datadir}/dotnet/
cp -r --no-preserve=ownership ${S}/shared/ ${D}${datadir}/dotnet/
# Symlinks
cd ${D}${bindir}
ln -s ../../${datadir}/dotnet/dotnet dotnet || true
}
FILES_${PN} = "\
${bindir}/dotnet \
${datadir}/dotnet/ \
"
You might need to clean the cache of the recipe.
Just run:
$ bitbake -c clean {recipe name}
Then build your image again.
Hope it helps.
Adding the version number to the bitbake file, dotnet-runtime_2.1.12.bb instead of dotnet-runtime.bb, solved the issue.
Info about recipe naming http://www.embeddedlinux.org.cn/OEManual/recipes_versioning.html

Bitbake not installing files from recipe to rootfs

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 ."

Yocto/OpenEmbedded Recipe Including library paths from host

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/*"

Bitbake does not install my files in my rootfs

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.