Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1511119
  • 博文数量: 129
  • 博客积分: 1449
  • 博客等级: 上尉
  • 技术积分: 3048
  • 用 户 组: 普通用户
  • 注册时间: 2012-07-24 18:36
文章分类

全部博文(129)

文章存档

2015年(3)

2014年(20)

2013年(65)

2012年(41)

分类: 项目管理

2014-11-28 10:11:20

1. 小K没有RJ45接口, 只能通过无线连接. 在蓝灯慢闪时可以搜到无线OK_SP3, 连接此即可. 无密码. 


连接成功后, 可以看到网关为192.168.10.253, 此IP就是我们下步要用到的. 


2. ssh登陆192.168.10.253, 用户名: root, 密码: admin. 
用的openwrt的r39365版本, 余下空间790K左右, 删除了opkg, 需重新拷贝2个文件, /bin/opkg, /etc/opkg.conf

  1. root@OpenWrt:~# logread
  2. Thu Jan 1 08:00:11 1970 kern.notice kernel: [ 0.000000] Linux version 3.10.26 (zhaoyuanbiao@ubuntu) (gcc version 4.6.4 (OpenWrt/Linaro GCC 4.6-2013.05 r39365) ) #2 Thu Mar 27 18:14:15 CST 2014
  3. Thu Jan 1 08:00:11 1970 kern.debug kernel: [ 0.000000] MyLoader: sysp=00d73bc7, boardp=ed0c292e, parts=97cba183
  4. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.000000] bootconsole [early0] enabled
  5. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.000000] CPU revision is: 00019374 (MIPS 24Kc)
  6. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.000000] SoC: Atheros AR9330 rev 1
  7. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.000000] Clocks: CPU:400.000MHz, DDR:400.000MHz, AHB:200.000MHz, Ref:25.000MHz
  8. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.000000] Determined physical RAM map:
  9. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.000000] memory: 02000000 @ 00000000 (usable)
  10. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.000000] Initrd not found or empty - disabling initrd
  11. Thu Jan 1 08:00:11 1970 kern.warn kernel: [ 0.000000] Zone ranges:
  12. Thu Jan 1 08:00:11 1970 kern.warn kernel: [ 0.000000] Normal [mem 0x00000000-0x01ffffff]
  13. Thu Jan 1 08:00:11 1970 kern.warn kernel: [ 0.000000] Movable zone start for each node
  14. Thu Jan 1 08:00:11 1970 kern.warn kernel: [ 0.000000] Early memory node ranges
  15. Thu Jan 1 08:00:11 1970 kern.warn kernel: [ 0.000000] node 0: [mem 0x00000000-0x01ffffff]
  16. Thu Jan 1 08:00:11 1970 kern.debug kernel: [ 0.000000] On node 0 totalpages: 8192
  17. Thu Jan 1 08:00:11 1970 kern.debug kernel: [ 0.000000] free_area_init_node: node 0, pgdat 803049b0, node_mem_map 81000000
  18. Thu Jan 1 08:00:11 1970 kern.debug kernel: [ 0.000000] Normal zone: 64 pages used for memmap
  19. Thu Jan 1 08:00:11 1970 kern.debug kernel: [ 0.000000] Normal zone: 0 pages reserved
  20. Thu Jan 1 08:00:11 1970 kern.debug kernel: [ 0.000000] Normal zone: 8192 pages, LIFO batch:0
  21. Thu Jan 1 08:00:11 1970 kern.warn kernel: [ 0.000000] Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes.
  22. Thu Jan 1 08:00:11 1970 kern.warn kernel: [ 0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes
  23. Thu Jan 1 08:00:11 1970 kern.debug kernel: [ 0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768
  24. Thu Jan 1 08:00:11 1970 kern.debug kernel: [ 0.000000] pcpu-alloc: [0] 0
  25. Thu Jan 1 08:00:11 1970 kern.warn kernel: [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 8128
  26. Thu Jan 1 08:00:11 1970 kern.notice kernel: [ 0.000000] Kernel command line: board=TL-WR703N console=ttyATH0,115200 rootfstype=squashfs,jffs2 noinitrd
  27. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.000000] PID hash table entries: 128 (order: -3, 512 bytes)
  28. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.000000] Dentry cache hash table entries: 4096 (order: 2, 16384 bytes)
  29. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.000000] Inode-cache hash table entries: 2048 (order: 1, 8192 bytes)
  30. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.000000] Writing ErrCtl register=00000000
  31. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.000000] Readback ErrCtl register=00000000
  32. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.000000] Memory: 28784k/32768k available (2201k kernel code, 3984k reserved, 592k data, 276k init, 0k highmem)
  33. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1
  34. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.000000] NR_IRQS:51
  35. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.080000] Calibrating delay loop... 265.42 BogoMIPS (lpj=1327104)
  36. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.080000] pid_max: default: 32768 minimum: 301
  37. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.080000] Mount-cache hash table entries: 512
  38. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.090000] NET: Registered protocol family 16
  39. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.100000] MIPS: machine is TP-LINK TL-WR703N v1
  40. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.350000] bio: create slab <bio-0> at 0
  41. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.360000] Switching to clocksource MIPS
  42. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.360000] NET: Registered protocol family 2
  43. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.370000] TCP established hash table entries: 512 (order: 0, 4096 bytes)
  44. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.370000] TCP bind hash table entries: 512 (order: -1, 2048 bytes)
  45. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.370000] TCP: Hash tables configured (established 512 bind 512)
  46. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.380000] TCP: reno registered
  47. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.380000] UDP hash table entries: 256 (order: 0, 4096 bytes)
  48. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.390000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
  49. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.400000] NET: Registered protocol family 1
  50. Thu Jan 1 08:00:11 1970 kern.debug kernel: [ 0.400000] PCI: CLS 0 bytes, default 32
  51. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.420000] squashfs: version 4.0 (2009/01/31) Phillip Lougher
  52. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.420000] jffs2: version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc.
  53. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.430000] msgmni has been set to 56
  54. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.440000] io scheduler noop registered
  55. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.440000] io scheduler deadline registered (default)
  56. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.450000] Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled
  57. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.450000] ar933x-uart: ttyATH0 at MMIO 0x18020000 (irq = 11) is a AR933X UART
  58. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.460000] console [ttyATH0] enabled, bootconsole disabled
  59. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.470000] ath79-spi ath79-spi: master is unqueued, this is deprecated
  60. Thu Jan 1 08:00:11 1970 kern.warn kernel: [ 0.480000] m25p80 spi0.0: found w25q32, expected m25p80
  61. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.480000] m25p80 spi0.0: w25q32 (4096 Kbytes)
  62. Thu Jan 1 08:00:11 1970 kern.notice kernel: [ 0.490000] 5 tp-link partitions found on MTD device spi0.0
  63. Thu Jan 1 08:00:11 1970 kern.notice kernel: [ 0.490000] Creating 5 MTD partitions on "spi0.0":
  64. Thu Jan 1 08:00:11 1970 kern.notice kernel: [ 0.500000] 0x000000000000-0x000000020000 : "u-boot"
  65. Thu Jan 1 08:00:11 1970 kern.notice kernel: [ 0.500000] 0x000000020000-0x0000001199c0 : "kernel"
  66. Thu Jan 1 08:00:11 1970 kern.warn kernel: [ 0.510000] mtd: partition "kernel" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only
  67. Thu Jan 1 08:00:11 1970 kern.notice kernel: [ 0.520000] 0x0000001199c0-0x0000003f0000 : "rootfs"
  68. Thu Jan 1 08:00:11 1970 kern.warn kernel: [ 0.530000] mtd: partition "rootfs" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only
  69. Thu Jan 1 08:00:11 1970 kern.notice kernel: [ 0.540000] mtd: device 2 (rootfs) set to be root filesystem
  70. Thu Jan 1 08:00:11 1970 kern.notice kernel: [ 0.540000] 1 squashfs-split partitions found on MTD device rootfs
  71. Thu Jan 1 08:00:11 1970 kern.notice kernel: [ 0.550000] 0x0000002f0000-0x0000003f0000 : "rootfs_data"
  72. Thu Jan 1 08:00:11 1970 kern.notice kernel: [ 0.560000] 0x0000003f0000-0x000000400000 : "art"
  73. Thu Jan 1 08:00:11 1970 kern.notice kernel: [ 0.560000] 0x000000020000-0x0000003f0000 : "firmware"
  74. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 0.580000] libphy: ag71xx_mdio: probed
  75. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 1.140000] ag71xx ag71xx.0: connected to PHY at ag71xx-mdio.1:04 [uid=004dd041, driver=Generic PHY]
  76. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 1.150000] eth0: Atheros AG71xx at 0xb9000000, irq 4, mode:MII
  77. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 1.150000] TCP: cubic registered
  78. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 1.150000] NET: Registered protocol family 17
  79. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 1.160000] 8021q: 802.1Q VLAN Support v1.8
  80. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 1.170000] VFS: Mounted root (squashfs filesystem) readonly on device 31:2.
  81. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 1.180000] Freeing unused kernel memory: 276K (8031b000 - 80360000)
  82. Thu Jan 1 08:00:11 1970 kern.notice kernel: [ 7.550000] jffs2: notice: (294) jffs2_build_xattr_subsystem: complete building xattr subsystem, 4 of xdatum (1 unchecked, 3 orphan) and 60 of xref (0 dead, 47 orphan) found.
  83. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 8.740000] NET: Registered protocol family 10
  84. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 8.750000] nf_conntrack version 0.5.0 (454 buckets, 1816 max)
  85. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 8.770000] ip6_tables: (C) 2000-2006 Netfilter Core Team
  86. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 8.790000] Loading modules backported from Linux version master-2013-11-05-0-gafa3093
  87. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 8.800000] Backport generated by backports.git backports-20130802-0-gdb67a3f
  88. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 8.810000] ip_tables: (C) 2000-2006 Netfilter Core Team
  89. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 8.860000] xt_time: kernel timezone is -0000
  90. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 8.890000] cfg80211: Calling CRDA to update world regulatory domain
  91. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 8.890000] cfg80211: World regulatory domain updated:
  92. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 8.900000] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
  93. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 8.900000] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
  94. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 8.910000] cfg80211: (2457000 KHz - 2482000 KHz @ 40000 KHz), (300 mBi, 2000 mBm)
  95. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 8.920000] cfg80211: (2474000 KHz - 2494000 KHz @ 20000 KHz), (300 mBi, 2000 mBm)
  96. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 8.930000] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz), (300 mBi, 2000 mBm)
  97. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 8.930000] cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (300 mBi, 2000 mBm)
  98. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 8.940000] cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 0 mBm)
  99. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 9.020000] PPP generic driver version 2.4.2
  100. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 9.020000] NET: Registered protocol family 24
  101. Thu Jan 1 08:00:11 1970 kern.debug kernel: [ 9.100000] ath: EEPROM regdomain: 0x0
  102. Thu Jan 1 08:00:11 1970 kern.debug kernel: [ 9.100000] ath: EEPROM indicates default country code should be used
  103. Thu Jan 1 08:00:11 1970 kern.debug kernel: [ 9.100000] ath: doing EEPROM country->regdmn map search
  104. Thu Jan 1 08:00:11 1970 kern.debug kernel: [ 9.100000] ath: country maps to regdmn code: 0x3a
  105. Thu Jan 1 08:00:11 1970 kern.debug kernel: [ 9.100000] ath: Country alpha2 being used: US
  106. Thu Jan 1 08:00:11 1970 kern.debug kernel: [ 9.100000] ath: Regpair used: 0x3a
  107. Thu Jan 1 08:00:11 1970 kern.debug kernel: [ 9.110000] ieee80211 phy0: Selected rate control algorithm 'minstrel_ht'
  108. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 9.120000] cfg80211: Calling CRDA for country: US
  109. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 9.120000] cfg80211: Regulatory domain changed to country: US
  110. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 9.130000] cfg80211: DFS Master region FCC
  111. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 9.130000] cfg80211: (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp)
  112. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 9.140000] cfg80211: (2402000 KHz - 2472000 KHz @ 40000 KHz), (300 mBi, 2700 mBm)
  113. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 9.150000] cfg80211: (5170000 KHz - 5250000 KHz @ 80000 KHz), (300 mBi, 1700 mBm)
  114. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 9.160000] cfg80211: (5250000 KHz - 5330000 KHz @ 80000 KHz), (300 mBi, 2400 mBm)
  115. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 9.160000] cfg80211: (5490000 KHz - 5600000 KHz @ 80000 KHz), (300 mBi, 2400 mBm)
  116. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 9.170000] cfg80211: (5650000 KHz - 5710000 KHz @ 40000 KHz), (300 mBi, 2400 mBm)
  117. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 9.180000] cfg80211: (5735000 KHz - 5835000 KHz @ 80000 KHz), (300 mBi, 3000 mBm)
  118. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 9.190000] cfg80211: (57240000 KHz - 63720000 KHz @ 2160000 KHz), (N/A, 4000 mBm)
  119. Thu Jan 1 08:00:11 1970 kern.info kernel: [ 9.200000] ieee80211 phy0: Atheros AR9330 Rev:1 mem=0xb8100000, irq=2
  120. Thu Jan 1 08:00:13 1970 authpriv.info dropbear[545]: Not backgrounding
  121. Thu Jan 1 08:00:15 1970 kern.info kernel: [ 15.370000] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
  122. Thu Jan 1 08:00:15 1970 kern.info kernel: [ 15.370000] device eth0 entered promiscuous mode
  123. Thu Jan 1 08:00:15 1970 kern.info kernel: [ 15.380000] IPv6: ADDRCONF(NETDEV_UP): br-lan: link is not ready
  124. Thu Jan 1 08:00:15 1970 daemon.notice netifd: Interface 'lan' is now up
  125. Thu Jan 1 08:00:15 1970 daemon.notice netifd: Interface 'loopback' is now up
  126. Thu Jan 1 08:00:16 1970 user.notice firewall: Reloading firewall due to ifup of lan (br-lan)
  127. Thu Jan 1 08:00:16 1970 kern.info kernel: [ 16.980000] IPv6: ADDRCONF(NETDEV_UP): wlan0: link is not ready
  128. Thu Jan 1 08:00:17 1970 kern.info kernel: [ 16.990000] device wlan0 entered promiscuous mode
  129. Thu Jan 1 08:00:17 1970 kern.info kernel: [ 17.030000] br-lan: port 2(wlan0) entered forwarding state
  130. Thu Jan 1 08:00:17 1970 kern.info kernel: [ 17.030000] br-lan: port 2(wlan0) entered forwarding state
  131. Thu Jan 1 08:00:17 1970 kern.info kernel: [ 17.030000] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
  132. Thu Jan 1 08:00:17 1970 kern.info kernel: [ 17.040000] IPv6: ADDRCONF(NETDEV_CHANGE): br-lan: link becomes ready
  133. Thu Jan 1 08:00:19 1970 kern.info kernel: [ 19.030000] br-lan: port 2(wlan0) entered forwarding state
  134. Thu Jan 1 08:00:20 1970 daemon.info hostapd: wlan0: STA 08:10:75:d9:0c:3a IEEE 802.11: authenticated
  135. Thu Jan 1 08:00:20 1970 daemon.info hostapd: wlan0: STA 08:10:75:d9:0c:3a IEEE 802.11: associated (aid 1)
  136. Thu Jan 1 08:00:20 1970 user.emerg syslog: setting up led flashing
  137. Thu Jan 1 08:00:20 1970 user.emerg syslog: setting up led Relay
  138. Thu Jan 1 08:00:21 1970 daemon.info dnsmasq[782]: started, version 2.66 cachesize 150
  139. Thu Jan 1 08:00:21 1970 daemon.info dnsmasq[782]: compile time options: no-IPv6 GNU-getopt no-DBus no-i18n no-IDN DHCP no-DHCPv6 no-Lua TFTP no-conntrack no-ipset no-auth
  140. Thu Jan 1 08:00:21 1970 daemon.info dnsmasq-dhcp[782]: DHCP, IP range 192.168.10.100 -- 192.168.10.249, lease time 12h
  141. Thu Jan 1 08:00:21 1970 daemon.info dnsmasq[782]: using local addresses only for domain lan
  142. Thu Jan 1 08:00:21 1970 daemon.warn dnsmasq[782]: no servers found in /tmp/resolv.conf.auto, will retry
  143. Thu Jan 1 08:00:21 1970 daemon.info dnsmasq[782]: read /etc/hosts - 1 addresses
  144. Thu Jan 1 08:00:21 1970 daemon.info dnsmasq-dhcp[782]: read /etc/ethers - 0 addresses
  145. Thu Jan 1 08:00:21 1970 user.emerg syslog: - init complete -
  146. Thu Jan 1 08:00:23 1970 daemon.info dnsmasq-dhcp[782]: DHCPREQUEST(br-lan) 192.168.10.224 08:10:75:d9:0c:3a
  147. Thu Jan 1 08:00:23 1970 daemon.info dnsmasq-dhcp[782]: DHCPACK(br-lan) 192.168.10.224 08:10:75:d9:0c:3a P9
  148. Thu Jan 1 08:00:33 1970 authpriv.info dropbear[873]: Child connection from 192.168.10.224:4287
  149. Thu Jan 1 08:00:35 1970 authpriv.notice dropbear[873]: Password auth succeeded for 'root' from 192.168.10.224:4287
  150. root@OpenWrt:~

