openwrt install on mzk ( or cqw) .... tftpおよび insturctionのメモ(我が家の環境のメモざんす)
openwrt on mzk ( or cqw) .... tftp のメモ(我が家の環境のメモざんす)
2012/08 atari
まずは、192.168.1.7のPCの電源を入れる(ibm thinkpad r40e)
このPCはすでにtftpサーバーになっているので、
thinkpad:/tftpbootにおいてあるインストラクションをDLできる
追記 201306 tftpd server on Ubuntuの備忘
http://d.hatena.ne.jp/toshi_hirasawa/20120805/1371127741
追記ここまで
[hirasawa@aspire-white ~]$ tftp 192.168.1.7 tftp> get instruct.txt Received 623 bytes in 0.1 seconds tftp> quit
インストラクションの中身を覗くと
[root@cent5-64b-40 tftpboot]# pwd /tftpboot [root@cent5-64b-40 tftpboot]# [root@cent5-64b-40 tftpboot]# md5sum openwrt-ar71xx-mzk-w04nu-squashfs.bin* 0921bccd39bd4808b878b79a43d08e89 openwrt-ar71xx-mzk-w04nu-squashfs.bin 0921bccd39bd4808b878b79a43d08e89 openwrt-ar71xx-mzk-w04nu-squashfs.bin.rc6maybe [root@cent5-64b-40 tftpboot]# ----------- setenv ipaddr 192.168.1.100 setenv serverip 192.168.1.7 erase 0xbf050000 +0x770000 tftp 0xa0800000 openwrt-ar71xx-mzk-w04nu-squashfs.bin cp.b 0xa0800000 0xbf050000 0x770000 reset # cp -pr /etc/config/network /etc/config/network.orig # - option ipaddr 192.168.1.1 + option ipaddr 192.168.1.100 # reboot [hirasawa@aspire-white ~]$
今の私の場合(aspire-white)
にて作業ちう(myPCとする)
として
myPC(USB)<>AE-ATmega<>mzk(or cqw)
って感じでhard-wireして
http://d.hatena.ne.jp/toshi_hirasawa/20120701/1341113718
minicom経由(115200ボー)でmzk(or cqw)のboot-loaderを立ち上げる。
ctr-cをタイミングよく押せば、うまくいくとこうなるはず
Welcome to minicom 2.5 OPTIONS: I18n Compiled on Feb 5 2011, 06:31:35. Port /dev/ttyUSB0 Press CTRL-A Z for help on special keys � U-Boot 1.1.4 (Oct 25 2007 - 15:28:59) AP81 (ar7100) U-boot DRAM: sri 32 MB Top of RAM usable for U-Boot at: 82000000 Reserving 222k for U-Boot at: 81fc8000 Reserving 192k for malloc() at: 81f98000 Reserving 44 Bytes for Board Info at: 81f97fd4 Reserving 36 Bytes for Global Data at: 81f97fb0 Reserving 128k for boot params() at: 81f77fb0 Stack Pointer at: 81f77f98 Now running in RAM - U-Boot at: 81fc8000 id read 0x100000ff flash size 8MB, sector count = 128 Flash: 8 MB *** Warning - bad CRC, using default environment In: serial Out: serial Err: serial Net: ag7100_enet_initialize... Fetching MAC Address from 0x81fedb10 eth0: 00:90:cc:f1:ef:dd dup 1 speed 100 eth0 up eth0 ====check reset button function==== ### main_loop entered: bootdelay=4 ### main_loop: bootcmd="bootm 0xbf050000" Hit any key to stop autoboot: 0 ar7100>
ar7100>
ってプロンプトを確認したら、
mzk(or cqw)のLANポートをあなたのLAN環境(192.168.1.xx/24)にethernet的に
hardwire
ここまでくれば
あとはいんすたくしょんどおりでおけ
ar7100> ar7100> setenv ipaddr 192.168.1.100 ar7100> setenv serverip 192.168.1.7 ar7100> ar7100> ping 192.168.1.7 Using eth0 device host 192.168.1.7 is alive ar7100> erase 0xbf050000 +0x770000 Erase Flash from 0xbf050000 to 0xbf7bffff in Bank # 1 First 0x5 last 0x7b sector size 0x10000 123 Erased 119 sectors ar7100> tftp 0xa0800000 openwrt-ar71xx-mzk-w04nu-squashfs.bin Using eth0 device TFTP from server 192.168.1.7; our IP address is 192.168.1.100 Filename 'openwrt-ar71xx-mzk-w04nu-squashfs.bin'. Load address: 0xa0800000 Loading: ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ############################# done Bytes transferred = 7798784 (770000 hex) ar7100> cp.b 0xa0800000 0xbf050000 0x770000 Copy to Flash... write addr: bf050000 done ar7100> Copy to Flash... write addr: bf050000 done ar7100> reset Resetting...� U-Boot 1.1.4 (Oct 25 2007 - 15:28:59) AP81 (ar7100) U-boot DRAM: sri 32 MB Top of RAM usable for U-Boot at: 82000000 Reserving 222k for U-Boot at: 81fc8000 Reserving 192k for malloc() at: 81f98000 Reserving 44 Bytes for Board Info at: 81f97fd4 Reserving 36 Bytes for Global Data at: 81f97fb0 Reserving 128k for boot params() at: 81f77fb0 Stack Pointer at: 81f77f98 Now running in RAM - U-Boot at: 81fc8000 id read 0x100000ff flash size 8MB, sector count = 128 Flash: 8 MB *** Warning - bad CRC, using default environment In: serial Out: serial Err: serial Net: ag7100_enet_initialize... Fetching MAC Address from 0x81fedb10 eth0: 00:90:cc:f1:ef:dd dup 1 speed 100 eth0 up eth0 ====check reset button function==== ### main_loop entered: bootdelay=4 ### main_loop: bootcmd="bootm 0xbf050000" Hit any key to stop autoboot: 0 ## Booting image at bf050000 ... Image Name: MIPS OpenWrt Linux-2.6.32.10 Created: 2010-04-02 16:05:32 UTC Image Type: MIPS Linux Kernel Image (gzip compressed) Data Size: 1225421 Bytes = 1.2 MB Load Address: 80060000 Entry Point: 80060000 Verifying Checksum ... OK Uncompressing Kernel Image ... OK No initrd ## Transferring control to Linux (at address 80060000) ... ## Giving linux memsize in bytes, 33554432 Starting kernel ... Linux version 2.6.32.10 (openwrt@wrt1.marcant.net) (gcc version 4.3.3 (GCC) ) #0 bootconsole [early0] enabled CPU revision is: 00019374 (MIPS 24Kc) Atheros AR9132 rev 1, CPU:400.000 MHz, AHB:200.000 MHz, DDR:400.000 MHz Determined physical RAM map: memory: 02000000 @ 00000000 (usable) Initrd not found or empty - disabling initrd Zone PFN ranges: Normal 0x00000000 -> 0x00002000 Movable zone start PFN for each node early_node_map[1] active PFN ranges 0: 0x00000000 -> 0x00002000 Built 1 zonelists in Zone order, mobility grouping on. Total pages: 8128 Kernel command line: rootfstype=squashfs,yaffs,jffs2 noinitrd console=ttyS0,115U PID hash table entries: 128 (order: -3, 512 bytes) Dentry cache hash table entries: 4096 (order: 2, 16384 bytes) Inode-cache hash table entries: 2048 (order: 1, 8192 bytes) Primary instruction cache 64kB, VIPT, 4-way, linesize 32 bytes. Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes Writing ErrCtl register=00000000 Readback ErrCtl register=00000000 Memory: 29332k/32768k available (2098k kernel code, 3436k reserved, 400k data, ) SLUB: Genslabs=7, HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 Hierarchical RCU implementation. NR_IRQS:56 Calibrating delay loop... 266.24 BogoMIPS (lpj=1331200) Mount-cache hash table entries: 512 NET: Registered protocol family 16 MIPS: machine is Planex MZK-W04NU bio: create slab <bio-0> at 0 Switching to clocksource MIPS NET: Registered protocol family 2 IP route cache hash table entries: 1024 (order: 0, 4096 bytes) TCP established hash table entries: 1024 (order: 1, 8192 bytes) TCP bind hash table entries: 1024 (order: 0, 4096 bytes) TCP: Hash tables configured (established 1024 bind 1024) TCP reno registered NET: Registered protocol family 1 squashfs: version 4.0 (2009/01/31) Phillip Lougher Registering mini_fo version $Id$ JFFS2 version 2.2. (NAND) (SUMMARY) �� 2001-2006 Red Hat, Inc. yaffs Mar 28 2010 17:53:41 Installing. msgmni has been set to 57 io scheduler noop registered io scheduler deadline registered (default) Serial: 8250/16550 driver, 1 ports, IRQ sharing disabled serial8250.0: ttyS0 at MMIO 0x18020000 (irq = 11) is a 16550A console [ttyS0] enabled, bootconsole disabled console [ttyS0] enabled, bootconsole disabled Atheros AR71xx SPI Controller driver version 0.2.4 m25p80 spi0.0: m25p64 (8192 Kbytes) Searching for RedBoot partition table in spi0.0 at offset 0x7e0000 Searching for RedBoot partition table in spi0.0 at offset 0x7f0000 No RedBoot partition table detected in spi0.0 spi0.0: no WRT160NL signature found Creating 6 MTD partitions on "spi0.0": 0x000000000000-0x000000040000 : "u-boot" 0x000000040000-0x000000050000 : "u-boot-env" 0x000000050000-0x0000001b0000 : "kernel" 0x0000001b0000-0x0000007e0000 : "rootfs" mtd: partition "rootfs" set to be root filesystem mtd: partition "rootfs_data" created automatically, ofs=2F0000, len=4F0000 0x0000002f0000-0x0000007e0000 : "rootfs_data" 0x0000007e0000-0x000000800000 : "art" 0x000000050000-0x0000007c0000 : "firmware" ag71xx_mdio: probed eth0: Atheros AG71xx at 0xb9000000, irq 4 eth1: Atheros AG71xx at 0xba000000, irq 5 Atheros AR71xx hardware watchdog driver version 0.1.0 TCP westwood registered NET: Registered protocol family 17 802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com> All bugs added by David S. Miller <davem@redhat.com> VFS: Mounted root (squashfs filesystem) readonly on device 31:3. Freeing unused kernel memory: 152k freed Please be patient, while OpenWrt loads ... gpio-buttons driver version 0.1.2 input: gpio-buttons as /devices/platform/gpio-buttons/input/input0 Button Hotplug driver version 0.3.1 eth0: link up (100Mbps/Full duplex) - preinit - Registered led device: mzk-w04nu:green:status Registered led device: mzk-w04nu:blue:wps Registered led device: mzk-w04nu:green:wlan Registered led device: mzk-w04nu:green:usb Registered led device: mzk-w04nu:green:ap Registered led device: mzk-w04nu:green:router Press the [f] key and hit [enter] to enter failsafe mode - regular preinit - jffs2 not ready yet; using ramdisk mini_fo: using base directory: / mini_fo: using storage directory: /tmp/root - init - eth0: link down Please press Enter to activate this console. eth0: link up (100Mbps/Full duplex) device eth0 entered promiscuous mode br-lan: port 1(eth0) entering forwarding state PPP generic driver version 2.4.2 ip_tables: (C) 2000-2006 Netfilter Core Team NET: Registered protocol family 24 nf_conntrack version 0.5.0 (460 buckets, 1840 max) CONFIG_NF_CT_ACCT is deprecated and will be removed soon. Please use nf_conntrack.acct=1 kernel parameter, acct=1 nf_conntrack module option or sysctl net.netfilter.nf_conntrack_acct=1 to enable it. jffs2_scan_eraseblock(): End of filesystem marker found at 0x0 jffs2_build_filesystem(): unlocking the mtd device... done. jffs2_build_filesystem(): erasing all blocks after the end marker... done. mini_fo: using base directory: / mini_fo: using storage directory: /overlay BusyBox v1.15.3 (2010-03-28 15:11:15 CEST) built-in shell (ash) Enter 'help' for a list of built-in commands. _______ ________ __ | |.-----.-----.-----.| | | |.----.| |_ | - || _ | -__| || | | || _|| _| |_______|| __|_____|__|__||________||__| |____| |__| W I R E L E S S F R E E D O M BackFire (10.03-rc3, r20653) ---------------------- * 1/3 shot Kahlua In a shot glass, layer Kahlua * 1/3 shot Bailey's on the bottom, then Bailey's, * 1/3 shot Vodka then Vodka. --------------------------------------------------- root@OpenWrt:/#
とまぁ、たちあがってくれるわけですよ あんがと
この時のステータスは
BusyBox v1.15.3 (2010-03-28 15:11:15 CEST) built-in shell (ash) Enter 'help' for a list of built-in commands. _______ ________ __ | |.-----.-----.-----.| | | |.----.| |_ | - || _ | -__| || | | || _|| _| |_______|| __|_____|__|__||________||__| |____| |__| W I R E L E S S F R E E D O M BackFire (10.03-rc3, r20653) ---------------------- * 1/3 shot Kahlua In a shot glass, layer Kahlua * 1/3 shot Bailey's on the bottom, then Bailey's, * 1/3 shot Vodka then Vodka. --------------------------------------------------- root@OpenWrt:/# root@OpenWrt:/# root@OpenWrt:/# root@OpenWrt:/# root@OpenWrt:/# root@OpenWrt:/# ifconfig -a br-lan Link encap:Ethernet HWaddr 00:90:CC:F1:EF:DD inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:41 errors:0 dropped:0 overruns:0 frame:0 TX packets:1 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:3418 (3.3 KiB) TX bytes:402 (402.0 B) eth0 Link encap:Ethernet HWaddr 00:90:CC:F1:EF:DD UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1069 errors:0 dropped:0 overruns:0 frame:0 TX packets:2 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:204728 (199.9 KiB) TX bytes:1449 (1.4 KiB) Interrupt:4 eth1 Link encap:Ethernet HWaddr 00:90:CC:F1:EF:DE UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Interrupt:5 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) root@OpenWrt:/#
って感じですね
ディフォでは
192.168.1.1.
になっているのでさすがにこれはまずいので
# cp -pr /etc/config/network /etc/config/network.orig # - option ipaddr 192.168.1.1 + option ipaddr 192.168.1.100 てsayouwo vi or sed de root@OpenWrt:/etc/config# cat /etc/config/network config interface loopback option ifname lo option proto static option ipaddr 127.0.0.1 option netmask 255.0.0.0 config interface lan option ifname eth0 option type bridge option proto static option ipaddr 192.168.1.100 option netmask 255.255.255.0 config interface wan option ifname eth1 option proto dhcp root@OpenWrt:/etc/config# <|| ここらを編集 >|| root@OpenWrt:/etc/config# cat /etc/config/network config interface loopback option ifname lo option proto static option ipaddr 127.0.0.1 option netmask 255.0.0.0 config interface lan option ifname eth0 option type bridge option proto static option ipaddr 192.168.1.100 option netmask 255.255.255.0 config interface wan option ifname eth1 option proto dhcp root@OpenWrt:/etc/config# root@OpenWrt:/etc/config# root@OpenWrt:/etc/config# root@OpenWrt:/etc/config# ip addr /bin/ash: ip: not found root@OpenWrt:/etc/config# root@OpenWrt:/etc/config# root@OpenWrt:/etc/config# ifconfig -a br-lan Link encap:Ethernet HWaddr 00:90:CC:F1:EF:DD inet addr:192.168.1.1 Bcast:192.168.1.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:185 errors:0 dropped:0 overruns:0 frame:0 TX packets:1 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:15380 (15.0 KiB) TX bytes:402 (402.0 B) eth0 Link encap:Ethernet HWaddr 00:90:CC:F1:EF:DD UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:4870 errors:0 dropped:0 overruns:0 frame:0 TX packets:2 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:924424 (902.7 KiB) TX bytes:1449 (1.4 KiB) Interrupt:4 eth1 Link encap:Ethernet HWaddr 00:90:CC:F1:EF:DE UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Interrupt:5 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) root@OpenWrt:/etc/config# root@OpenWrt:/etc/config# root@OpenWrt:/etc/config# cat /etc/config/network config interface loopback option ifname lo option proto static option ipaddr 127.0.0.1 option netmask 255.0.0.0 config interface lan option ifname eth0 option type bridge option proto static option ipaddr 192.168.1.100 option netmask 255.255.255.0 config interface wan option ifname eth1 option proto dhcp root@OpenWrt:/etc/config#
wired環境(MInimocm) kara reboot sureba
root@OpenWrt:/# ifconfig -a br-lan Link encap:Ethernet HWaddr 00:90:CC:F1:EF:DD inet addr:192.168.1.100 Bcast:192.168.1.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:1 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:402 (402.0 B) eth0 Link encap:Ethernet HWaddr 00:90:CC:F1:EF:DD UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:78 errors:0 dropped:0 overruns:0 frame:0 TX packets:2 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:14006 (13.6 KiB) TX bytes:1449 (1.4 KiB) Interrupt:4 eth1 Link encap:Ethernet HWaddr 00:90:CC:F1:EF:DE UP BROADCAST MULTICAST MTU:1500 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) Interrupt:5 lo Link encap:Local Loopback inet addr:127.0.0.1 Mask:255.0.0.0 UP LOOPBACK RUNNING MTU:16436 Metric:1 RX packets:0 errors:0 dropped:0 overruns:0 frame:0 TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:0 (0.0 B) TX bytes:0 (0.0 B) root@OpenWrt:/#
kokokara ha bug no sekai nanode to be continued
see U again