compile zoneminder openembedded based accomplished

Forum for questions and support relating to the 1.26.x releases only.
Locked
WayneM
Posts: 6
Joined: Tue Dec 10, 2013 3:25 pm

compile zoneminder openembedded based accomplished

Post by WayneM »

Hi guys.

I was using yocto poky to cross-compile a rootfs including ZoneMinder, and I got some errors.

I hope someone can together with me workout this if you are interested too. thanks in advance.

My board has a SoC with ARM Cortex-A8.

I cloned the following extra meta(I replaced the "." using "#" for the spamy warning here):

Code: Select all

 git://git#openembedded#org/meta-openembedded
and move all its folders to upfolder, that is, under poky folder.


I defined a new machine at

Code: Select all

poky/meta-myplatform/conf/machine/myboard.conf
its content (refering RaspberryPi):

Code: Select all

require conf/machine/include/tune-cortexa8.inc
IMAGE_FSTYPES ?= "tar.bz2 ext3"
KERNEL_IMAGETYPE = "Image"
MACHINE_EXTRA_RRECOMMENDS += " /
	kernel-modules /
"
and its layer file:

Code: Select all

poky/meta-myplatform/conf/layer.conf
its content:

Code: Select all

# We have a conf and classes directory, append to BBPATH
BBPATH .= ":${LAYERDIR}"