点击(此处)折叠或打开
  1. BusyBox v1.19.4 (2014-03-27 17:39:06 CST) built-in shell (ash)
  2. Enter 'help' for a list of built-in commands.

  3.   _______ ________ __
  4.  | |.-----.-----.-----.| | | |.----.| |_
  5.  | - || _ | -__| || | | || _|| _|
  6.  |_______|| __|_____|__|__||________||__| |____|
  7.           |__| W I R E L E S S F R E E D O M
  8.  -----------------------------------------------------
  9.  BARRIER BREAKER (Bleeding Edge, r39365)
  10.  -----------------------------------------------------
  11.   * 1/2 oz Galliano Pour all ingredients into
  12.   * 4 oz cold Coffee an irish coffee mug filled
  13.   * 1 1/2 oz Dark Rum with crushed ice. Stir.
  14.   * 2 tsp. Creme de Cacao
  15.  -----------------------------------------------------
  16. root@OpenWrt:~# uname -a
    Linux OpenWrt 3.10.26 #2 Thu Mar 27 18:14:15 CST 2014 mips GNU/Linux

  17. root@OpenWrt:~# df -h
  18. Filesystem Size Used Available Use% Mounted on
  19. rootfs 1.0M 232.0K 792.0K 23% /
  20. /dev/root 2.0M 2.0M 0 100% /rom
  21. tmpfs 14.2M 3.9M 10.3M 27% /tmp
  22. /dev/mtdblock3 1.0M 232.0K 792.0K 23% /overlay
  23. overlayfs:/overlay 1.0M 232.0K 792.0K 23% /
  24. tmpfs 512.0K 0 512.0K 0% /dev

  25. root@OpenWrt:~# opkg list-installed
  26. Collected errors:
  27.  * opkg_conf_load: Couldn't stat /etc/opkg.conf: No such file or directory.
  28. root@OpenWrt:~# find / -name opkg
  29. /bin/opkg
  30. /overlay/bin/opkg
  31. /rom/usr/lib/opkg
  32. /usr/lib/opkg

  33. root@OpenWrt:~# opkg list-installed
  34. atftp - 0.7-1
  35. base-files - 150-r39365
  36. busybox - 1.19.4-7
  37. dnsmasq - 2.66-5
  38. dropbear - 2013.59-1
  39. firewall - 2013-12-17
  40. hostapd-common - 20131120-1
  41. iptables - 1.4.20-1
  42. iw - 3.10-1
  43. jshn - 2013-12-02-318d682d29a8974aa53bd7dc523f1514eb0eddb9
  44. kernel - 3.10.26-1-91ec754bdb524103593302179b7f593e
  45. kmod-ath - 3.10.26+2013-11-05-5
  46. kmod-ath9k - 3.10.26+2013-11-05-5
  47. kmod-ath9k-common - 3.10.26+2013-11-05-5
  48. kmod-cfg80211 - 3.10.26+2013-11-05-5
  49. kmod-crypto-aes - 3.10.26-1
  50. kmod-crypto-arc4 - 3.10.26-1
  51. kmod-crypto-core - 3.10.26-1
  52. kmod-gpio-button-hotplug - 3.10.26-1
  53. kmod-ip6tables - 3.10.26-1
  54. kmod-ipt-conntrack - 3.10.26-1
  55. kmod-ipt-core - 3.10.26-1
  56. kmod-ipt-nat - 3.10.26-1
  57. kmod-ipt-nathelper - 3.10.26-1
  58. kmod-ipv6 - 3.10.26-1
  59. kmod-leds-gpio - 3.10.26-1
  60. kmod-ledtrig-default-on - 3.10.26-1
  61. kmod-ledtrig-netdev - 3.10.26-1
  62. kmod-ledtrig-timer - 3.10.26-1
  63. kmod-lib-crc-ccitt - 3.10.26-1
  64. kmod-mac80211 - 3.10.26+2013-11-05-5
  65. kmod-nls-base - 3.10.26-1
  66. kmod-ppp - 3.10.26-1
  67. kmod-pppoe - 3.10.26-1
  68. kmod-pppox - 3.10.26-1
  69. kmod-slhc - 3.10.26-1
  70. libblobmsg-json - 2013-12-02-318d682d29a8974aa53bd7dc523f1514eb0eddb9
  71. libc - 0.9.33.2-1
  72. libgcc - 4.6-linaro-1
  73. libip4tc - 1.4.20-1
  74. libip6tc - 1.4.20-1
  75. libiwinfo - 47
  76. libiwinfo-lua - 47
  77. libjson-c - 0.11-2
  78. libjson-script - 2013-12-02-318d682d29a8974aa53bd7dc523f1514eb0eddb9
  79. liblua - 5.1.5-1
  80. libncurses - 5.9-1
  81. libnl-tiny - 0.1-3
  82. libpthread - 0.9.33.2-1
  83. libreadline - 6.2-1
  84. libubox - 2013-12-02-318d682d29a8974aa53bd7dc523f1514eb0eddb9
  85. libubus - 2013-11-07-8ea96670367e5dd23988b51ee4f0f790393effaf
  86. libubus-lua - 2013-11-07-8ea96670367e5dd23988b51ee4f0f790393effaf
  87. libuci - 2013-12-02.1-1
  88. libuci-lua - 2013-12-02.1-1
  89. libxtables - 1.4.20-1
  90. lua - 5.1.5-1
  91. mtd - 20
  92. netifd - 2014-01-20-88b3e92933925c09cfb6e95e9c8645727654ddf7
  93. procd - 2014-01-20-311eb167fce73dbc97c7d9dfcc43a59b5695a8f7
  94. relayd - 2011-10-24-4e8f1fa4ca2b176500362843a9e57ea5abd4b7a3
  95. restorefactory - 1-6
  96. swconfig - 10
  97. terminfo - 5.9-1
  98. uboot-envtools - 2013.10-1
  99. ubox - 2014-01-21-2b32e9059166a23204fcf01e65a9184b3c39166b
  100. ubus - 2013-11-07-8ea96670367e5dd23988b51ee4f0f790393effaf
  101. ubusd - 2013-11-07-8ea96670367e5dd23988b51ee4f0f790393effaf
  102. uci - 2013-12-02.1-1
  103. uhttpd - 2013-11-21-cd66639800ee2882a0867ec54868502eb9b893d8
  104. uhttpd-mod-ubus - 2013-11-21-cd66639800ee2882a0867ec54868502eb9b893d8
  105. wpad-mini - 20131120-1
  106. Collected errors:
  107. '* opkg_conf_parse_file: /etc/opkg.conf:9: Ignoring invalid line: `Booted from internal rom

  108. root@OpenWrt:~# df -h
  109. Filesystem Size Used Available Use% Mounted on
  110. rootfs 1.0M 284.0K 740.0K 28% /
  111. /dev/root 2.0M 2.0M 0 100% /rom
  112. tmpfs 14.2M 3.9M 10.3M 27% /tmp
  113. /dev/mtdblock3 1.0M 284.0K 740.0K 28% /overlay
  114. overlayfs:/overlay 1.0M 284.0K 740.0K 28% /
  115. tmpfs 512.0K 0 512.0K 0% /dev
  116. root@OpenWrt:~

