分类: 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-
//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