ubuntu 在 R40e 上 還有 Debian 在 Sempron 2600 上

顯示具有 package 標籤的文章。 顯示所有文章
顯示具有 package 標籤的文章。 顯示所有文章

2015年5月7日 星期四

mDNSResponder test..

要 bison. flex.
完成後,先啟動 daemon : mdnsd
然後隨便 run 一個 client app:
pi@raspberrypi ~/mDNSResponder-544/mDNSPosix/build/prod $ ./mDNSClientPosix 
socket AF_INET6: Address family not supported by protocol
mDNSClientPosix: Finished with status -65537, result 2


所以要 enable ipv6, 不然就要修改 Makefile, 把 ipv6 disable掉

ref: https://www.raspbian.org/RaspbianFAQ#How_do_I_enable_or_use_IPv6.3F
就 sudo modprobe ipv6

再 run mdnsd 和,,
pi@raspberrypi ~/mDNSResponder-544/mDNSPosix/build/prod $ ./mDNSClientPosix 
Hit ^C when you're bored waiting for responses.

... 不一樣了...

在 jessie 下 build, error:
../mDNSShared/dnsextd_parser.y:188:22: note: each undeclared identifier is reported only once for each function it appears in
../mDNSShared/dnsextd_parser.y: In function ‘ParseConfig’:
../mDNSShared/dnsextd_parser.y:448:8: error: too many arguments to function ‘yyparse’
  err = yyparse( ( void* ) d );
        ^
objects/prod/dnsextd_parser.c:1125:1: note: declared here
 yyparse (void)
 ^
make: *** [objects/prod/dnsextd_parser.y.o] Error 1
.. 這個先跳過...

ref: https://github.com/changyy/mDNSResponder-cmake

原來是這樣用的...mDNSResponderPosix 和 mDNSClientPosix

Makefile 這兩個 ap 的 source:
SPECIALOBJ = $(OBJDIR)/mDNSPosix.c.o $(OBJDIR)/mDNSUNP.c.o $(OBJDIR)/mDNSDebug.c.o $(OBJDIR)/GenLinkedList.c.o \
        $(OBJDIR)/DNSDigest.c.o $(OBJDIR)/uDNS.c.o $(OBJDIR)/DNSCommon.c.o $(OBJDIR)/PlatformCommon.c.o \
        $(OBJDIR)/CryptoAlg.c.o $(OBJDIR)/anonymous.c.o
COMMONOBJ  = $(SPECIALOBJ) $(OBJDIR)/mDNS.c.o
APPOBJ     = $(COMMONOBJ) $(OBJDIR)/ExampleClientApp.c.o

$(BUILDDIR)/mDNSClientPosix:         $(APPOBJ)     $(OBJDIR)/Client.c.o
        $(CC) $+ -o $@ $(LINKOPTS)

$(BUILDDIR)/mDNSResponderPosix:      $(COMMONOBJ)  $(OBJDIR)/Responder.c.o
        $(CC) $+ -o $@ $(LINKOPTS)



follow ref 的作法,看看 option :
$ ./mDNSResponderPosix -h
./mDNSResponderPosix: invalid option -- 'h'
Usage: mDNSResponderPosix [-v level ] [-r] [-n name] [-t type] [-d domain] [-p port] [-f file] [-b] [-P pidfile] [-x name=val ...]
          -v verbose mode, level is a number from 0 to 2
             0 = no debugging info (default)
             1 = standard debugging info
             2 = intense debugging info
             can be cycled kill -USR1
          -r also bind to port 53 (port 5353 is always bound)
          -n uses 'name' as the service name (required)
          -t uses 'type' as the service type (default is '_afpovertcp._tcp.')
          -d uses 'domain' as the service domain (default is 'local.')
          -p uses 'port' as the port number (default is '548')
          -f reads a service list from 'file'
          -b forces daemon (background) mode
          -P uses 'pidfile' as the PID file
             (default is '/var/run/mDNSResponder.pid')
             only meaningful if -b also specified
          -x stores name=val in TXT record (default is empty).
             MUST be the last command-line argument;
             all subsequent arguments after -x are treated as name=val pairs.
和..
$ ./mDNSClientPosix -h
./mDNSClientPosix: invalid option -- 'h'
Usage: mDNSClientPosix [-v level] [-t type] [-d domain]
          -v verbose mode, level is a number from 0 to 2
             0 = no debugging info (default)
             1 = standard debugging info
             2 = intense debugging info
          -t uses 'type' as the service type (default is '_afpovertcp._tcp')
          -d uses 'domain' as the domain to browse (default is 'local.')