3. 启动内容: /etc/rc.local

点击(此处)折叠或打开

  1. # Put your custom commands here that should be executed once
  2. # the system init finished. By default this file does nothing.
  3. sleep 5
  4. /sbin/kkeps_on &
  5. /sbin/kkeps_off &
  6. /sbin/kkeps_seekwifi &
  7. /sbin/kkeps_reconect &

  8. exit 0

4. 定时任务: /etc/crontabs/root
   无. 

5. 相关的button和led的处理.  
/etc/config/system

点击(此处)折叠或打开

  1. config system
  2.     option hostname 'OpenWrt'
  3.     option zonename 'Asia/Shanghai'
  4.     option timezone 'CST-8'
  5.     option conloglevel '8'
  6.     option cronloglevel '8'

  7. config timeserver 'ntp'
  8.     list server '0.openwrt.pool.ntp.org'
  9.     list server '1.openwrt.pool.ntp.org'
  10.     list server '2.openwrt.pool.ntp.org'
  11.     list server '3.openwrt.pool.ntp.org'
  12.     option enable_server '0'

  13. config restorefactory
  14.     option button 'reset'
  15.     option action 'pressed'
  16.     option timeout '2'

  17. config led
  18.     option name 'flashing'
  19.     option sysfs 'tp-link:blue:config'    #修改内核源码
  20.     option trigger 'timer'
  21.     option delayon '800'
  22.     option delayoff '800'

  23. config led
  24.     option name 'Relay'
  25.     option sysfs 'tp-link:blue:relay'    #修改内核源码
  26.     option trigger 'none'
  27.     option default '0'


