add libudev on imx28

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

add libudev on imx28

4,319 Views
Sjoon
Contributor II

Hi,

 

I need the libudev library on the imx28. In ltib I can only add udev, but not libudev. How can I add this library?

 

I need this library so I can monitor USB-stick insertion in my c application. If anyone can point me to an alternative to do this, that would also help me!

 

Thanks!

Tags (1)
11 Replies

1,887 Views
syedahmed
Contributor I

hi,

i am trying to cross compile libudev-dev package for IMX258.

i am using this package for detection of smart card insertion and removal. i am using pcsc-lite package which used libudev package.

ltib is already having udev-117 package, after this version udev package is been changed. i had verified udev-151 is working fine with pcsc-lite on ubuntu machine. but when i tried to cross compile udev-151 package. it is giving errors.

libudev/libudev-monitor.c: In function 'udev_monitor_new_from_socket':

libudev/libudev-monitor.c:142: error: 'SOCK_CLOEXEC' undeclared (first use in this function)

libudev/libudev-monitor.c:142: error: (Each undeclared identifier is reported only once

libudev/libudev-monitor.c:142: error: for each function it appears in.)

libudev/libudev-monitor.c: In function 'udev_monitor_new_from_netlink':

libudev/libudev-monitor.c:199: error: 'SOCK_CLOEXEC' undeclared (first use in this function)

make[2]: *** [libudev/libudev-monitor.lo] Error 1

please tell me which version i can use and is stable.

thanks in advance

0 Kudos

1,887 Views
syedmuqthyar
Contributor II

i had overcome the issue by using updated toolchain. gcc-4.4.4-glibc-2.11.1-multilib-1.0. Thanks

0 Kudos

1,887 Views
Andrew1z
Contributor I

./ltib -m shell

mkdir addons

cd  addons

wget http://repository.timesys.com/buildsources/u/udev/udev-117/udev-117.tar.gz

tar zxvf udev-117.tar.gz

cd udev-117

edit Makefile and add at beginning: GCC=arm-linux-gcc

make

and voila:

LTIB> ls -ln lib*
-rw-rw-r-- 1 1029 1016 301238 Feb 29 10:43 libudev.a

0 Kudos

1,887 Views
Sjoon
Contributor II

Anyone that knows an alternative to libudev?

0 Kudos

1,887 Views
Sjoon
Contributor II
I can't get it to work... Any help from freescale?
0 Kudos

1,887 Views
gatelogic
Contributor I

You could get the source from here, perhaps:

http://packages.debian.org/sid/libudev-dev

 

Look under the "Download source package" section on the right-hand side of the page.

0 Kudos

1,887 Views
KrishnaPavan
Contributor II

Ohh!  Sorry!

 

Sorry! I misinterpreted @Vladan Jovanovic.

0 Kudos

1,887 Views
VladanJovanovic
NXP Employee
NXP Employee

synapticPM doesn't work when he needs a cross-compiled libudev that runs on i.MX, not on his host PC.

 


Krishna Pavan said:

I think the simplest way is to install the ' libudev' package from the synapticPM, If you are working on linux.......!
0 Kudos

1,887 Views
KrishnaPavan
Contributor II
I think the simplest way is to install the ' libudev' package from the synapticPM, If you are working on linux.......!
0 Kudos

1,887 Views
Sjoon
Contributor II
I need the URL of the libudev library for this. Where can I find it?
0 Kudos

1,887 Views
TerryLv
Contributor II

Hi,

  Pls try following steps:

  1. Create libudev directory in dist/lfs-5.1/.

  2. Create libudev spec file libudev.spec.

  3. Edit libudev.spec. Add something like:

%define pfx /opt/freescale/rootfs/%{_target_cpu}

Summary         : A library for udev Name            : libogg
Version         : 1.0.0
Release         : 1
License         : BSD
Vendor          : Freescale
Packager        : Terry Lv
Group           : System Environment/Libraries
Source          : %{name}-%{version}.tar.gz
BuildRoot       : %{_tmppath}/%{name}
Prefix          : %{pfx}
URL             : http://xxxx

%Description
%{summary}

%Prep
%setup

%Build
./configure --prefix=%{_prefix} --host=$CFGHOST --build=%{_build} --mandir=%{_mandir}
make

%Install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT/%{pfx}
rm -f $RPM_BUILD_ROOT/%{pfx}/%{_prefix}/lib/*.la

%Clean
rm -rf $RPM_BUILD_ROOT

%Files
%defattr(-,root,root)
%{pfx}/*

Note: Pls take care to %Build and %Install section. Make sure the script can build your ap succeessful.

  4. Add PKG_LIBUDEV to config/userspace/packages.lkc.

Something like:

config PKG_LIBUDEV

    depends PKG_ASTERISK
    bool "libudev"
    help
      udev library.

5. Add CONFIG_PKG_LIBUDEV to imx28.cf file.

 

You can use following commands for testing:

download package:

./ltib -m prep -p libudev

build package:

./ltib -m scbuild -p libudev

install package:

./ltib -m scdeploy -p libudev

 

Thanks~~