# We have a recipes directory containing .bb and .bbappend files, add to BBFILES
BBFILES += "${LAYERDIR}/recipes*/*/*.bb /
            ${LAYERDIR}/recipes*/*/*.bbappend"

BBFILE_COLLECTIONS += "myplatform"
BBFILE_PATTERN_myplatform := "^${LAYERDIR}/"
BBFILE_PRIORITY_myplatform = "6"

# Additional license directories.
LICENSE_PATH += "${LAYERDIR}/files/custom-licenses"
I wrote the bb file for ZoneMinder at:

Code: Select all

poky/meta-myplatform/recipes-apps/ZoneMinder/ZoneMinder_1.30.0.bb
Actually I used the latest version of ZoneMinder from GitHub, not the real version 1.30.0. I download the tag.gz package manually and renamed it under the folder "poky/build/downloads".

the content of the bb file:

Code: Select all

# replace the "." using "#" here for the spamy warning
HOMEPAGE = "http#//www#zoneminder#com/"
LICENSE = "GPLv2"

DESCRIPTION = "the top Linux video camera security and surveillance solution."

LIC_FILES_CHKSUM = "file://COPYING;md5=94d55d512a9ba36caa9b7df079bae19f "
# replace the "." using "#" here for the spamy warning
SRC_URI = "http#//www2#zoneminder#com/downloads/ZoneMinder-${PV}.tar.gz"
SRC_URI[md5sum] = "f08beae90e7336ac704021a3716daa4c"

inherit autotools pkgconfig 

DEPENDS += "apache2 modphp libgcrypt libav openssl perl libdbi-perl jpeg"
RDEPENDS_${PN} += "apache2 modphp libgcrypt libav openssl perl libdbi-perl jpeg"

#I use the absolute path here for --with-mysql and --with-ffmpeg
EXTRA_OECONF = "--with-libarch=lib --with-mysql=/home/xyz/work/poky/build/tmp/sysroots/myboard/usr/ --with-ffmpeg=/home/xyz/work/poky/build/tmp/sysroots/myboard/usr/ --with-webdir=/var/www/html --with-cgidir=/var/www/cgi-bin --with-webuser=www-data --with-webgroup=www-data --enable-debug=yes ZM_SSL_LIB=openssl"
I wrote the image bb file at:

Code: Select all

poky/meta-myplatform/recipes-core/images/myboard-test-image.bb
its content:

Code: Select all

include recipes-core/images/core-image-minimal.bb
DEPENDS += "ZoneMinder"
I modified the default bblayers.conf file:

Code: Select all

poky/build/conf/bblayers.conf
add the following lines:

Code: Select all

BBLAYERS += "/home/xyz/work/poky/meta-myplatform"
BBLAYERS += "/home/xyz/work/poky/meta-oe"
BBLAYERS += "/home/xyz/work/poky/meta-perl"
BBLAYERS += "/home/xyz/work/poky/meta-webserver"
BBLAYERS += "/home/xyz/work/poky/meta-multimedia"
I modified the default local.conf under "build" folder after executing "source oe-init-build-env":

Code: Select all

poky/build/conf/local.conf

I modified the following lines as:

Code: Select all

MACHINE ??= "myboard"
PACKAGE_CLASSES ?= "package_ipk"
and add this line:

Code: Select all

LICENSE_FLAGS_WHITELIST = "commercial"
and then I began to build:

Code: Select all

bitbake myboard-test-image

the errors I got (the 1-4 was fixed or found a workaround) :

1.
the compiled native perl was not correctly found by the ZoneMinder building proccess but found the perl in host Ubuntu, so I had to install the perl modules manually using CPAN as workaround, including DBI, DBD::mysql, Date::Manip, LWP::UserAgent, Sys::Mmap.

2.

Code: Select all

ERROR: This autoconf log indicates errors, it looked at host include and/or library paths while determining system capabilities.
then I used absolute path here for --with-mysql and --with-ffmpeg, as EXTRA_OECONF defined in the bb file.

3. compiling errors in zm_image.cpp
I commented the SSE instructions for x86 CPU using conditional compilation temporarily.

Code: Select all

#if ((defined(__i386__) || defined(__x86_64__) || defined(ZM_KEEP_SSE)) && !defined(ZM_STRIP_SSE))  
.....
#endif
4. compiling error in zm_signal.cpp
add these lines after line 67:

Code: Select all

#elif defined(__arm__)
		cr2 = info->si_addr;
		ip = (void *)(uc->uc_mcontext.arm_ip);
5.
this is the last error during the task do_package near the end of the whole building proccess:

Code: Select all

ERROR: QA Issue: ZoneMinder: Files/directories were installed but not shipped
  /tmp
  /run
  /tmp/zm
  /usr/share
  /usr/man
  /usr/lib
  /usr/share/zoneminder
  /usr/share/perl
  /usr/share/zoneminder/db
  /usr/share/zoneminder/db/zm_update-1.21.3.sql
  /usr/share/zoneminder/db/zm_update-1.24.1.sql
  /usr/share/zoneminder/db/zm_update-1.19.0.sql
  /usr/share/zoneminder/db/zm_update-1.19.3.sql
  /usr/share/zoneminder/db/zm_update-1.23.1.sql
  /usr/share/zoneminder/db/zm_update-1.21.2.sql
  /usr/share/zoneminder/db/zm_update-0.9.7.sql
  /usr/share/zoneminder/db/zm_update-1.19.4.sql
  /usr/share/zoneminder/db/zm_update-1.18.0.sql
  /usr/share/zoneminder/db/zm_update-0.9.12.sql
  /usr/share/zoneminder/db/zm_update-0.9.15.sql
  /usr/share/zoneminder/db/zm_update-1.22.0.sql
  /usr/share/zoneminder/db/zm_update-1.26.1.sql
  /usr/share/zoneminder/db/zm_update-1.23.0.sql
  /usr/share/zoneminder/db/zm_update-1.24.3.sql
  /usr/share/zoneminder/db/zm_update-1.26.3.sql
  /usr/share/zoneminder/db/zm_update-1.24.2.sql
  /usr/share/zoneminder/db/zm_update-0.9.8.sql
  /usr/share/zoneminder/db/zm_update-0.9.9.sql
  /usr/share/zoneminder/db/zm_update-1.21.4.sql
  /usr/share/zoneminder/db/zm_update-1.19.1.sql
  /usr/share/zoneminder/db/zm_update-0.9.10.sql
  /usr/share/zoneminder/db/zm_update-0.9.11.sql
  /usr/share/zoneminder/db/zm_update-1.17.2.sql
  /usr/share/zoneminder/db/zm_update-1.26.0.sql
  /usr/share/zoneminder/db/zm_update-1.23.2.sql
  /usr/share/zoneminder/db/zm_update-1.26.2.sql
  /usr/share/zoneminder/db/zm_update-0.0.1.sql
  /usr/share/zoneminder/db/zm_update-1.21.1.sql
  /usr/share/zoneminder/db/zm_update-1.24.0.sql
  /usr/share/zoneminder/db/zm_create.sql
  /usr/share/zoneminder/db/zm_update-1.17.1.sql
  /usr/share/zoneminder/db/zm_update-1.21.0.sql
  /usr/share/zoneminder/db/zm_update-0.9.16.sql
  /usr/share/zoneminder/db/zm_update-1.22.3.sql
  /usr/share/zoneminder/db/zm_update-0.9.13.sql
  /usr/share/zoneminder/db/zm_update-1.23.3.sql
  /usr/share/zoneminder/db/zm_update-1.18.1.sql
  /usr/share/zoneminder/db/zm_update-1.22.2.sql
  /usr/share/zoneminder/db/zm_update-1.20.0.sql
  /usr/share/zoneminder/db/zm_update-1.20.1.sql
  /usr/share/zoneminder/db/zm_update-1.24.4.sql
  /usr/share/zoneminder/db/zm_update-1.19.5.sql
  /usr/share/zoneminder/db/zm_update-1.19.2.sql
  /usr/share/zoneminder/db/zm_update-1.22.1.sql
  /usr/share/perl/5.14.2
  /usr/share/perl/5.14.2/ZoneMinder.pm
  /usr/share/perl/5.14.2/ZoneMinder
  /usr/share/perl/5.14.2/ZoneMinder/ConfigData.pm
  /usr/share/perl/5.14.2/ZoneMinder/Config.pm
  /usr/share/perl/5.14.2/ZoneMinder/Logger.pm
  /usr/share/perl/5.14.2/ZoneMinder/General.pm
  /usr/share/perl/5.14.2/ZoneMinder/Base.pm
  /usr/share/perl/5.14.2/ZoneMinder/Control.pm
  /usr/share/perl/5.14.2/ZoneMinder/ConfigAdmin.pm
  /usr/share/perl/5.14.2/ZoneMinder/Database.pm
  /usr/share/perl/5.14.2/ZoneMinder/Memory.pm
  /usr/share/perl/5.14.2/ZoneMinder/Trigger
  /usr/share/perl/5.14.2/ZoneMinder/Control
  /usr/share/perl/5.14.2/ZoneMinder/Memory
  /usr/share/perl/5.14.2/ZoneMinder/Trigger/Connection.pm
  /usr/share/perl/5.14.2/ZoneMinder/Trigger/Channel.pm
  /usr/share/perl/5.14.2/ZoneMinder/Trigger/Channel
  /usr/share/perl/5.14.2/ZoneMinder/Trigger/Connection
  /usr/share/perl/5.14.2/ZoneMinder/Trigger/Channel/Inet.pm
  /usr/share/perl/5.14.2/ZoneMinder/Trigger/Channel/Serial.pm
  /usr/share/perl/5.14.2/ZoneMinder/Trigger/Channel/Spawning.pm
  /usr/share/perl/5.14.2/ZoneMinder/Trigger/Channel/Unix.pm
  /usr/share/perl/5.14.2/ZoneMinder/Trigger/Channel/File.pm
  /usr/share/perl/5.14.2/ZoneMinder/Trigger/Channel/Handle.pm
  /usr/share/perl/5.14.2/ZoneMinder/Trigger/Connection/Example.pm
  /usr/share/perl/5.14.2/ZoneMinder/Control/PanasonicIP.pm
  /usr/share/perl/5.14.2/ZoneMinder/Control/FI9821W_Y2k.pm
  /usr/share/perl/5.14.2/ZoneMinder/Control/FI8620_Y2k.pm
  /usr/share/perl/5.14.2/ZoneMinder/Control/FI8608W_Y2k.pm
  /usr/share/perl/5.14.2/ZoneMinder/Control/LoftekSentinel.pm
  /usr/share/perl/5.14.2/ZoneMinder/Control/Visca.pm
  /usr/share/perl/5.14.2/ZoneMinder/Control/PelcoD.pm
  /usr/share/perl/5.14.2/ZoneMinder/Control/SkyIPCam7xx.pm
  /usr/share/perl/5.14.2/ZoneMinder/Control/AxisV2.pm
  /usr/share/perl/5.14.2/ZoneMinder/Control/Ncs370.pm
  /usr/share/perl/5.14.2/ZoneMinder/Control/mjpgStreamer.pm
  /usr/share/perl/5.14.2/ZoneMinder/Memory/Shared.pm
  /usr/share/perl/5.14.2/ZoneMinder/Memory/Mapped.pm
  /usr/man/man3
  /usr/man/man3/ZoneMinder::Control::FI8620_Y2k.3pm
  /usr/man/man3/ZoneMinder::General.3pm
  /usr/man/man3/ZoneMinder::Control::AxisV2.3pm
  /usr/man/man3/ZoneMinder::Database.3pm
  /usr/man/man3/ZoneMinder::Control::FI8608W_Y2k.3pm
  /usr/man/man3/ZoneMinder::Trigger::Channel::Inet.3pm
  /usr/man/man3/ZoneMinder::Control::Ncs370.3pm
  /usr/man/man3/ZoneMinder::Config.3pm
  /usr/man/man3/ZoneMinder::Control::PanasonicIP.3pm
  /usr/man/man3/ZoneMinder::Control::PelcoD.3pm
  /usr/man/man3/ZoneMinder::Trigger::Channel::Spawning.3pm
  /usr/man/man3/ZoneMinder::Trigger::Connection::Example.3pm
  /usr/man/man3/ZoneMinder::Control::FI9821W_Y2k.3pm
  /usr/man/man3/ZoneMinder::Control::Visca.3pm
  /usr/man/man3/ZoneMinder::Control::SkyIPCam7xx.3pm
  /usr/man/man3/ZoneMinder::Logger.3pm
  /usr/man/man3/ZoneMinder::Control.3pm
  /usr/man/man3/ZoneMinder::Trigger::Channel::File.3pm
  /usr/man/man3/ZoneMinder::Trigger::Channel::Serial.3pm
  /usr/man/man3/ZoneMinder::Trigger::Channel::Unix.3pm
  /usr/man/man3/ZoneMinder::ConfigData.3pm
  /usr/man/man3/ZoneMinder::Memory.3pm
  /usr/man/man3/ZoneMinder.3pm
  /usr/man/man3/ZoneMinder::Control::mjpgStreamer.3pm
  /usr/man/man3/ZoneMinder::Trigger::Channel::Handle.3pm
  /usr/man/man3/ZoneMinder::ConfigAdmin.3pm
  /usr/man/man3/ZoneMinder::Trigger::Channel.3pm
  /usr/man/man3/ZoneMinder::Base.3pm
  /usr/man/man3/ZoneMinder::Trigger::Connection.3pm
  /usr/lib/perl
  /usr/lib/perl/5.14.2
  /usr/lib/perl/5.14.2/perllocal.pod
  /usr/lib/perl/5.14.2/auto
  /usr/lib/perl/5.14.2/auto/ZoneMinder
  /usr/lib/perl/5.14.2/auto/ZoneMinder/.packlist
  /run/zm
ERROR: QA Issue: non debug package contains .debug directory: ZoneMinder path /work/armv7a-vfp-neon-poky-linux-gnueabi/ZoneMinder/1.30.0-r0/packages-split/ZoneMinder/var/www/cgi-bin/.debug/zms
ERROR: QA Issue: non debug package contains .debug directory: ZoneMinder path /work/armv7a-vfp-neon-poky-linux-gnueabi/ZoneMinder/1.30.0-r0/packages-split/ZoneMinder/var/www/cgi-bin/.debug/nph-zms
ERROR: QA run found fatal errors. Please consider fixing them.
ERROR: Function failed: do_package_qa
ERROR: Logfile of failure stored in: /home/xyz/work/poky/build/tmp/work/armv7a-vfp-neon-poky-linux-gnueabi/ZoneMinder/1.30.0-r0/temp/log.do_package.18516
ERROR: Task 234 (/home/xyz/work/poky/meta-myplatform/recipes-apps/ZoneMinder/ZoneMinder_1.30.0.bb, do_package) failed with exit code '1'
NOTE: Tasks Summary: Attempted 1829 tasks of which 1794 didn't need to be rerun and 1 failed.
No currently running tasks (1828 of 2383)

Summary: 1 task failed:
  /home/xyz/work/poky/meta-myplatform/recipes-apps/ZoneMinder/ZoneMinder_1.30.0.bb, do_package
Summary: There were 5 ERROR messages shown, returning a non-zero exit code.
Last edited by WayneM on Fri Dec 13, 2013 4:11 am, edited 2 times in total.
WayneM
Posts: 6
Joined: Tue Dec 10, 2013 3:25 pm

Re: compile zoneminder based openembedded

Post by WayneM »

the 5th error was fixed by adding some lines into zoneminder.bb.

Code: Select all

FILES_${PN} += "\
	${libdir}/perl \
	${datadir}/perl \	
	/tmp \
	/run \"

FILES_${PN}-doc += "\
	/usr/man \"

FILES_${PN}-dbg += "\
	/var/www/cgi-bin/.debug/zms \	
	/var/www/cgi-bin/.debug/nph-zms \"
WayneM
Posts: 6
Joined: Tue Dec 10, 2013 3:25 pm

Re: compile zoneminder based openembedded

Post by WayneM »

the 2nd error was fixed by using the system variable STAGING_DIR_HOST, ie:

Code: Select all

--with-mysql=${STAGING_DIR_HOST}/usr/ --with-ffmpeg=${STAGING_DIR_HOST}/usr/ 
PacoLM
Posts: 971
Joined: Wed Dec 02, 2009 9:55 pm
Location: Spain

Re: compile zoneminder based openembedded

Post by PacoLM »

Impressive work!

After more than 15 years, no longer using ZM as surveillance system.
Now in the dark side, using a commercial system...
Locked