/etc/hotplug.d/button/50-restorefactory, 必须chmod +x

点击(此处)折叠或打开

  1. #!/bin/sh

  2. system_config() {
  3.     config_get button "$1" button "reset"
  4.     config_get action "$1" action "pressed"
  5.     config_get timeout "$1" timeout "2"
  6. }

  7. config_load system
  8. config_foreach system_config restorefactory

  9. [ "$BUTTON" = "$button" ] && {

  10.     [ -f /tmp/run/restorefactory.pid ] && read PID < /tmp/run/restorefactory.pid && kill $PID && rm /tmp/run/restorefactory.pid && logger -p user.info -t "restorefactory" "restore to factory defaults aborted"

  11.     [ "$ACTION" = "$action" ] && {

  12.         if [ "$timeout" -gt 0 ]
  13.         then
  14.             sleep "$timeout" && firstboot && reboot &
  15.             echo $! > /tmp/run/restorefactory.pid
  16.             logger -p user.info -t "restorefactory" "restoring to factory defaults in $timeout seconds"
  17.         elif [ "$timeout" -eq 0 ]
  18.         then
  19.             firstboot && reboot &
  20.         else
  21.             logger -p user.info -t "restorefactory" "invalid timeout value ($timeout)"
  22.         fi
  23.     }
  24. }

  25.         [ "$BUTTON" = "$button" ] && [ "$ACTION" = "$action" ] && {
  26.                 SW=$(uci get system.@led[-1].default)
  27.                 [ $SW == '0' ] && uci set system.@led[-1].default=1
  28.                 [ $SW == '0' ] || uci set system.@led[-1].default=0
  29.                 uci commit
  30.                 /etc/init.d/led restart
  31.         }

