ZM-1.34 - porting to OpenWrt

Forum for questions and support relating to 1.33.x development only.
Locked
rossbcan
Posts: 15
Joined: Tue Aug 20, 2019 1:25 pm

ZM-1.34 - porting to OpenWrt

Post by rossbcan »

Folks;

I am in process of porting ZM to OpenWrt (x86_64); part of this product portfolio: https://www.rossco.org

got past all the dependencies, config fails:

./zmconfgen.pl: Perl lib version (5.28.1) doesn't match executable '/usr/bin/perl' version (5.16.3) at /home/rossb/OpenWrt/x86_64/r10508/openwrt/staging_dir/target-x86_64_glibc/root-x86/usr/lib/perl5/5.28/Config.pm line 51

config seems to be detecting my system as opposed to openwrt perl, despite these Makefile settings:

CMAKE_OPTIONS += -DPERL_EXECUTABLE=$(STAGING_DIR_HOSTPKG)/usr/bin/perl$(PERL_VERSION) - correct perl executable
export PERL5LIB:=$(STAGING_DIR_ROOT)/usr/lib/perl$(PERL_MAJOR)/$(PERL_VERSION2) - correct perl libs
export PATH:=$(STAGING_DIR_HOSTPKG)/usr/bin:$(PATH) - point to correct perl path first

commenting /staging_dir/target-x86_64_glibc/root-x86/usr/lib/perl5/5.28/Config.pm:
#$^V eq 5.28.1
# or die sprintf "%s: Perl lib version (5.28.1) doesn't match executable '$^X' version (%vd)", $0, $^V;

gets past this, to:
[ 96%] Building ZoneMinder perl modules
Can't load '/home/rossb/OpenWrt/x86_64/r10508/openwrt/staging_dir/target-x86_64_glibc/root-x86/usr/lib/perl5/5.28/auto/Cwd/Cwd.so' for module Cwd: /home/rossb/OpenWrt/x86_64/r10508/openwrt/staging_dir/target-x86_64_glibc/root-x86/usr/lib/perl5/5.28/auto/Cwd/Cwd.so: undefined symbol: Perl_xs_boot_epilog at /home/rossb/OpenWrt/x86_64/r10508/openwrt/staging_dir/target-x86_64_glibc/root-x86/usr/lib/perl5/5.28/XSLoader.pm line 87

The missing symbol (Perl_xs_boot_epilog) is from libperl.so or built in to perl
nm -a staging_dir/hostpkg/usr/bin/perl | grep Perl_xs_boot_epilog
0000000000447b30 T Perl_xs_boot_epilog

...an indication that the first failure was correct: ZM is using system as opposed to openwrt perl.

So; how do I tell ZM to use the correct perl?

Thanks;
Bill
rossbcan
Posts: 15
Joined: Tue Aug 20, 2019 1:25 pm

Re: ZM-1.34 - porting to OpenWrt

Post by rossbcan »

Successful ZM build:
touch /home/rossb/OpenWrt/x86_64/r10508/openwrt/staging_dir/target-x86_64_glibc/stamp/.zoneminder_installed
make[2]: Leaving directory `/home/rossb/OpenWrt/x86_64/r10508/openwrt/Custom/new/zoneminder'

What I had to do was (temporarily break my build host perl) and undo the Config.pm comments above:
mv /usr/bin/perl /usr/bin/perl_orig
ln -sf /home/rossb/OpenWrt/x86_64/r10508/openwrt/staging_dir/hostpkg/usr/bin/perl5.28.1 /usr/bin/perl

However ZM make hardcodes perl, it is unacceptable for cross compile

In addition to needing an answer how to configure ZM to use an alternate perl...

I suggest the developers create two variables (in config file., cmake variables or env):
TARGET_PERL and HOST_PERL, both defaulting to "/usr/bin/perl" to maintain existing behavior

this will fix cross-compile.

Regards;
Bill
rockedge
Posts: 1173
Joined: Fri Apr 04, 2014 1:46 pm
Location: Connecticut,USA

Re: ZM-1.34 - porting to OpenWrt

Post by rockedge »

good idea with the TARGET_PERL and HOST_PERL
rossbcan
Posts: 15
Joined: Tue Aug 20, 2019 1:25 pm

Re: ZM-1.34 - porting to OpenWrt

Post by rossbcan »

or just use first perl found in path for compile, leave at /usr/bin/perl for target executables / scripts...
User avatar
iconnor
Posts: 2862
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: ZM-1.34 - porting to OpenWrt

Post by iconnor »

I'll take a look at that. Keep us posted about the port.
rossbcan
Posts: 15
Joined: Tue Aug 20, 2019 1:25 pm

Re: ZM-1.34 - porting to OpenWrt

Post by rossbcan »

Still need a fix for specifying build perl path.

Status - Integration testing onvf: no response:

root@SecureOffice:~# /usr/bin/zmonvif-probe.pl -v probe
Name "ZoneMinder::ONVIF::verbose" used only once: possible typo at /usr/bin/zmonvif-probe.pl line 81.
Probing for SOAP 1.1
<Fault xmlns="http://schemas.xmlsoap.org/soap/envelop ... ring>Error sending / receiving message: Timed out waiting for response</faultstring><faultactor>urn:localhost</faultactor></Fault>
Probing for SOAP 1.2
<Fault xmlns="http://schemas.xmlsoap.org/soap/envelop ... ring>Error sending / receiving message: Timed out waiting for response</faultstring><faultactor>urn:localhost</faultactor></Fault>

I have multiple ethernet interfaces. May need to modify zmonvif-probe.pl to specify multicast interface?

Regards;
Bill
rossbcan
Posts: 15
Joined: Tue Aug 20, 2019 1:25 pm

Re: ZM-1.34 - porting to OpenWrt

Post by rossbcan »

I am at the point where an IP camera is streaming to ZM and can see the packet traffic in firefox console, but no video.

Suspect I am missing a dependency. Anyone have a current dependency list?

Compiled https://github.com/ZoneMinder/zoneminder.git version e390195ebbcd21bf0ca96dd400811c22ca1773cc (master, downloaded Aug 14) from source

To create a dependency list (on as new a distribution as possible):

ubuntu: apt-cache depends zoneminder

Thanks;
Bill
ramponis
Posts: 1
Joined: Wed Jan 22, 2020 2:22 pm

Re: ZM-1.34 - porting to OpenWrt

Post by ramponis »

Hi rossbcan, can you share your make file?
I'm interested to use it on my openwrt x86

Thank you
Locked