所以最簡單的就是:
$ ./mDNSResponder -n mytest
因為沒有加上 -b, 所以要用另一台機器(在同一個 lan)..
$ ./mDNSClientPosix 
Hit ^C when you're bored waiting for responses.
*** Found name = 'mytest', type = '_afpovertcp._tcp.', domain = 'local.'
完成。


****
Debian Jessie 真的不能build...@_@.. 拿部份build成功的 mDNSResponder 來 run, 會出現 Address in use error

實際測試是用 raspberry pi 和 ubuntu 12.10 接在 LAN 上測試成功。

-- 都 disable IPV6.
另外, Bananapi + Android 4.2 和 raspberry pi + raspbian 用 NCM (Usb) 連線測試也 OK
Bananapi + Android 4.2 用的是 Android 內建的..mdnsresponder..
修改 Android.mk:
include $(CLEAR_VARS)

LOCAL_SRC_FILES := mDNSPosix/mDNSPosix.c \
                  mDNSPosix/mDNSUNP.c \
                  mDNSShared/mDNSDebug.c \
                  mDNSShared/GenLinkedList.c \
                  mDNSCore/DNSDigest.c \
                  mDNSCore/uDNS.c \
                  mDNSCore/DNSCommon.c \
                  mDNSShared/PlatformCommon.c \
                  mDNSCore/mDNS.c \
                  mDNSPosix/ExampleClientApp.c \
                  mDNSPosix/Client.c \

LOCAL_MODULE := mDNSClientPosix
LOCAL_MODULE_TAGS := optional

LOCAL_C_INCLUDES := external/mdnsresponder/mDNSPosix \
                    external/mdnsresponder/mDNSCore  \
                    external/mdnsresponder/mDNSShared

LOCAL_CFLAGS := -O2 -g -W -Wall -D__ANDROID__ -D_GNU_SOURCE -DNOT_HAVE_SA_LEN -DUSES_NETLINK -DTARGET_OS_LINUX -fno-strict-aliasing -DHAVE_LINUX -DMDNS_DEBUGMSGS=0 -DMDNS_UDS_SERVERPATH=\"/dev/socket/mdnsd\" -DMDNS_USERNAME=\"mdnsr\" -DPLATFORM_NO_RLIMIT

LOCAL_SYSTEM_SHARED_LIBRARIES := libc libcutils

include $(BUILD_EXECUTABLE)

2013年11月21日 星期四

try ubuntu 13.10 -- for building android 2.3.7

都選 english,裝完開機後 會出現要你裝完剩下的 language,這時後可以加上 Chinese(Traditional)

裝完 4G
java6 比較麻煩,要加入 ppa.
ref : How to Install Oracle Java JDK 6 in Ubuntu 13.10 Saucy Salamander
大概就是
#sudo add-apt-repository ppa:webupd8team/java
#sudo apt-get update
#sudo apt-get install oracle-java6-installer
 會出現確認按鍵,之後開始 download...
#sudo apt-get install oracle-java6-set-default
以後要刪除的話...
#sudo apt-get purge oracle-java6-installer
然後 follow 這一篇, 改 default gcc 為 4.4
之後把需要的 build tool 都裝起來 (ref: google android)
現在用到5G

repo sync 完用掉 16G.


try build...

說缺 libgmp.so.3, 是 package libgmp3c2
只好 ref: http://packages.ubuntu.com/search?keywords=libgmp3c2
加入舊版 repo 到 sources.list:
deb http://cz.archive.ubuntu.com/ubuntu quantal main universe 
再 apt-get update, apt-get install libgmp3c2


出現 error: Dalvik 有不認識 rilm==> 加 include resource.h

/usr/include/zlib.h:34: fatal error: zconf.h: No such file or directory

因為 ubuntu 13.10 把 zconf.h 改放到 /usr/include/x86_64 下了。
所以手動建 link 到 /usr/include

build 玩用掉 21G

2013年8月22日 星期四

install libmpfr4 in ubuntu lucid (10.04)

因為 build android old rev (before 4.0),要使用 gcc 4.xxx.. 不然要 patch 一堆。
而使用這版本 gcc 的 LTS 只有 lucid..

但是在 build 的時後,需要 libmpc2.. 所以安裝 --> OK.
之後就出現 libmpfr.so.4 找不到。
這個是 package libmpfr4,
可以 lucid 沒有。
找 ubuntu 上 libmpfr4 的最舊版本,是 precise 的,用 dpkg -i 安裝,說要 multiarch 這個 package..
lucid 也沒有,所以不能裝。

最後是用 launchpad port 到 maverick 的 libmpfr4 版本: https://launchpad.net/ubuntu/maverick/amd64/libmpfr4/3.0.0-2

下載安裝 OK

標籤

網誌存檔