/etc/init.d/led

点击(此处)折叠或打开

  1. #!/bin/sh /etc/rc.common
  2. (C) 2008 openwrt.org

  3. START=96

  4. load_led() {
  5.     local name
  6.     local sysfs
  7.     local trigger
  8.     local dev
  9.     local mode
  10.     local default
  11.     local delayon
  12.     local delayoff
  13.     local interval

  14.     config_get sysfs $1 sysfs
  15.     config_get name $1 name "$sysfs"
  16.     config_get trigger $1 trigger "none"
  17.     config_get dev $1 dev
  18.     config_get mode $1 mode "link"
  19.     config_get_bool default $1 default "nil"
  20.     config_get delayon $1 delayon
  21.     config_get delayoff $1 delayoff
  22.     config_get interval $1 interval "50"
  23.     config_get port_state $1 port_state
  24.     config_get delay $1 delay "150"
  25.     config_get message $1 message ""

  26.     if [ "$trigger" = "rssi" ]; then
  27.         # handled by rssileds userspace process
  28.         return
  29.     fi

  30.     [ -/sys/class/leds/${sysfs}/brightness ] && {
  31.         echo "setting up led ${name}"
  32.         [ "$default" != nil ] && {
  33.             [ $default -eq 1 ] &&
  34.                 echo 1 >/sys/class/leds/${sysfs}/brightness
  35.             [ $default -eq 1 ] ||
  36.                 echo 0 >/sys/class/leds/${sysfs}/brightness
  37.         }
  38.         echo $trigger > /sys/class/leds/${sysfs}/trigger
  39.         case "$trigger" in
  40.         "netdev")
  41.             [ -"$dev" ] && {
  42.                 echo $dev > /sys/class/leds/${sysfs}/device_name
  43.                 echo $mode > /sys/class/leds/${sysfs}/mode
  44.             }
  45.             ;;

  46.         "timer")
  47.             [ -"$delayon" ] && \
  48.                 echo $delayon > /sys/class/leds/${sysfs}/delay_on
  49.             [ -"$delayoff" ] && \
  50.                 echo $delayoff > /sys/class/leds/${sysfs}/delay_off
  51.             ;;

  52.         "usbdev")
  53.             [ -"$dev" ] && {
  54.                 echo $dev > /sys/class/leds/${sysfs}/device_name
  55.                 echo $interval > /sys/class/leds/${sysfs}/activity_interval
  56.             }
  57.             ;;

  58.         "port_state")
  59.             [ -"$port_state" ] && \
  60.                 echo $port_state > /sys/class/leds/${sysfs}/port_state
  61.             ;;

  62.         "morse")
  63.             echo $message > /sys/class/leds/${sysfs}/message
  64.             echo $delay > /sys/class/leds/${sysfs}/delay
  65.             ;;

  66.         switch[0-9]*)
  67.             local port_mask

  68.             config_get port_mask $1 port_mask
  69.             [ -"$port_mask" ] && \
  70.                 echo $port_mask > /sys/class/leds/${sysfs}/port_mask
  71.             ;;
  72.         esac
  73.     }
  74. }

  75. start() {
  76.     [ -/sys/class/leds/ ] && {
  77.         config_load system
  78.         config_foreach load_led led
  79.     }
  80. }

