OpenWrt Forum Archive

Topic: building package (openobex) raises: "package 'udev' not found"

The content of this topic has been archived on 18 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

hi,

I'm struggling to build openobex as a open-wrt package (tp-link 3040 - sdk revision 388888)

i have build the sdk successfully and can build a simple package like this the one mentioned in https://forum.openwrt.org/viewtopic.php?id=43461

i have read the various docs closely:

i do as follow:

Step 1

download openobex tar from https://www.gitorious.org/openobex/pages/Home (i know i can make a makefile that also can download directly but i had problems to get it to extract right - so will focus on the build here)


Step 2

create dir <path to open-wrt>/package/open-obex


Step 3

place the extracted openobex dir here as openobex-mainline

Step 4

set up the make file as follow:


include $(TOPDIR)/rules.mk

PKG_NAME:=open-obex
PKG_VERSION:=1.7
PKG_RELEASE:=1

include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk


define Package/open-obex
    SECTION:=util
    CATEGORY:=Bluetooth
    TITLE:=Open Obex implementation
endef

define Package/knode/description
    Open Obex implementation
endef

define Build/Prepare
    mkdir -p $(PKG_BUILD_DIR)
    $(CP) ./openobex-mainline/* $(PKG_BUILD_DIR)/
endef

define Package/knode/install
    $(INSTALL_DIR) $(1)/usr/bin
    $(INSTALL_BIN) $(PKG_BUILD_DIR)/open-obex $(1)/usr/bin/
endef

$(eval $(call BuildPackage,open-obex))

Step 4b

In the Makelists.txt of open obex I have disabled the documentation building to keep things simple.

...
option ( BUILD_DOCUMENTATION "Build library and application documentation" OFF)
...
Step 5

so fare so good - now doing the building roughly lets compile:


$ make tools/install
$ make toolchain/install
$ package/open-obex/compile V=99

then i got various complain about packages missing

...
WARNING: skipping libssp -- package not selected     
WARNING: skipping libstdcpp -- package not selected
WARNING: skipping libpthread -- package not selected
WARNING: skipping libthread-db -- package not selected
WARNING: skipping librt -- package not selected
WARNING: skipping libgfortran -- package not selected   
WARNING: skipping ldd -- package not selected           
WARNING: skipping ldconfig -- package not selected     
...

enable it 'y' through make menuconfig - some are hard to find smile so i ended up just doing it directly in

<path to open-wrt>/.config and set "=y"

Step 6

clean and compile again $package/open-obex/{clean,compile} V=99

and still got complains about missing bluez / libusb and udev

bluez and libusb was easy ->


the compile and install bluez:

$ make package/feeds/packages/bluez-utils/compile V=99
$ make package/feeds/packages/bluez-utils/compile V=99

enable it in .config

the compile and install bluez:

$ make package/libs/libusb/compile V=99
$ make package/libs/libusb/compile V=99

enable it in .config

$ make package/system/udev/compile V=99
$ make package/system/udev/install V=99

enable it in .config


Step 6

clean and compile again package/open-obex/{clean,compile} V=99

but udev kept being not found:

...
-- checking for module 'bluez'
--   found bluez, version 3.36
-- checking for module 'libusb-1.0'
--   found libusb-1.0, version 1.0.9
-- Looking for libusb_get_device_list in /home/pelle/playground_openwrt/openwrt_trunk/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/lib/libusb-1.0.so
-- Looking for libusb_get_device_list in /home/pelle/playground_openwrt/openwrt_trunk/staging_dir/target-mips_34kc_uClibc-0.9.33.2/usr/lib/libusb-1.0.so - found
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
CMake Error at /home/pelle/playground_openwrt/openwrt_trunk/staging_dir/host/share/cmake-2.8/Modules/CheckCXXSourceCompiles.cmake:61 (try_compile):
  Unknown extension ".cxx" for file

    /home/pelle/playground_openwrt/openwrt_trunk/build_dir/target-mips_34kc_uClibc-0.9.33.2/open-obex-1.7/CMakeFiles/CMakeTmp/src.cxx

  try_compile() works only for enabled languages.  Currently these are:

    C

  See project() command to enable other languages.
Call Stack (most recent call first):
  /home/pelle/playground_openwrt/openwrt_trunk/staging_dir/host/share/cmake-2.8/Modules/CheckCXXCompilerFlag.cmake:40 (CHECK_CXX_SOURCE_COMPILES)
  CMakeModules/GenerateExportHeader.cmake:211 (check_cxx_compiler_flag)
  CMakeModules/GenerateExportHeader.cmake:365 (_test_compiler_hidden_visibility)
  lib/CMakeLists.txt:196 (generate_export_header)


-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Failed
-- checking for module 'udev'
--   package 'udev' not found
-- Configuring incomplete, errors occurred!
See also "/home/pelle/playground_openwrt/openwrt_trunk/build_dir/target-mips_34kc_uClibc-0.9.33.2/open-obex-1.7/CMakeFiles/CMakeOutput.log".
See also "/home/pelle/playground_openwrt/openwrt_trunk/build_dir/target-mips_34kc_uClibc-0.9.33.2/open-obex-1.7/CMakeFiles/CMakeError.log".
make[2]: *** [/home/pelle/playground_openwrt/openwrt_trunk/build_dir/target-mips_34kc_uClibc-0.9.33.2/open-obex-1.7/.configured_] Error 1
make[2]: Leaving directory `/home/pelle/playground_openwrt/openwrt_trunk/package/open-obex'
make[1]: *** [package/open-obex/compile] Error 2
make[1]: Leaving directory `/home/pelle/playground_openwrt/openwrt_trunk'
make: *** [package/open-obex/compile] Error 2
...

any suggestions / hints are warmly appreciated!

//

pelle

(Last edited by pellekrogholt on 23 Feb 2014, 21:29)

It looks like udev.pc is in the wrong(?) path

find . -iname "libusb-1.0.pc"
find . -iname "udev.pc"

notice the difference

I added to package/system/udev/Makefile in section InstallDev:

$(CP) $(PKG_INSTALL_DIR)/usr/share/pkgconfig/udev.pc $(1)/usr/lib/pkgconfig

at the end

## be more verbose with cmake
VERBOSE=1 make package/feeds/packages/openobex/configure V=s

-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Failed
-- checking for module 'udev'
--   found udev, version 173
-- Configuring incomplete, errors occurred!

Makefile:

#
# Copyright (C) 2014 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=openobex
PKG_VERSION:=1.7.1
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=git://gitorious.org/openobex/mainline.git
PKG_SOURCE_VERSION:=2e1c0fc5a8f5e41886141a6b402d00db735ccf49
PKG_MD5SUM:=2e1c0fc5a8f5e41886141a6b402d00db735ccf49

CMAKE_INSTALL:=1

include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk

define Package/openobex
  SECTION:=utils
  CATEGORY:=Utilities
  DEPENDS:=+libusb-1.0 +bluez-libs +udev +libxml2
  TITLE:=Free open source implementation of the Object Exchange (OBEX) protocol.
  URL:=https://gitorious.org/openobex
endef

# libxml2 : xmllint ?
# udev detected if udev Makefile modified

CMAKE_OPTIONS += \
        -DCMAKE_BUILD_TYPE=MinSizeRel \
        -DBUILD_DOCUMENTATION:BOOL=OFF \
        -DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE

$(eval $(call BuildPackage,openobex))

running
make package/feeds/packages/openobex/compile
a second time generates output files with the incomplete config

But the configure still errors out on the cxx test - I dont know if its really needed or can be deactivated

(Last edited by zloop on 23 Feb 2014, 18:10)

hi zloop,

thanks a lot for your feedback and for a sane Makefile - i have done the above and now get the udev build niecely! - but ends with compile errors...


make package/openobex/compile V=99
...
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Failed
-- checking for module 'udev'
--   found udev, version 173
-- Configuring incomplete, errors occurred!
See also "/home/pelle/playground_openwrt/openwrt_trunk/build_dir/target-mips_34kc_uClibc-0.9.33.2/openobex-1.7.1/CMakeFiles/CMakeOutput.log".
See also "/home/pelle/playground_openwrt/openwrt_trunk/build_dir/target-mips_34kc_uClibc-0.9.33.2/openobex-1.7.1/CMakeFiles/CMakeError.log".
make[2]: *** [/home/pelle/playground_openwrt/openwrt_trunk/build_dir/target-mips_34kc_uClibc-0.9.33.2/openobex-1.7.1/.configured_] Error 1
make[2]: Leaving directory `/home/pelle/playground_openwrt/openwrt_trunk/package/openobex'
make[1]: *** [package/openobex/compile] Error 2
make[1]: Leaving directory `/home/pelle/playground_openwrt/openwrt_trunk'
make: *** [package/openobex/compile] Error 2

i'm not 100% sure when you say

But the configure still errors out on the cxx test - I dont know if its really needed or can be deactivated

how / where do i deactive .... ?

thx

//

pelle

another thing i realized with fresh eyes that i kind of skipped the step

VERBOSE=1 make package/feeds/packages/openobex/configure V=s

didn't play well it should be ?

VERBOSE=1 make package/openobex/configure V=s

how do i get the openobex*.ipk file created? - i tried in .config:

...
CONFIG_PACKAGE_openobex=y
...

or

...
CONFIG_PACKAGE_openobex=m
...

well i'm a newbie on the open-wrt package building so forgive me for the naive questions...

thx

//

pelle

pellekrogholt wrote:

how do i get the openobex*.ipk file created? - i tried in .config:

make package/openobex/compile V=s

both =y and =m should work for creating the .ipk.
=m just makes the package, but it does not get included in the firmware binary
=y compiles the package and it will be icluded in the firmware image

(Last edited by hnyman on 24 Feb 2014, 09:50)

hi hnyman,

thanks a lot for the clarification about y vs. m.

lets say in .config  i have set:

...
CONFIG_PACKAGE_openobex=y
...

i have done :

...
make package/openobex/compile V=99
...
make package/openobex/install V=99

then:

looking in ls bin/ar71xx/packages/ and or

find . -iname "*obex*.ipk"

<empty / no results>

what is generally a good way to debug when ipk's not are created ?

thx

//

pelle

Have you already fixed your Makefile?
Your own in the first message contains several errors (e.g. references to knode), so are you using zloop's Makefile?

The general way is to check the build log to see if the package compiled succesfully. If compilation still breaks for the config error, naturally the *.ipk is not geneated.

EDIT:
your error messages also suggest, that more info might be in CMakeError.log and CMakeOutput.log

googling for that failing config line reveals that there should also be a Cmake option USE_COMPILER_HIDDEN_VISIBILITY that you probably could disable

EDIT2:
could you provide your exact current Makefile? I might try it on my own build system.

(Last edited by hnyman on 24 Feb 2014, 12:34)

hnyman

ok sorry not for being 100% clear -  my Makefile in the retry was not the initial one but the the version provided by zloop placed here:

  /home/pelle/playground_openwrt/openwrt_trunk/package/openobex:
...
 Makefile

containing:

#
# Copyright (C) 2014 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=openobex
PKG_VERSION:=1.7.1
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=git://gitorious.org/openobex/mainline.git
PKG_SOURCE_VERSION:=2e1c0fc5a8f5e41886141a6b402d00db735ccf49
PKG_MD5SUM:=2e1c0fc5a8f5e41886141a6b402d00db735ccf49

CMAKE_INSTALL:=1

include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk

define Package/openobex
  SECTION:=utils
  CATEGORY:=Utilities
  DEPENDS:=+libusb-1.0 +bluez-libs +udev +libxml2
  TITLE:=Free open source implementation of the Object Exchange (OBEX) protocol.
  URL:=https://gitorious.org/openobex
endef

# libxml2 : xmllint ?
# udev detected if udev Makefile modified

CMAKE_OPTIONS += \
        -DCMAKE_BUILD_TYPE=MinSizeRel \
        -DBUILD_DOCUMENTATION:BOOL=OFF \
        -DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE

$(eval $(call BuildPackage,openobex))

+100 I you have the time to run it with your setup...

thx

//

pelle

(Last edited by pellekrogholt on 24 Feb 2014, 13:06)

I have fixed the makefile and it compiles but since I dont have a Smartphone or Obex compatible hand nor bluetooth I cannot test further

Edit 1: CMakeLists.txt is in DOS format ... because of that patching fails when trying to build - so one "hack" is to provide a patched CMakeLists.txt with the package and copy it to the build dir

working* Makefile:

#
# Copyright (C) 2014 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=openobex
PKG_VERSION:=1.7.1
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=git://gitorious.org/openobex/mainline.git
PKG_SOURCE_VERSION:=2e1c0fc5a8f5e41886141a6b402d00db735ccf49

include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/cmake.mk

define Package/openobex
  SECTION:=utils
  CATEGORY:=Utilities
  DEPENDS:=+libusb-1.0 +bluez-libs +udev +libxml2
  TITLE:=Free open source implementation of the Object Exchange (OBEX) protocol.
  URL:=https://gitorious.org/openobex
endef

CMAKE_OPTIONS += \
        -DCMAKE_BUILD_TYPE=MinSizeRel \
        -DBUILD_DOCUMENTATION=OFF

define Build/Prepare
    $(Build/Prepare/Default)
    $(RM) -f $(PKG_BUILD_DIR)/CMakeLists.txt
    $(CP) ./files/CMakeLists.txt $(PKG_BUILD_DIR)/CMakeLists.txt
endef

define Package/openobex/install
    $(INSTALL_DIR) $(1)/sbin
    $(CP) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/sbin/
    $(INSTALL_DIR) $(1)/lib/udev/rules.d
    $(CP) $(PKG_INSTALL_DIR)/lib/udev/rules.d/* $(1)/lib/udev/rules.d/
    $(INSTALL_DIR) $(1)/usr/lib
    $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopenobex.so* $(1)/usr/lib/
endef


$(eval $(call BuildPackage,openobex))

additionally there is still a patch for udev (posted above) or the build-system missing
PKG_CONFIG_PATH is set only to /usr/lib/pkgconfig and not to /usr/share/pkgconfig (only vala and udev use these in OpenWrt - but on Arch there are some more .pc files in /usr/share/ )

CMakeLists has one tiny change:

-project ( openobex C )
+project ( openobex C CXX)

Edit 2: I sent a complete patch to the mailing list. So look there or at patchwork

Edit 3: Makefile was missing package/install - i only had that locally committed and missed to add that to the patch
Patch v2 sent to mailing list too

STILL : cannot test further because I dont have such Smartphone

(Last edited by zloop on 24 Feb 2014, 19:05)

hi zloop,

again thanks a lot for your detailed feedback / work!

... but since I don't have a Smartphone or Obex compatible hand nor bluetooth I cannot test further ...

well such smart devices are also a bit overrated these days - i gladly like to do that "smart" part.

here is what i did so fare:

update the make file to correspond with your new changes:

$ diff Makefile Makefile_20130216 
17a18,20
> PKG_MD5SUM:=2e1c0fc5a8f5e41886141a6b402d00db735ccf49
> 
> CMAKE_INSTALL:=1
29a33,35
> # libxml2 : xmllint ?
> # udev detected if udev Makefile modified
> 
32,48c38,39
<         -DBUILD_DOCUMENTATION=OFF
< 
< define Build/Prepare
<     $(Build/Prepare/Default)
<     $(RM) -f $(PKG_BUILD_DIR)/CMakeLists.txt
<     $(CP) ./files/CMakeLists.txt $(PKG_BUILD_DIR)/CMakeLists.txt
< endef
< 
< define Package/openobex/install
<     $(INSTALL_DIR) $(1)/sbin
<     $(CP) $(PKG_INSTALL_DIR)/usr/sbin/* $(1)/sbin/
<     $(INSTALL_DIR) $(1)/lib/udev/rules.d
<     $(CP) $(PKG_INSTALL_DIR)/lib/udev/rules.d/* $(1)/lib/udev/rules.d/
<     $(INSTALL_DIR) $(1)/usr/lib
<     $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopenobex.so* $(1)/usr/lib/
< endef
< 
---
>         -DBUILD_DOCUMENTATION:BOOL=OFF \
>         -DCMAKE_VERBOSE_MAKEFILE:BOOL=TRUE
50c41
< $(eval $(call BuildPackage,openobex))
---
> $(eval $(call BuildPackage,openobex))
\ No newline at end of file

then i created the files dir and placed a dos2unix transformed version of CMakeLists.txt of open-obex there:

$ ls package/openobex/files
CMakeLists.txt

and changed package/openobex/files/CMakeLists.txt:

-project ( openobex C )
+project ( openobex C CXX)

Ran the usual suspects of commands:

VERBOSE=1 make package/openobex/configure V=s
...
make package/openobex/compile V=99
...
make package/openobex/install V=99
...
make package/index
...

verified we have an ipk file:

$ find -iname "openobex*.ipk"
./bin/ar71xx/packages/openobex_1.7.1-1_ar71xx.ipk

Uploaded/updated Packages/Packages.gz/openobex_1.7.1-1_ar71xx.ipk to custom package repo and installed openobex sucessfully:

opkg install http://<my project>.itu.dk/open-wrt/trunk-21nov2013/packages
# opkg install openobex
Installing openobex (1.7.1-1) to root...
Downloading http://<my project>.itu.dk/open-wrt/trunk-21nov2013/packages/openobex_1.7.1-1_ar71xx.ipk.
Installing libusb-1.0 (1.0.9-1) to root...
Downloading http://<my project>.itu.dk/open-wrt/trunk-21nov2013/packages/libusb-1.0_1.0.9-1_ar71xx.ipk.
Installing udev (173-1) to root...
Downloading http://<my project>.itu.dk/open-wrt/trunk-21nov2013/packages/udev_173-1_ar71xx.ipk.
Installing libxml2 (2.7.8-2) to root...
Downloading http://<my project>.itu.dk/open-wrt/trunk-21nov2013/packages/libxml2_2.7.8-2_ar71xx.ipk.
Configuring libxml2.
Configuring libusb-1.0.
Configuring udev.
Configuring openobex.

Ok fine i assume i have openobex now and would like to use it - for example with ussp-push (http://xmailserver.org/ussp-push.html) - then i can do:

$ ussp-push --debug  00:1B:35:0A:7A:AE@1 myfile.mp3 myfile.mp3 

i start up the package dir:


create a Makefile

#
# Copyright (C) 2014 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#

include $(TOPDIR)/rules.mk

PKG_NAME:=ussp-push
PKG_VERSION:=0.11
PKG_RELEASE:=1

PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_URL:=http://xmailserver.org
# the next steps didn't work out well:
#PKG_MD5SUM:=5c44983ee27809867041feff6bb4423a 
#PKG_CAT:=zcat

include $(INCLUDE_DIR)/package.mk

define Package/ussp-push
  SECTION:=utils
  CATEGORY:=Utilities
  DEPENDS:=+openobex
  TITLE:=ussp-push is a OBEX object pusher for Linux, using the BlueZ BlueTooth stack.
  URL:=http://xmailserver.org/ussp-push.html
endef

define Build/Configure
       $(call Build/Configure/Default,--with-linux-headers=$(LINUX_DIR))
endef

define Package/ussp-push/install
    $(INSTALL_DIR) $(1)/usr/bin
    $(INSTALL_BIN) $(PKG_BUILD_DIR)/ussp-push $(1)/usr/bin/
endef


$(eval $(call BuildPackage,ussp-push))

lets configure:

VERBOSE=1 make package/ussp-push/configure V=s
....

checking for BLUETOOTH... yes
checking for OPENOBEX... configure: error: Package requirements (openobex) were not met:

No package 'openobex' found

Consider adjusting the PKG_CONFIG_PATH environment variable if you
installed software in a non-standard prefix.

Alternatively, you may set the environment variables OPENOBEX_CFLAGS
and OPENOBEX_LIBS to avoid the need to call pkg-config.
See the pkg-config man page for more details.

make[2]: *** [/home/pelle/playground_openwrt/openwrt_trunk/build_dir/target-mips_34kc_uClibc-0.9.33.2/ussp-push-0.11/.configured_] Error 1
make[2]: Leaving directory `/home/pelle/playground_openwrt/openwrt_trunk/package/ussp-push'
make[1]: *** [package/ussp-push/configure] Error 2
make[1]: Leaving directory `/home/pelle/playground_openwrt/openwrt_trunk'
make: *** [package/ussp-push/configure] Error 2

then i'm a bit confused about how to add the freshly build openobex as a dependency in the right(TM) way -  even if the make do make some hints....


further help appreciated....

thx

pelle

(Last edited by pellekrogholt on 25 Feb 2014, 15:52)

I added a section to the openobex Makefile regarding missing header,library and pkgconfig files.

add this section:

define Build/InstallDev
    $(INSTALL_DIR) $(1)/usr/include/openobex
    $(INSTALL_DIR) $(1)/usr/lib
    $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
    $(CP) $(PKG_INSTALL_DIR)/usr/include/openobex/*.h $(1)/usr/include/openobex/
    $(CP) $(PKG_INSTALL_DIR)/usr/lib/libopenobex.so* $(1)/usr/lib/
    $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/openobex.pc $(1)/usr/lib/pkgconfig/
endef

I modified the ussp-push Makefile to make it compile

I had to edit 2 more locations in source because ussp-push apparently uses an old openobex version.

for the Makefile of ussp-push and the 2 patches of its source look at: http://paste.debian.net/84056/

hi zloop,

once again thx for the contionued help - i have adjusted the open-wrt Makefile of openobex and ussp-push according to  http://paste.debian.net/84056/


when reading further through the paste - i got a bit in doubt - there should be two patches placed here right ?

$ <open wrt sdk code>/package/ussp-push/patches
100-include_obex_const_header.patch
200_add_inline_convert.patch

if so can i see the entire  content of 100-include_obex_const_header.patch and 200_add_inline_convert.patch ?

sorry if i'm of the track...

pellekrogholt wrote:

if so can i see the entire  content of 100-include_obex_const_header.patch and 200_add_inline_convert.patch ?

The wrappers for those patch files start on lines 52 and 77, and the patch itself starts on line 57 and 82.
http://paste.debian.net/84056/
There is an extra + at each line, as the actual patches are created by the surrounding wrapper patch ;-)

(Last edited by hnyman on 26 Feb 2014, 16:26)

hi hnyman,

thanx for the explanation ^^ - i'm clearly in open wather here :)

so how do i apply the patches /wrappers of http://paste.debian.net/84056 within my openwrt build setup ?

thx

//

pelle


EDIT 2:


Ok i "git" it - doh its a git patch which of course was my first thought but then i got confused - because i had the ussp-push dir  out side the feeds/package/utils git based dir - lets move it:

$ mv openwrt_trunk/package/ussp-push
$ feeds/packages/utils/ussp-push
# download patch
$ wget http://paste.debian.net/download/84056
...

ok we have the patch lets apply it

$ git am 84056
Patch format detection failed.
# or 
$ git am < 84056
Patch does not have a valid e-mail address.

any hints for ^^ ?

(Last edited by pellekrogholt on 27 Feb 2014, 11:49)

Just create and edit the files manually. Copy-paste the contents, then remove the extra + chars. That is probably easiest.

Or use just normal "patch" to apply the patch. You do not need git.

(git requires the committer to always have an email address, so that the changeset is attributed to somebody. you should have that email defined in your local git settings, or alternatively in the patch file for that patch. I don't use git for patches, so this is half-guessing)

You are looking for basic patch skills... ;-)

(Last edited by hnyman on 27 Feb 2014, 13:36)

hnyman thanks for the patience smile main while i was doing:

Ok i "git" it - doh its a git patch which of course was my first thought but then i got confused - because i had the ussp-push dir  out side the feeds/package/utils git based dir - lets move it:

$ mv openwrt_trunk/package/ussp-push
$ feeds/packages/utils/ussp-push
# download patch
$ wget [url]http://paste.debian.net/download/84056[/url]
...

ok we have the patch lets apply it

$ git am 84056
Patch format detection failed.
# or 
$ git am < 84056
Patch does not have a valid e-mail address.

ok i was thinking a bit to fancy and simply forgot god old "patch -p1" lets go for that:

$ patch -p1 < 84056
patching file utils/ussp-push/Makefile
Hunk #1 FAILED at 15.
1 out of 1 hunk FAILED -- saving rejects to file utils/ussp-push/Makefile.rej
patching file utils/ussp-push/patches/100-include_obex_const_header.patch
patching file utils/ussp-push/patches/200_add_inline_convert.patch
pelle@tupelo:~/playground_openwrt/openwrt_trunk/feeds/packages$ cat utils/ussp-push/Makefile.rej
--- utils/ussp-push/Makefile
+++ utils/ussp-push/Makefile
...

then edit ussp-push/Makefile by hand and configure/compile

pelle@tupelo:~/playground_openwrt/openwrt_trunk$ VERBOSE=1 make feeds/packages/utils/ussp-push/configure V=s
WARNING: your configuration is out of sync. Please run make menuconfig, oldconfig or defconfig!
make[1]: Entering directory `/home/pelle/playground_openwrt/openwrt_trunk'
make[1]: *** No rule to make target `feeds/packages/utils/ussp-push/configure'.  Stop.
make[1]: Leaving directory `/home/pelle/playground_openwrt/openwrt_trunk'
make: *** [feeds/packages/utils/ussp-push/configure] Error 2

i dont understand that one lets put ussp-push back to the old dir:

$ mv mv feeds/packages/utils/ussp-push package/

configure/compile install goes fine and finally i got the ipk build

i update my custom package repos with the right info in "Packages" and the right versions of openobex...ipk (including the adjusts "I added a section to the openobex Makefile regarding missing header,library and pkgconfig files.") and ussp-push.ipk

they install fine - BUT when doing a ussp-push command it looks as follow - where it hangs on the request on a openwrt box:

ussp-push --debug  00:1B:35:0A:7A:29@1 myfile1.mp3 myfile1.mp3
pushing file myfile1.mp3
name=myfile1.mp3, size=59194
__obex_connect: client_context_t = 0x54d778
Registered transport
Set user data
Created new objext
Started a new request
^C

on a ubuntu i can do:

$ ussp-push --debug  00:1B:35:0A:7A:29@1 done.mp3 done.mp3
pushing file done.mp3
name=done.mp3, size=75676
__obex_connect: client_context_t = 0x2403800
Registered transport
Set user data
Created new objext
cobex_write
Local device 00:1A:7D:DA:71:08
Remote device 00:1B:35:0A:7A:29 (1)
Wrote 7 fragment
Wrote 7 bytes (expected 7)
obex_event: client_context_t = 0x2403800
Made some progress...
Started a new request
cobex_handle_input
expect 7 bytes
Read 7 bytes
obex_event: client_context_t = 0x2403800
ReqDone
Command (00) has now finished, rsp: 20
Connected!
Connection return code: 0, id: 0
Connection established
Connected to server
obex_push: client_context_t = 0x2403800
Sending file: done.mp3, path: done.mp3, size: 75676
cobex_write
Wrote 1024 fragment
Wrote 1024 bytes (expected 1024)
obex_event: client_context_t = 0x2403800
Made some progress...
cobex_handle_input
expect 3 bytes
Read 3 bytes
cobex_write
Wrote 1024 fragment
Wrote 1024 bytes (expected 1024)
obex_event: client_context_t = 0x2403800
Made some progress...
cobex_handle_input
...
ReqDone
Command (01) has now finished, rsp: 20
Disconnect done!
cobex_disconnect
cobex_close
Pushed!!

as always further help appreciated ... thx


EDIT 2

pardon my weak failure description above ^^ - for me its confusing if its about:

- openobex build wrongly?
- open-ussp with openobex patches build / patched wrongly?

or some internal code errors of openobex or assumedly open-ussp - i'm still looking for hints / directions here ...

my next step would of course be to go into gdb-debugging and so - my c/gdb skills are currently a bit rusty but i might take the jump when time arise...

EDIT 3

for the impatient simply do it with python / pybluez / pyobex:

opkg install python
opkg install python-bluez

well i could not get pip to fly well on open-wrt so the install of PyOBEX is a bit cumbersome and for some reason on open-wrt (bluez version: 3.36 / Python 2.7.5) i have to force it to use python bluez (bluetooth) - this was not the case on ubuntu (bluez version: 4.101-0ubuntu8b1 / Python 2.7.5) etc...

echo "we are about to install a patched version of Pyobex-0.25.Zip"
cd /tmp
wget http://www.boddie.org.uk/david/Projects/Python/PyOBEX/Software/PyOBEX-0.25.zip
unzip PyOBEX-0.25.zip
cd PyOBEX-0.25 
wget --no-check-certificate https://gist.githubusercontent.com/pellekrogholt/9259610/raw/3ca323ff81b690f7d5c7ba415bb9d6fcc9fe3efd/pyobex_common_py.patch
patch -p1  PyOBEX/common.py < pyobex_common_py.patch
python setup.py install

simple working client to push a file:

from PyOBEX.client import BrowserClient
mac_address = '00:1B:35:0A:7A:AE'
channel = 1
client = BrowserClient(mac_address, channel)
client.connect()
file_name='myfile.mp3'
file = open(file_name, 'r')
file_read = file.read() 
response = client.put(file_name, file_read, header_list=())
client.disconnect()

thats it.

(Last edited by pellekrogholt on 28 Feb 2014, 10:11)

The discussion might have continued from here.