Chinaunix首页 | 论坛 | 博客
  • 博客访问: 2691489
  • 博文数量: 505
  • 博客积分: 1552
  • 博客等级: 上尉
  • 技术积分: 2514
  • 用 户 组: 普通用户
  • 注册时间: 2007-09-23 18:24
文章分类

全部博文(505)

文章存档

2019年(12)

2018年(15)

2017年(1)

2016年(17)

2015年(14)

2014年(93)

2013年(233)

2012年(108)

2011年(1)

2009年(11)

分类: LINUX

2012-11-06 14:00:10

/////////////////////////////////////////////////////////////////
//environment:
//       compile system:Ubantu 10.04
//       target system:   imx51
//       resource:            RT3070_SoftAP_v2.4.0.rar
                                   ltib --- L2.6.35_10.11.01_ER_source.tar.gz  

//       cross compile:   arm-none-linux-gnueabi-    
//ps :                           My English is the primary level(most of YouDao) -- 
  Welcome Guidance
//reference:               http://blog.csdn.net/king_sundi/article/details/6158475 
                                  
http://blog.csdn.net/linfeng999/article/details/6410224
                                       
//////////////////////////////////////////////////////////////////

/////////////////////compile rt3070ap///////////////////////////////
("-" remove row, "+" add row )
$ cd 2010_0203_RT3070_SoftAP_v2.4.0.1_DPA
$ vim MODULE/Makefile
   -PLATFORM = PC
   +PLATFORM = SMDK

    ifeq ($(PLATFORM),SMDK)
    -LINUX_SRC = /home/bhushan/itcenter/may28/linux-2.6-samsung
    -CROSS_COMPILE = /usr/local/arm/4.2.2-eabi/usr/bin/arm-linux-
    +LINUX_SRC = /home/lin/Desktop/linux-2.6.35.3
    +CROSS_COMPILE = /opt/freescale/usr/local/gcc-4.4.4-glibc-2.11.1-multilib-1.0/arm-fsl-linux-gnueabi/bin/arm-none-linux-gnueabi-
     endif
$ vim NETIF/Makefile
$ vim UTIL/Makefile
  repair the same as MODULE/Makefile
 
// repair usb_buffer_free and usb_buffer_allow error
$ vim UTIL/os/linux/rt_usb_util.c
  repair following:
   #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
  void *rausb_buffer_alloc(struct usb_device *dev,
         size_t size,
         gfp_t mem_flags,
         dma_addr_t *dma)
  {
   - return usb_buffer_alloc(dev, size, mem_flags, dma);
   + return usb_alloc_coherent(dev, size, mem_flags, dma);
  }
  EXPORT_SYMBOL(rausb_buffer_alloc);  
  void rausb_buffer_free(struct usb_device *dev,
         size_t size,
         void *addr,
         dma_addr_t dma)
  {
   - usb_buffer_free(dev, size, addr, dma);
   + usb_free_coherent(dev, size, addr, dma);
  }
  EXPORT_SYMBOL(rausb_buffer_free);
  #endif // LINUX_VERSION_CODE //
  
//repair rt3070ap: module license 'RALINK' taints kernel.
$ vim NETIF/os/linux/usb_main_dev.c
     +MODULE_LICENSE("GPL");

$ vim MODULE/common/rtmp_init.c
  repair following:
  #ifdef RTMP_MAC_USB
  - MODULE_LICENSE("RALINK");
  + MODULE_LICENSE("GPL");
  #endif // RTMP_MAC_USB //
  
  + #ifndef RTMP_MAC_USB
  + MODULE_LICENSE("GPL");
  + #endif 
  
$ sudo make ARCH=arm KBUILD_NOPEDANTIC=1


二:DHCP服务器端:(编译器)
1. 修改Makefile: 添加:     CROSS_COMPILE=arm-linux-

2. #make , 把生成的dhcpd文件下载到板子上.
make LDFLAGS="-static"
我编译时提示有个C文件出错,是因为文件中switch case 少了个break。
使用/usr/local/arm/2.95.3/bin/arm-linux-strip处理一下,
3. #cp samples/udhcpd.conf    /etc/                #copy udhcp/samples下的文件到目标板子的 /etc目录
4. # vi /etc/udhcpd.conf: 修改如下:
3 # The start and end of the IP lease block
4
5 start       192.168.1.20    #default: 192.168.0.20   为winXP的ip地址范围
6 end        192.168.1.25    #default: 192.168.0.254

9 # The interface that udhcpd will use
10
11 interface   wlan0       #default: eth 0#目标板子上的无线网卡wlan0 ,按照实际情况改写如ra0等
85 #Examles
86 opt dns 222.201.130.30 222.201.130.33   #dns服务器
87 option subnet 255.255.255.0
88 opt router 192.168.1.10                       #wlan的 ip地址,做为网关地址
89 #opt    wins    192.168.10.10              #注释掉
90 option dns 192.168.1.10 # appened to above DNS servers for a total of 3
91 option domain local
92 option lease   864000      # 10 days of seconds
5# ./dhcpd //运行dhcpd服务器
到此DHCP服务器运行成功。

//compile dhcpd
$ cd ltib/
$ ./ltib -c

Package list  --->
 [*] dhcp                                                     
   [*]   Include DHCP server                            
   [*]   Include DHCP client support

$ cp rootfs/usr/sbin/dhcpd   @target rootfs/usr/local/bin/dhcpd

//////////////////////configuration dhcpd/////////////////////

reference google (dhcpd 配置)
example:
ddns-update-style ad-hoc;

deny client-updates;

subnet 192.168.1.0 netmask 255.255.255.0 {

default-lease-time 21600;

max-lease-time 43200;

option routers 192.168.1.1;

option subnet-mask 255.255.255.0;

option broadcast-address  192.168.1.255;

option domain-name "";

option domain-name-servers 192.169.1.10;

option netbios-name-servers     192.168.1.10;

option www-server               192.168.1.10;

range  192.168.1.20 192.168.1.25;
}

$ mkdir -p @target rootfs/var/state/dhcp/
$ touch @target rootfs/var/state/dhcp/dhcpd.leases
  
//////////////////////////////powerboot/////////////////////////
// cp *.ko to filesystem
$ tar -jxvf rootfs.tar.bz2 /tftpboot/
$ sudo make -p /tftpboot/usr/local/module
$ sudo cp MODULE/os/linux/*.ko /tftpboot/usr/local/module
$ sudo cp NETIF/os/linux/*.ko /tftpboot/usr/local/module 
$ sudo cp UTIL/os/linux/*.ko /tftpboot/usr/local/module

// cp ap-set.dat to filesystem
$ sudo make -p /tftpboot/etc/Wireless/RT2870AP
$ sudo cp MODULE/RT2870AP.dat /tftpboot/etc/Wireless/RT2870AP/

// set ap argument
$ vim /tftpboot/etc/Wireless/RT2870AP/RT2870AP.dat

// set powerboot
$ vim /etc/rc.d/rcS
----Added to the last line of behind
+ #install rc3070ap
+ insmod /usr/local/module/rtutil3070ap.ko
+ insmod /usr/local/module/rt3070ap.ko
+ insmod /usr/local/module/rtnet3070ap.ko

+ #run rc3070ap
+ ifconfig ra0 192.168.1.19
+ /usr/local/bin/dhcpd

阅读(1516) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~