/etc/rc.button下共有4个文件.
/etc/rc.button/failsafe

点击(此处)折叠或打开

  1. #!/bin/sh

  2. [ "${TYPE}" = "switch" ] || echo ${BUTTON} > /tmp/failsafe_button

/etc/rc.button/reset

点击(此处)折叠或打开

  1. #!/bin/sh

  2. [ "${ACTION}" = "released" ] || exit 0

  3. . /lib/functions.sh

  4. logger "$BUTTON pressed for $SEEN seconds"

  5. if [ "$SEEN" -gt 2 ]
  6. then
  7.     echo "FACTORY RESET" > /dev/console
  8.     jffs2reset -y && reboot &
  9. fi

/etc/rc.button/rfkill

点击(此处)折叠或打开

  1. #!/bin/sh

  2. [ "${ACTION}" = "released" -o -n "${TYPE}" ] || exit 0

  3. . /lib/functions.sh

  4. local rfkill_state=0

  5. wifi_rfkill_set() {
  6.     uci set wireless.$1.disabled=$rfkill_state
  7. }

  8. wifi_rfkill_check() {
  9.     local disabled
  10.     config_get disabled $1 disabled
  11.     [ "$disabled" = "1" ] || rfkill_state=1
  12. }

  13. config_load wireless
  14. case "${TYPE}" in
  15. "switch")
  16.     [ "${ACTION}" = "released" ] && rfkill_state=1
  17.     ;;
  18. *)
  19.     config_foreach wifi_rfkill_check wifi-device
  20.     ;;
  21. esac
  22. config_foreach wifi_rfkill_set wifi-device
  23. uci commit wireless
  24. wifi up

/etc/rc.button/wps

点击(此处)折叠或打开

  1. #!/bin/sh

  2. for dir in /var/run/hostapd-*; do
  3.     [ -d "$dir" ] || continue
  4.     hostapd_cli -p "$dir" wps_pbc
  5. done


5. 网络配置,
/etc/config/network

点击(此处)折叠或打开

  1. config interface 'loopback'
  2.     option ifname 'lo'
  3.     option proto 'static'
  4.     option ipaddr '127.0.0.1'
  5.     option netmask '255.0.0.0'

  6. config globals 'globals'
  7.     option ula_prefix 'fd77:3705:edc7::/48'

  8. config interface 'lan'
  9.     option ifname 'eth0'
  10.     option type 'bridge'
  11.     option proto 'static'
  12.     option ipaddr '192.168.10.253'
  13.     option netmask '255.255.255.0'
  14.     option ip6assign '60'

/etc/config/wireless

点击(此处)折叠或打开

  1. config wifi-device radio0
  2.     option type mac80211
  3.     option channel 11
  4.     option hwmode    11ng
  5.     option path    'platform/ar933x_wmac'
  6.     option htmode    HT20
  7.     list ht_capab    SHORT-GI-20
  8.     list ht_capab    SHORT-GI-40
  9.     list ht_capab    RX-STBC1
  10.     list ht_capab    DSSS_CCK-40
  11.     # REMOVE THIS LINE TO ENABLE WIFI:
  12.     option disabled 0

  13. config wifi-iface
  14.     option device radio0
  15.     option network lan
  16.     option mode ap
  17.     option ssid 0K_SP3
  18.     option encryption none

最后刷自己的固件了. winscp将自己的固件xxx.bin拷贝/tmp, 执行命令:
mtd -r wirte /tmp/xxx.bin firmware

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