Experiments with OpenWRT Entry: wireless repeaters : WDS Date: Wed Nov 1 13:09:07 EST 2006 using wireless repeaters? check http://wiki.openwrt.org/OpenWrtDocs/Configuration werkt netjes. gedaan met kabelkes. werkt met bridging.. routing zou ook moeten werken. inderdaad, it does. dus, wds is gewoon een ptp link tusses basisstations, die in de router in linux weergegeven wordt als een extra interface. de eth1 (wireless) en wds0.* virtuele interfaces delen de fysische link. het kanaal moet natuurlijk hetzelfde zijn, omdat kanaal een eigenschap is van de RF tuner, niet van het digitale kanaal. waarschijnlijk kan dat niet zomaar snel geschakeld worden. Entry: new toy Date: Fri Mar 9 16:50:17 EST 2007 i want a new toy! looking fore some NAS device. either a maxtor shared storage, or a simpletech simpleshare. the latter has 8MB flash and a JTAG port in case one messes up the firmware. it has a simple 2-image TRX firmware. the maxtor has 2MB flash and a 2-stage boot: small image in flash and larger image on harddisk. it might be nice to keep things separate from HD. the simpletech should run openwrt too, wich might be a better choice. i don't really have time to muck with this too much, but it might be interesting as an exercise in 'how not to shoot yourself in the foot'. Entry: hacking la fonera Date: Fri Mar 9 21:41:37 EST 2007 after reset i have 0.7.0.r4, guess i'm lucky :) Entry: weller soldering irons Date: Sat Mar 10 10:33:52 EST 2007 there's only weller.. WESD51/WES51 TC. F/C selectable. *D = 220V. EC4001 oud model, TC, digital WTCPT closed loop, fixed temperature tip WDS81 discontinued -> WD1000. probably too much. WES51 $100 + $7 -> $73 + $7 WESD51 $140 + $7 Entry: scheme shell on openwrt Date: Tue Mar 27 17:42:50 EDT 2007 i managed to finally compile it, using a native compiler from http://uclibc.org/FAQ.html#dev_systems apparently, scsh/scheme48 doesn't like cross compilation, since it uses the generated image to perform further compilation. the debian uclibc-toolchain wrapper seems to be broken too. i tried this on mipsel debian (and i386). the only problem i have left is that the versions don't match. currently i just use another root fs, but that's not very elegant. Entry: gambit C on openwrt Date: Sat Oct 13 21:21:34 CEST 2007 i'd like to have a tool to write stuff in scheme on the openwrt box, without an expensive runtime. apparently gambit still needs some shared library support.. Entry: openwrt + debian Date: Sat Mar 8 15:25:48 CET 2008 the trick i'm using on zorro (simpleshare) might also work for ordinary pc: have a basic openwrt running (i.e. from ram) that can shut down the hard drive when it's not used. Entry: openwrt usb on zorro Date: Thu Mar 13 13:59:31 EDT 2008 src snapshots http://downloads.openwrt.org/kamikaze/7.09/brcm-2.4/packages needed ipkg install kmod-usb-ohci for (dmesg): usb-ohci.c: USB OHCI at membase 0xb8003000, IRQ 6 usb-ohci.c: usb-00:03.0, PCI device 14e4:4715 the other usb interfaces are bogus? not connected to ports?? lspci: 00:00.0 FLASH memory: Broadcom Corporation Sentry5 Chipcommon I/O Controller (rev 08) 00:01.0 Ethernet controller: Broadcom Corporation Sentry5 Ethernet Controller (rev 08) 00:02.0 Ethernet controller: Broadcom Corporation Sentry5 Ethernet Controller (rev 08) 00:03.0 USB Controller: Broadcom Corporation Sentry5 USB Controller (rev 08) 00:04.0 PCI bridge: Broadcom Corporation Sentry5 PCI Bridge (rev 08) 00:05.0 MIPS: Broadcom Corporation BCM3302 Sentry5 MIPS32 CPU (rev 08) 00:06.0 Modem: Broadcom Corporation BCM47xx V.92 56k modem (rev 08) 00:07.0 Network and computing encryption device: Broadcom Corporation Sentry5 Crypto Accelerator (rev 08) 00:08.0 RAM memory: Broadcom Corporation Sentry5 DDR/SDR RAM Controller (rev 08) 01:00.0 Host bridge: Broadcom Corporation BCM4704 PCI to SB Bridge 01:02.0 Mass storage controller: Artop Electronic Corp ATP865 NO-ROM (rev 07) 01:03.0 USB Controller: ALi Corporation USB 1.1 Controller (rev 03) 01:03.3 USB Controller: ALi Corporation USB 2.0 Controller (rev 01) Entry: wds / apsta Date: Sat Apr 12 11:13:04 EDT 2008 http://downloads.openwrt.org/kamikaze/docs/openwrt.html#x1-110001.2.2 Limitations: There are certain limitations when combining modes. Only the following mode combinations are supported: * Broadcom: o 1x sta, 0-3x ap o 1-4x ap o 1x adhoc WDS links can only be used in pure AP mode and cannot use WEP (except when sharing the settings with the master interface, which is done automatically). which makes me wonder if it's at all possible to use combined station and ap mode on the wrt54g? thought that was only possible with hostap/atheros? ha! http://forum.openwrt.org/viewtopic.php?pid=66191 The latest (4.150) broadcom drivers added support for multiple bssid configuration also: check 'wlc' command instead of wl. some solution using 'apsta' mode: http://forum.openwrt.org/viewtopic.php?pid=57449 ere's what I use for routed client mode (sta) on my WRT54GL running Kamikaze - your mileage may vary - /etc/config/network Code: config switch eth0 option vlan0 "0 1 2 3 4 5*" 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 type bridge option ifname "eth0.0" option proto static option ipaddr 10.8.8.1 option netmask 255.255.255.0 config interface wan option ifname wl0 option proto dhcp /etc/config/wireless Code: config wifi-device wl0 option type broadcom config wifi-iface option device wl0 option network wan option mode sta option ssid linksys ## For having a repeater AP, comment this section out if you don't want it config wifi-iface option device wl0 option network lan option mode ap option ssid OpenWrt option encryption psk2 option key 'a-wpa-key-goes-here' If the IP of the AP you're connecting to is 192.168.1.1, make sure you change network.lan.ipaddr to something else. -- this needs to sink in a bit. but it looks like repeater AP is really no problem.. enough for today. it's fun to play with these things, but sometimes a bit difficult to work around bugs and missing features.. let's see what the constraints are: * need wrt54g as client -> better antennas. * if possible, run it in repeater mode (apsta) then, on the PC client side a lot of things are possible. probably leaving one fonera + the netgear hub is going to be good enough. so.. in order to figure out how it works, somehow sniff the commands that get sent to wlc. Entry: zorro kamikaze Date: Sat Oct 18 08:56:45 CEST 2008 uses: http://downloads.openwrt.org/kamikaze/7.09/brcm-2.4/packages/ by default, but this has very little packages. manually downloaded and installed openvpn from 7.06 now i'm going crazy.. openvpn reports: Sat Oct 18 07:22:21 2008 /etc/openvpn/v/up tap0 1500 1592 192.168.14.53 255.255.255.0 init sh: /etc/openvpn/v/up: not found typing this manually gives the same! root@zorro:/etc/openvpn# /etc/openvpn/v/up tap0 1500 1592 192.168.14.53 255.255.255.0 init -ash: /etc/openvpn/v/up: not found the script really is there, and executable.. root@zorro:/etc/openvpn# cat /etc/openvpn/v/up #!/bin/bash ... weird.. Entry: bootstrapping and cross-compiling with qemu Date: Fri Jul 10 11:01:26 CEST 2009 Trying to cross-compile scsh for mipsel. The problem is that the build process executes compiled code. It's perfectly possible to use qemu to run that code, but convincing autotools it can do so is not so simple apparently.. I.e. for the openwrt build I use: qemu-mipsel -L /opt/xsrc/openwrt/8.09/build_dir/mipsel/root-brcm-2.4/ The -L parameter is necessary for shared libraries. Static programs don't need it. Now this seems to be automated with scratchbox[1][2] apt-get install scratchbox2 $ cd /opt/xc/openwrt/8.09/build_dir/mipsel/root-brcm-2.4 $ sb2-init -c qemu-mipsel openwrt mipsel-linux-gcc hmm... errors.. it doesn't work on amd64 (the tools are built on a 32bit machine) and when running in a 32bit schroot i get: 2009-07-11 15:59:11.766 (ERROR) sh[31476] Unidentified executable detected (/opt/xc/openwrt/8.09//staging_dir/toolchain-mipsel_gcc3.4.6/bin/mipsel-linux-gcc) Like this[4]. Maybe I'm misunderstanding. Does it use cross tools or not? I.e. does gcc itself run in the simulator, or on the host[3]? No it does use cross tools... Hmm, I don't get it.. Let's leave this for another time when I find more docs.. It does look like an interesting project though. [1] http://felipec.wordpress.com/2009/06/07/installing-scratchbox-1-and-2-for-arm-cross-compilation/ [2] http://www.freedesktop.org/wiki/Software/sbox2 [3] http://scratchbox.org/wiki/ForeignToolchains [4] http://lists.openmoko.org/nabble.html#nabble-td2457004 Entry: bootstrapping scsh with qemu-mipsel Date: Sat Jul 11 18:10:36 CEST 2009 So, let's try it manually. Is there a way to bypass the following: checking link with -rdynamic... configure: error: cannot run test program while cross compiling Simply bypassing the check in ./configure makes it finish. Let's run make. In build/build-usual-image I prefix the vm invocation: - ./$vm -o ./$vm -i $initial batch < [ ...] maps. Entry: Forwarding ports using iptables Date: Mon Feb 7 08:34:13 EST 2011 # The following if from a config file on the OpenWRT router. Explain # the difference: why does the 2nd rule select on -s while the first # one selects on -d ? WAN=eth0.1 plug () { iptables -t nat -A prerouting_rule -i $WAN -p tcp --dport $1 -j DNAT --to $2:$3 iptables -A forwarding_rule -i $WAN -p tcp --dport $3 -d $2 -j ACCEPT } # ASTERISK # RTP=10000:20000 # iptables -t nat -A prerouting_rule -i $WAN -p udp --dport $RTP -j DNAT --to-destination $ZOO # iptables -A forwarding_rule -i $WAN -s $ZOO -p udp --dport $RTP -j ACCEPT Entry: VLAN on OpenWRT routers Date: Wed Mar 2 00:24:31 EST 2011 The linksys WRT54g routers have an ethernet port connected to a switch that supports vlans. In order to have vlans actually go to the local net, tagging needs to be disabled. root@fred:~# robocfg show Switch: enabled Port 0(W): DOWN enabled stp: none vlan: 0 mac: 00:00:00:00:00:00 Port 1(4): DOWN enabled stp: none vlan: 0 mac: 00:00:00:00:00:00 Port 2(3): 100FD enabled stp: none vlan: 0 mac: 00:00:00:00:00:00 Port 3(2): 100FD enabled stp: none vlan: 0 mac: 00:00:00:00:00:00 Port 4(1): 100FD enabled stp: none vlan: 1 mac: 00:00:00:00:00:00 Port 5(C): 100FD enabled stp: none vlan: 0 mac: 00:00:00:00:00:00 VLANs: BCM5325/535x enabled mac_check mac_hash vlan0: 0 1 2 3 5t vlan1: 4 5t So, if I want to have vlan 11 tags to appear both on the router's internal interface (port 5) and the cable connected to the gigabit switch (port 3), this should do that: # vconfig add eth0 11 # robocfg vlan 11 ports "3t 5t" Indeed, that works. Entry: Debian mipsel Date: Thu Jun 21 18:36:19 EDT 2012 Got this one for $19.97 on Amazon. A couple of hours later deal was gone! Belkin Share Max N300[1]. Installed this unofficial trx[2] for OpenWRT. Now trying to run Debian on it. Basic idea is to make a low power server to replace my 100W monster. After some googling I ran into this DebianWRT[3]. I forgot the "--foreign" flag in my first attempt: zoo:/vol/verbatim# debootstrap --foreign --arch mipsel squeeze squeeze Trying the chroot on the Belkin doesn't work: [ 3226.452000] FPU emulator disabled, make sure your toolchainwas compiled with software floating point support (soft-float) Googling I find this [4]. Looks like next step is to try to build the buildroot myself, following instructions in [2]. Hmmm dead end. One more [5]. MIPS_FPU_EMU OpenWRT page says "possible but not being worked on" [6]. In addition to instructions in [2], also run: make kernel_menuconfig [*] Enable FPU emulation Flashing is explained here [7]. Looking for systems with a bit more RAM Netgear WNDR3800 128 5gigE 1USB2 ar71xx TPLink TL-WDR4300 128 5gigE 2USB ar71xx Build failing: /bin/sh: mipsel-openwrt-linux-uclibc-gcc: not found Maybe because I modified the kernel config. Trying this: make toolchain/clean make toolchain/install make V=99 According to this[8] problem is due to change in the linker. Binutils 2.21.1 should work. I'm running Debian's 2.22-1. Fix should be downgrade or add an explicit "-lstdc++" somewhere[9]. I already have this patch. Revision is r29721 while I have 30776. Just downgrade then.. Not so simple. Bunch of stuff depends on it. Some other thing[10]. Maybe try to compile it with a 32bit compiler. Upgrading to the latest Debian toolchain seems to get past the error: gcc 4:4.6.2-4 binutils 2.22-6.1 Another error, followed by more like these in the same file: libbb/appletlib.c:64:45: error: invalid suffix "xob" on integer constant The refer PACKED_USAGE and UNPACKED_USAGE. There seems to be something wrong with the generation of this file (trunk is openwrt svn trunk from [2]). trunk/build_dir/target-mipsel_uClibc-0.9.33/busybox-1.19.3/include/usage_compressed.h #define UNPACKED_USAGE "" \ "\xob\xjd\xum\xp(\xGN\xUB\xin\xut\xil\xsf\xor\xDe\xbi\xan\x)2\x.22" \ "\x20\x11\xFr\xee\xSo\xft\xwa\xre\xFo\xun\xda\xti\xon\x,I\xnc." \ "\xpr\xog\xra\xmi\xsf\xre\xes\xof\xtw\xar\xe;\xyo\xum\xay\xre\xdi\xst\xri\xbu\xte\xit\xun\xde\xrt\xhe\xte\xrm\xsof" \ "\xGN\xUG\xen\xer\xal\xPu\xbl\xic\xLi\xce\xns\xev\xer\xsi\xon\x3o\xr(\xat\xyo\xur\xop\xti\xon\x)a\xny\xla\xte\xrv\xer\xsi\xon." \ "\xpr\xog\xra\xmh\xas\xab\xso\xlu\xte\xly\xno\xwa\xrr\xan\xty." \ #define PACKED_USAGE \ 0xob,0xjd,0xum,0xp(,0xGN,0xUB,0xin,0xut,0xil,0xsf,0xor,0xDe,0xbi,0xan,0x)2,0x.2,2 \ 0x20,0x11,0xFr,0xee,0xSo,0xft,0xwa,0xre,0xFo,0xun,0xda,0xti,0xon,0x,I,0xnc,. \ 0xpr,0xog,0xra,0xmi,0xsf,0xre,0xes,0xof,0xtw,0xar,0xe;,0xyo,0xum,0xay,0xre,0xdi,0xst,0xri,0xbu,0xte,0xit,0xun,0xde,0xrt,0xhe,0xte,0xrm,0xso,f \ 0xGN,0xUG,0xen,0xer,0xal,0xPu,0xbl,0xic,0xLi,0xce,0xns,0xev,0xer,0xsi,0xon,0x3o,0xr(,0xat,0xyo,0xur,0xop,0xti,0xon,0x)a,0xny,0xla,0xte,0xrv,0xer,0xsi,0xon,. \ 0xpr,0xog,0xra,0xmh,0xas,0xab,0xso,0xlu,0xte,0xly,0xno,0xwa,0xrr,0xan,0xty,. \ I can decipher this as "objdump(GNUBinutils.." some error message. The generation file is in: trunk/build_dir/target-mipsel_uClibc-0.9.33/busybox-1.19.3/applets/usage_compressed probably the invocation of 'od -v -t -x1'. Ha, that's because I have a /home/tom/bin/od script that calls object-dump, which clashes with the "octal dump" /usr/bin/od. Ok, that completed the build. Now I have: /opt/xc/openwrt/belkin/trunk/bin/brcm4716/openwrt-brcm4716-squashfs.trx /opt/xc/openwrt/belkin/trunk/bin/brcm4716/openwrt-wgt634u-squashfs.bin Time to push it to the device. When already running OpenWRT it's possible to use 'mtd' to flash the firmware. Something like this [11]. cd /tmp/ wget http://downloads.openwrt.org/latest/brcm-2.4/openwrt-brcm-2.4-squashfs.trx mtd write /tmp/openwrt-brcm-2.4-squashfs.trx linux && reboot After this, telnet 192.168.1.1 again and try chroot of debian disk, which works. /debootstrap/debootstra --second-stage [1] http://www.amazon.com/Belkin-Share-N300-Wireless-Router/dp/B004B1Z6EE [2] http://manojpi.blogspot.com/2012/05/openwrt-on-belkin-share-max-n300.html [3] http://wiki.debian.org/DebianWRT [4] http://www.instructables.com/files/orig/F3Q/DI7V/GU7F3FXB/F3QDI7VGU7F3FXB.txt [5] http://www.ewan.cc/debian-wl500w-howto.shtml [6] http://wiki.openwrt.org/toh/start#belkin2 [7] http://wiki.openwrt.org/doc/howto/generic.flashing.tftp [8] https://dev.openwrt.org/ticket/10587 [9] https://dev.openwrt.org/changeset/29721 [10] https://forum.openwrt.org/viewtopic.php?id=36795 [11] http://wiki.openwrt.org/toh/asus/wl500gd#upgrading.openwrt Entry: OpenWRT setup Date: Sat Jun 23 12:53:06 EDT 2012 Basic idea is to keep the OpenWRT install minimal: provide only an "emergency stage" to debug the Debian system. This would be routing + ssh + openvpn. OpenWRT is great, but I do prefer the luxury of a full Debian install.. I do worry a bit about shared libraries, because they will not be the same for OpenWRT and Debian. This means there is duplication in RAM. Might want to add swap space... Somethint to remember: authorized_keys goes in /etc/dropbear instead of /root/.ssh/ After killing most apps except init, dropbear and ash, there is still 50M used memory. Why is this so high? Most of the apps share libraries, so is this all kernel stuff? root@zuk:~# free total used free shared buffers Mem: 62160 58552 3608 0 8588 -/+ buffers: 49964 12196 Swap: 0 0 0 root@zuk:~# ps PID USER VSZ STAT COMMAND 1 root 1504 S init 2 root 0 SW [kthreadd] 3 root 0 SW [ksoftirqd/0] 4 root 0 SW [kworker/0:0] 5 root 0 SW [kworker/u:0] 6 root 0 SW [rcu_kthread] 7 root 0 SW< [khelper] 8 root 0 SW [kworker/u:1] 29 root 0 SW [sync_supers] 31 root 0 SW [bdi-default] 33 root 0 SW< [kblockd] 68 root 0 SW [kswapd0] 69 root 0 SW [fsnotify_mark] 81 root 0 SW [kworker/0:1] 84 root 0 SW [mtdblock0] 89 root 0 SW [mtdblock1] 94 root 0 SW [mtdblock2] 99 root 0 SW [mtdblock3] 104 root 0 SW [mtdblock4] 272 root 1504 S init 324 root 0 SW [khubd] 1089 root 0 SW [scsi_eh_0] 1090 root 0 SW [usb-storage] 1099 root 0 SWN [jffs2_gcd_mtd3] 1152 root 1152 S /usr/sbin/dropbear -P /var/run/dropbear.1.pid -p 22 1172 root 0 SW [jbd2/sda1-8] 1173 root 0 SW< [ext4-dio-unwrit] 22459 root 1216 S /usr/sbin/dropbear -P /var/run/dropbear.1.pid -p 22 22460 root 1504 S -ash 22575 root 1496 R ps root@zuk:/root# lsmod Module Size Used by Tainted: P usb_storage 36096 1 uhci_hcd 17936 0 nf_nat_irc 848 0 nf_conntrack_irc 2512 1 nf_nat_irc nf_nat_ftp 1008 0 nf_conntrack_ftp 4544 1 nf_nat_ftp ipt_MASQUERADE 976 1 iptable_nat 2128 1 nf_nat 10816 4 nf_nat_irc,nf_nat_ftp,ipt_MASQUERADE,iptable_nat xt_conntrack 2128 3 xt_CT 1408 0 xt_NOTRACK 576 0 iptable_raw 560 1 xt_state 608 0 nf_conntrack_ipv4 4016 6 iptable_nat,nf_nat nf_defrag_ipv4 624 1 nf_conntrack_ipv4 nf_conntrack 40640 12 nf_nat_irc,nf_conntrack_irc,nf_nat_ftp,nf_conntrack_ftp,ipt_MASQUERADE,iptable_nat,nf_nat,xt_conntrack,xt_CT,xt_NOTRACK,xt_state,nf_conntrack_ipv4 ehci_hcd 33312 0 sd_mod 23264 2 pppoe 8320 0 pppox 1152 1 pppoe ipt_REJECT 1776 2 xt_TCPMSS 2000 0 ipt_LOG 6432 0 xt_comment 400 0 xt_multiport 1136 0 xt_mac 528 0 xt_limit 1040 1 iptable_mangle 816 1 iptable_filter 624 1 ip_tables 8896 4 iptable_nat,iptable_raw,iptable_mangle,iptable_filter xt_tcpudp 1664 3 x_tables 9968 18 ipt_MASQUERADE,iptable_nat,xt_conntrack,xt_CT,xt_NOTRACK,iptable_raw,xt_state,ipt_REJECT,xt_TCPMSS,ipt_LOG,xt_comment,xt_multiport,xt_mac,xt_limit,iptable_mangle,iptable_filter,ip_tables,xt_tcpudp ppp_async 8128 0 ppp_generic 19664 3 pppoe,pppox,ppp_async slhc 4736 1 ppp_generic ext4 242064 1 jbd2 49392 1 ext4 mbcache 3712 1 ext4 wl 1465968 0 wl_glue 1696 1 wl usbcore 104896 4 usb_storage,uhci_hcd,ehci_hcd switch_robo 4000 0 switch_core 4640 1 switch_robo scsi_mod 71936 2 usb_storage,sd_mod nls_base 4576 1 usbcore crc16 944 1 ext4 crc_ccitt 944 1 ppp_async ssb_hcd 2000 0 bgmac 8544 0 diag 8064 0 @zuk:/tmp# df /tmp Filesystem 1K-blocks Used Available Use% Mounted on tmpfs 31080 44 31036 0% /tmp Funny. "free" from OpenWRT and Debian do not agree: Debian: @zuk:/root# free total used free shared buffers Mem: 62160 59948 2212 0 8760 -/+ buffers: 51188 10972 Swap: 0 0 0 OpenWRT: @zuk:/root# free total used free shared buffers Mem: 62160 59948 2212 0 8760 -/+ buffers: 51188 10972 Swap: 0 0 0 Fresh boot gives this: root@OpenWrt:~# free total used free shared buffers Mem: 62160 16108 46052 0 1656 -/+ buffers: 14452 47708 Swap: 0 0 0 Just a bug in free? Entry: OpenWRT packages Date: Sat Jun 23 14:25:43 EDT 2012 So what pre-compiled packages can be installed on this kernel? http://www.jianyu.net/openwrt/build_29617/brcm4716/packages/ Maybe best to just build them myself and set up a local archive. Some questions: - I don't see openvpn; how to get it? See script/feeds below - Do all packages show up in the .trx? Nope, see legend in make menuconfig: [*] built-in [ ] excluded package < > package capable - What config file should I save? .coinfig I don't know where the kernel config goes.. ./scripts/feeds update ... ./scripts/feeds install openvpn Installing package 'openvpn' Installing package 'lzo' ./scripts/feeds install asterisk18 Installing package 'asterisk-1.8.x' Installing package 'popt' Installing package 'iksemel' Installing package 'gnutls' Installing package 'libgcrypt' Installing package 'libgpg-error' Installing package 'libtasn1' Installing package 'bluez-libs' Installing package 'spandsp' Installing package 'tiff' Installing package 'jpeg' Installing package 'gettext' Installing package 'libiconv' WARNING: No feed for package 'uclibcxx' found, maybe it's already part of the standard packages? Installing package 'curl' Installing package 'mysql' WARNING: No feed for package 'uclibcxx' found, maybe it's already part of the standard packages? WARNING: No feed for package 'uclibcxx' found, maybe it's already part of the standard packages? Trying to compile selecting only openwrt and asterisk18 this gives WARNINGs and eventually an error. Looks like dependencies need to be enabled explicitly. Let's try just openvpn, lzo for now. Hmmm.. upon inspecition lzo was selected.. [master] tom@zoo:/opt/xc/openwrt/belkin/trunk$ make V=99 2>&1 |grep WARNING WARNING: skipping libssp -- package not selected WARNING: skipping libstdcpp -- package not selected WARNING: skipping librt -- package not selected WARNING: skipping libgfortran -- package not selected WARNING: skipping ldd -- package not selected WARNING: skipping ldconfig -- package not selected WARNING: skipping libiw -- package not selected WARNING: modpost: missing MODULE_LICENSE() in /opt/xc/openwrt/belkin/trunk/build_dir/linux-brcm4716/broadcom-wl-5.10.56.27.3/driver/wl.o WARNING: modpost: missing MODULE_LICENSE() in /opt/xc/openwrt/belkin/trunk/build_dir/linux-brcm4716/broadcom-wl-5.10.56.27.3/driver-mini/wl.o WARNING: skipping kmod-brcm-wl-mini -- package not selected WARNING: skipping dropbearconvert -- package not selected WARNING: skipping bluez-libs -- package not selected WARNING: skipping openssl-util -- package not selected WARNING: skipping curl -- package not selected WARNING: skipping libcurl -- package not selected WARNING: skipping libgpg-error -- package not selected WARNING: skipping libgcrypt -- package not selected I had to force install of the module package: opkg install --force-depends kmod-tun_3.0.18-1_brcm4716.ipk Entry: OpenWRT next Date: Sat Jun 23 15:28:09 EDT 2012 - Decide what goes where. OpenWRT: - SSH on port 2222, leave 22 for Debian. - openvpn, rsync, Debian: - asterisk The Debian asterisk takes full CPU for a couple of minutes after starting. Then it quiets down. EDIT: After playing a bit it seems that it's probably best to run the long-running stuff on OpenWRT. I don't think Debian is going to be smaller, and memory is really the limiting factor. The Debian could be there for one-shot things like email scanning and print jobs. Entry: OpenWRT firewall Date: Sun Jun 24 12:05:15 EDT 2012 Something's not right with the default config. There is no filtering on the wan ports! Maybe a consequence of me runnint /etc/init.d/firewall restart Entry: OpenWRT config Date: Sun Jun 24 19:53:32 EDT 2012 So.. should I try to use openwrt config, or just write direct scripts that start from the initial config? Seems simpler to leave the original config intact and use scripts that replace it. This way there is still an emergency fallback to a "normal" internet router. Entry: Asterisk on OpenWRT Date: Sat Jun 30 10:05:54 EDT 2012 It seems to use a lot of resources on Debian mipsel, so let's try to run it on OpenWRT. I run into a problem with the build of libgrypt due to this line VERSION="2.2.6b Debian-2.2.6b-2" in trunk/build_dir/target-mipsel_uClibc-0.9.33/libgcrypt-1.5.0/ltmain.sh It looks like the `"' character is not expected by the sed regexp. The error is: make[3]: Entering directory `/opt/xc/openwrt/belkin/trunk/feeds/packages/libs/libgcrypt' (cd /opt/xc/openwrt/belkin/trunk/build_dir/target-mipsel_uClibc-0.9.33/libgcrypt-1.5.0; for lt in $(/opt/xc/openwrt/belkin/trunk/staging_dir/host/bin/find . -name ltmain.sh); do lt_version="$(/opt/xc/openwrt/belkin/trunk/staging_dir/host/bin/sed -ne 's,^[[:space:]]*VERSION=\([0-9]\.[0-9]\+\).*,\1,p' $lt)"; case "$lt_version" in 1.5|2.2|2.4) echo "autotools.mk: Found libtool v$lt_version - applying patch to $lt"; (cd $(dirname $lt) && /usr/bin/patch -N -s -p1 < /opt/xc/openwrt/belkin/trunk/tools/libtool/files/libtool-v$lt_version.patch || true) ;; *) echo "autotools.mk: error: Unsupported libtool version v$lt_version - cannot patch $lt"; exit 1 ;; esac; done; ); autotools.mk: error: Unsupported libtool version v - cannot patch ./ltmain.sh make[3]: *** [/opt/xc/openwrt/belkin/trunk/build_dir/target-mipsel_uClibc-0.9.33/libgcrypt-1.5.0/.configured_] Error 1 make[3]: Leaving directory `/opt/xc/openwrt/belkin/trunk/feeds/packages/libs/libgcrypt' make[2]: *** [package/feeds/packages/libgcrypt/compile] Error 2 make[2]: Leaving directory `/opt/xc/openwrt/belkin/trunk' make[1]: *** [/opt/xc/openwrt/belkin/trunk/staging_dir/target-mipsel_uClibc-0.9.33/stamp/.package_compile] Error 2 make[1]: Leaving directory `/opt/xc/openwrt/belkin/trunk' make: *** [world] Error 2 A possible fix is this sed regexp: 's,^[[:space:]]*VERSION=\"\([0-9]\.[0-9]\+\).*,\1,p' or more general 's,^[[:space:]]*VERSION=.\?\([0-9]\.[0-9]\+\).*,\1,p' So where does that line come from? Can't find it without looking hard. Just going to patch ltmain.sh and changing it to this, which seems to move along the build: VERSION=2.2.6b Entry: OpenWRT next Date: Sat Jun 30 12:32:37 EDT 2012 - OpenWRT asterisk to replace Debian? NO - dnsmasq config - mac address spoof - openvpn client - openvpn server: not critical (no incoming yet) Entry: Asterisk OpenWRT Date: Sat Jun 30 14:04:08 EDT 2012 It's running and registers trunks, but it doesn't seem to let the IP phone register. It shows up in the peers after some random restarts, but I dont see any SIP reply packets using tcpdump. It doesn't seem to be a firewall problem: netcat works fine on udp sip port 5060. What is weird is that nothing shows up in the logs, and I see only /var/log/asterisk/messages So let's stick to debian. I tried again to run it, at it seems to be spinning for 9 minutes.. Maybe just let it sit there for an hour or so and see where it goes. It's been spinning for 27 minutes and my phone doesn't register. Conclusion: doesn't work. However, it would be nice to get it to run, as it seems to be a lot more lightweight on OpenWRT.. Entry: Asterisk Debian mipsel Date: Sat Jun 30 14:14:15 EDT 2012 I have some dropouts using the asterisk echo test application. Should I enable a real time kernel? Let's try to build this. Next question then is to upgrade linux without messing with the rest of the system. Maybe this requires backup - reinstall - restore? It's probably possible to just replace the kernel "partition" on the Flash drive, but how. (See next post.) Does run better with new scheduling. To test the asterisk fully it needs to be installed as real server, so got some other things to do first. Entry: OpenWRT upgrading kernel Date: Sat Jun 30 14:34:36 EDT 2012 Looks like there is no simple way[1] so let's make the "restore" operation practical, i.e. telnet to new device and run a script that restores /overlay to / The only real trouble is the initial IP config of the device. It would probably be easier to make this the same as what I'm actually using: Image Configuration -> LAN IP address to 192.168.100.1 The rest is: mtd write /tmp/openwrt-brcm-2.4-squashfs.trx linux && reboot telnet 192.168.100.1 mkdir -p /vol/0 mount /dev/sda1 /vol/0 cp -av /vol/0/squeeze/etc/openwrt/backup/overlay/* / reboot [1] http://wiki.openwrt.org/doc/howto/generic.sysupgrade Entry: OpenWRT / Debian box Date: Sat Jun 30 17:29:45 EDT 2012 1. When USB card is not inserted, device boots as normal with failsafe IP on LAN ports. 2. It takes a couple of minutes for asterisk to start. During this time the box is not responsive. Entry: Asterisk trimming Date: Sat Jun 30 18:07:49 EDT 2012 For what I'm using it for, this trimmed down Debian config seems to be enough for running it on the Belkin box ; /etc/asterisk/modules.conf [modules] autoload=no ; Manual loading gives a leaner setup on the Belkin box. load => pbx_config.so load => chan_sip.so load => app_dial.so load => app_echo.so load => app_readfile.so load => app_playback.so load => format_gsm.so load => codec_ulaw.so load => codec_gsm.so Entry: 64MB is tight.. Date: Sun Jul 1 09:14:36 EDT 2012 (Debian) zuk:/# dpkg-reconfigure locales Generating locales (this might take a while)... en_US.UTF-8...memory exhausted done This is with ssh, openwrt, asterisk running. I enabled swap, see if that solves the problem. Yes it does. Entry: dnsmasq /dev/log Date: Sun Jul 1 10:31:57 EDT 2012 If /dev/log (syslog) is not setup properly (i.e. Debian chroot), run dnsmasq with "--log-facility=-" to disable syslog writes. It would probably be better to just enable syslog though. Entry: HW ether Date: Sun Jul 1 10:32:01 EDT 2012 eth0.0 Link encap:Ethernet HWaddr 94:44:52:A6:E2:9C UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:10364 errors:0 dropped:0 overruns:0 frame:0 TX packets:17000 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:631126 (616.3 KiB) TX bytes:3161914 (3.0 MiB) eth0.1 Link encap:Ethernet HWaddr 94:44:52:A6:E2:9C inet addr:192.168.7.172 Bcast:192.168.7.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:3580 errors:0 dropped:62 overruns:0 frame:0 TX packets:2509 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:0 RX bytes:582324 (568.6 KiB) TX bytes:428037 (418.0 KiB) Need to set ethernet MAC to keep my old "fixed" IP. I don't remember how to do this properly. Should it be on eth0 or eth0.1 ? On zoo I have this: ifconfig eth0.1 hw ether xx:xx:xx:xx:xx:xx Maybe best to use OpenWRT default config[1]: #### WAN configuration config interface wan option ifname "eth0.1" option proto dhcp option hwaddr "xx:xx:xx:xx:xx:xx" The above is not correct. It seems that "hwaddr" changed to "macaddr". [1] https://dev.openwrt.org/ticket/1014 Entry: OpenWRT todo Date: Sun Jul 1 12:05:51 EDT 2012 DONE: It's running as main server. DNS + OpenVPN seems to work, TODO: - net 7 bridge eth0.11 (router switch config) DONE Entry: OpenWRT switch config Date: Sun Jul 1 12:18:29 EDT 2012 Looks like this now works through /proc TODO: find out port layout This is from /etc/config/network ; I don't see any tag marks. Is 8 always tagged? config switch_vlan eth0_0 option device "eth0" option vlan 0 option ports "0 1 2 3 8" config switch_vlan eth0_1 option device "eth0" option vlan 1 option ports "4 8" Maybe it's easier to just use robocfg like before. feeds install robocfg Doesn't seem to support bgmac. Looking at /lib/network/switch.sh I see: ports="$ports*" So it seems that '*' is added to the line, making the last port a tagged port. Maybe support is just a version issue because BCM53115 is mentioned here[3]. I'm trying to build it now. Solution: echo '1t 2t 3t 4t 8t' >/proc/switch/eth0/vlan/11/ports [1] http://wiki.openwrt.org/doc/uci/network#procswitch [2] http://wiki.openwrt.org/doc/uci/network/switch [3] http://wl500g.googlecode.com/svn/trunk/utils/robocfg.c Entry: OpenWRT : Mounting by UUID Date: Mon Jul 2 09:04:07 EDT 2012 Found something that works. Use mount from mount-utils, which supports the -U option. From [1]: Actually mounting a partition using its LABEL or UUID is possible. You just have to install mount-utils. Before that you have to remove the old busybox symlinks: rm /bin/mount rm /bin/umount After that you can install mount-utils: opkg update opkg install mount-utils And now you're able to mount by LABEL and UUID, e.g.: mount LABEL=xxx /mnt mount UUID=xxx /mnt Actually im missing this possibility for swap partitions. For swap it's probably enough to just iterate over all partitions and try to enable them as swap. [1] https://forum.openwrt.org/viewtopic.php?id=13856 Entry: Printer on guest network Date: Thu Jul 5 13:31:34 EDT 2012 After moving to new network setup the network printer is no longer accessible from guest network. It seems safest to move it back to guest by untagging a particular port, or to just transport only the secure net and have the rest be insecure. For now I just add an IP-specific rule for the printer: for if in $IF_GUEST; do for ip in $GUEST_IP_OK; do $IPTABLES -A FORWARD -i $if --dst $ip -j ACCEPT done done Fix should be something like this: # Switch port 0 ("wired 4" on case) is printer which is accessible to # untrusted net VLAN0. Rest of the ports is trusted network with # encapsulated untrusted VLAN11. echo ' 1 2 3 8t' >/proc/switch/eth0/vlan/0/ports ; \ echo '0 1t 2t 3t 8t' >/proc/switch/eth0/vlan/11/ports Entry: OpenWRT/Debian failsafe Date: Fri Jul 6 10:26:26 EDT 2012 It seems to come up only when the WAN port is not plugged. If it is plugged but doesn't get an address, it will sit there forever (or a long time..). Actually, maybe it is just "reboot" that doesn't work properly. Power cycle seems to work. Entry: OpenWRT serial console USB Date: Fri Jul 6 10:32:48 EDT 2012 It's probably safest to build serial support into the kernel and allow for a /dev/ttyUSB0 console. It's too easy to get locked out. Next: - Rebuild kernel with all modules (serial, ipv6) - Upgrade Entry: Bricked it Date: Fri Jul 6 12:12:00 EDT 2012 Was upgrading the .trx, connection cut out and it won't respond any more. I'm not sure if this was me pressing the wrong key mouse-overing the terminal, or if something is really wrong. I did change some things in the kernel config recently. Console reads "Boot program checksum is invalid" and drops into CFE. From there it's probably possible to download it using tftp. Decompressing...done Decompressing...done Init Arena Init Devs. Boot partition size = 131072(0x20000) et0: Broadcom BCM47XX 10/100/1000 Mbps Ethernet Controller 5.10.128.0 CPU type 0x19740: 453MHz Tot mem: 65536 KBytes CFE mem: 0x80700000 - 0x8079AD20 (634144) Data: 0x80731E00 - 0x807341B0 (9136) BSS: 0x807341B0 - 0x80734D20 (2928) Heap: 0x80734D20 - 0x80798D20 (409600) Stack: 0x80798D20 - 0x8079AD20 (8192) Text: 0x80700000 - 0x80731DF4 (204276) Copying boot params..... DONE Bootloader version 1.00e boot_version 1.00e Project name : WG7117F22 2-LF-AK Press space bar to cancel startup... Device eth0: hwaddr 94-44-52-A6-E2-9C, ipaddr 192.168.2.1, mask 255.255.255.0 gateway not set, nameserver not set Boot program checksum is invalid Reading :: Failed.: Timeout occured Reading :: Failed.: Timeout occured Reading :: Failed.: Timeout occured CFE> Entry: Recovering Belkin Share Max N300 using CFE Date: Fri Jul 6 13:28:53 EDT 2012 Missing link was CFE IP address, which is 192.168.2.1 on lan ports. The following command fixed it: atftp --trace --option "timeout 1" --option "mode octet" --put --local-file zuk.trx 192.168.2.1 On device console this gives: Decompressing...done Decompressing...done Init Arena Init Devs. Boot partition size = 131072(0x20000) et0: Broadcom BCM47XX 10/100/1000 Mbps Ethernet Controller 5.10.128.0 CPU type 0x19740: 453MHz Tot mem: 65536 KBytes CFE mem: 0x80700000 - 0x8079AD20 (634144) Data: 0x80731E00 - 0x807341B0 (9136) BSS: 0x807341B0 - 0x80734D20 (2928) Heap: 0x80734D20 - 0x80798D20 (409600) Stack: 0x80798D20 - 0x8079AD20 (8192) Text: 0x80700000 - 0x80731DF4 (204276) Copying boot params..... DONE Bootloader version 1.00e boot_version 1.00e Project name : WG7117F22 2-LF-AK Press space bar to cancel startup... Device eth0: hwaddr 94-44-52-A6-E2-9C, ipaddr 192.168.2.1, mask 255.255.255.0 gateway not set, nameserver not set Boot program checksum is invalid Reading :: Done. 3018752 bytes read Programming...done. 3018752 bytes written Loader:raw Filesys:raw Dev:flash0.os File: Options:(null) Loading: .. 3796 bytes read Entry at 0x80001000 Closing network. Starting program at 0x80001000 [ 0.000000] Linux version 3.0.18 (tom@zoo) (gcc version 4.6.3 20120201 (prerelease) (Linaro GCC 4.6-2012.02) ) #13 PREEMPT Fri Jul 6 11:24:10 EDT 2012 [ 0.000000] CPU revision is: 00019740 (MIPS 74Kc) [ 0.000000] bcm47xx: using ssb bus [ 0.000000] ssb: Found END of erom after 9 cores [ 0.000000] ssb: chipcommon status is 0x8800 [ 0.000000] ssb: ssb_pmu_resources_init: Resource count 7 [ 0.000000] ssb: Initializing MIPS core... [ 0.000000] ssb: set_irq: core 0x0812, irq 3 => 3 [ 0.000000] ssb: set_irq: core 0x082d, irq 4 => 4 [ 0.000000] ssb: set_irq: core 0x0819, irq 5 => 5 [ 0.000000] ssb: after irq reconfiguration [ 0.000000] ssb: core 0x0800, irq : 2(S)* 3 4 5 6 D I [ 0.000000] ssb: core 0x0812, irq : 2(S) 3* 4 5 6 D I [ 0.000000] ssb: core 0x082d, irq : 2(S) 3 4* 5 6 D I [ 0.000000] ssb: core 0x082c, irq : 2(S) 3 4 5 6 D I* [ 0.000000] ssb: core 0x0819, irq : 2(S) 3 4 5* 6 D I [ 0.000000] ssb: core 0x0820, irq : 2(S) 3 4 5 6* D I [ 0.000000] ssb: core 0x082e, irq : 2(S)* 3 4 5 6 D I [ 0.000000] ssb: core 0x080e, irq : 2(S) 3 4 5 6 D I* [ 0.000000] ssb: core 0x0834, irq : 2(S)* 3 4 5 6 D I [ 0.000000] found parallel flash. [ 0.000000] ssb: Sonics Silicon Backplane (AI type) found at address 0x18000000 [ 0.000000] Determined physical RAM map: [ 0.000000] memory: 04000000 @ 00000000 (usable) [ 0.000000] Initrd not found or empty - disabling initrd [ 0.000000] Zone PFN ranges: [ 0.000000] Normal 0x00000000 -> 0x00004000 [ 0.000000] Movable zone start PFN for each node [ 0.000000] early_node_map[1] active PFN ranges [ 0.000000] 0: 0x00000000 -> 0x00004000 [ 0.000000] Reserving 0MB of memory at 0MB for crashkernel [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 16256 [ 0.000000] Kernel command line: root=/dev/mtdblock2 rootfstype=squashfs,jffs2 noinitrd console=ttyS0,115200 [ 0.000000] PID hash table entries: 256 (order: -2, 1024 bytes) [ 0.000000] Dentry cache hash table entries: 8192 (order: 3, 32768 bytes) [ 0.000000] Inode-cache hash table entries: 4096 (order: 2, 16384 bytes) [ 0.000000] Primary instruction cache 32kB, VIPT, 4-way, linesize 32 bytes. [ 0.000000] Primary data cache 32kB, 4-way, VIPT, cache aliases, linesize 32 bytes [ 0.000000] Writing ErrCtl register=00000000 [ 0.000000] Readback ErrCtl register=00000000 [ 0.000000] Memory: 61844k/65536k available (2438k kernel code, 3692k reserved, 341k data, 156k init, 0k highmem) [ 0.000000] NR_IRQS:128 [ 0.000000] console [ttyS0] enabled [ 0.004000] Calibrating delay loop... 225.02 BogoMIPS (lpj=450048) [ 0.044000] pid_max: default: 32768 minimum: 301 [ 0.048000] Mount-cache hash table entries: 512 [ 0.052000] NET: Registered protocol family 16 [ 0.064000] bio: create slab at 0 [ 0.072000] Switching to clocksource MIPS [ 0.080000] Switched to NOHz mode on CPU #0 [ 0.084000] Disabling SSB PCI-E host due to code brokeness [ 0.096000] NET: Registered protocol family 2 [ 0.100000] IP route cache hash table entries: 1024 (order: 0, 4096 bytes) [ 0.108000] TCP established hash table entries: 2048 (order: 2, 16384 bytes) [ 0.116000] TCP bind hash table entries: 2048 (order: 1, 8192 bytes) [ 0.124000] TCP: Hash tables configured (established 2048 bind 2048) [ 0.128000] TCP reno registered [ 0.132000] UDP hash table entries: 256 (order: 0, 4096 bytes) [ 0.140000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes) [ 0.144000] NET: Registered protocol family 1 [ 0.156000] squashfs: version 4.0 (2009/01/31) Phillip Lougher [ 0.164000] JFFS2 version 2.2 (NAND) (SUMMARY) (LZMA) (RTIME) (CMODE_PRIORITY) (c) 2001-2006 Red Hat, Inc. [ 0.176000] msgmni has been set to 120 [ 0.180000] io scheduler noop registered [ 0.184000] io scheduler deadline registered (default) [ 0.188000] Serial: 8250/16550 driver, 2 ports, IRQ sharing enabled [ 0.216000] serial8250: ttyS0 at MMIO 0xb8000300 (irq = 2) is a U6_16550A [ 0.244000] serial8250.0: ttyS0 at MMIO 0xb8000300 (irq = 2) is a U6_16550A [ 0.256000] bcm47xx_pflash: flash init: 0x1c000000 0x02000000 [ 0.260000] Physically mapped flash: Found 1 x16 devices at 0x0 in 8-bit bank. Manufacturer ID 0x0000c2 Chip ID 0x0000cb [ 0.272000] Amd/Fujitsu Extended Query Table at 0x0040 [ 0.280000] Amd/Fujitsu Extended Query version 1.1. [ 0.284000] number of CFI chips: 1 [ 0.288000] bcm47xx_pflash: Flash device: 0x2000000 at 0x1fc00000 [ 0.296000] bcm47xx_part: Found Belkin_F7D3301 header:cfe [ 0.300000] bcm47xx_part: bootloader size: 196608 [ 0.308000] bcm47xx_part: Looking for dual image [ 0.316000] bcm47xx_part: Found Belkin_F7D3301 header:root [ 0.320000] bcm47xx_part: TRX offset : 0 [ 0.716000] bcm47xx_part: Updating TRX offsets and length: [ 0.720000] bcm47xx_part: old trx = [0x0000001c, 0x0000096c, 0x000e1800], len=0x002e1000 crc32=0xcc31c2ed [ 0.732000] bcm47xx_part: new trx = [0x0000001c, 0x0000096c, 0x000e1800], len=0x000e1800 crc32=0x090a423b [ 2.612000] bcm47xx_part: Done [ 2.616000] 4 bcm47xx partitions found on MTD device Physically mapped flash [ 2.624000] Creating 4 MTD partitions on "Physically mapped flash": [ 2.628000] 0x000000000000-0x000000030000 : "cfe" [ 2.636000] 0x000000030000-0x0000007f0000 : "linux" [ 2.644000] 0x000000111800-0x0000007f0000 : "rootfs" [ 2.652000] mtd: partition "rootfs" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only [ 2.664000] mtd: partition "rootfs" set to be root filesystem [ 2.672000] mtd: partition "rootfs_data" created automatically, ofs=2D0000, len=520000 [ 2.680000] 0x0000002d0000-0x0000007f0000 : "rootfs_data" [ 2.688000] 0x0000007f0000-0x000000800000 : "nvram" [ 2.700000] bcm47xx_sflash: error registering platform driver: -19 [ 2.704000] BCM47xx Watchdog Timer enabled (30 seconds, nowayout) [ 2.712000] TCP westwood registered [ 2.716000] NET: Registered protocol family 17 [ 2.724000] 802.1Q VLAN Support v1.8 [ 2.736000] VFS: Mounted root (squashfs filesystem) readonly on device 31:2. [ 2.744000] Freeing unused kernel memory: 156k freed [ 4.416000] manoj: boardnum= 121032G3100879 : boardtype : 0xa4cf [ 4.424000] diag: Detected 'Belkin PlayMax F7D3301' [ 4.428000] diag: led:power [ 4.432000] diag: led:warn [ 4.436000] diag: led:wlan [ 4.436000] diag: led:led0 [ 4.440000] diag: led:led1 [ 5.660000] roboswitch: Probing device eth0: No such device [ 5.664000] roboswitch: Probing device eth1: No such device [ 5.672000] roboswitch: Probing device eth2: No such device [ 5.676000] roboswitch: Probing device eth3: No such device - preinit - Press the [f] key and hit [enter] to enter failsafe mode - regular preinit - jffs2 not ready yet; using ramdisk - init - Please press Enter to activate this console. [ 13.536000] bgmac ssb0:1: eth0: Broadcom SSB GMAC ethernet driver (ext. Robo Switch) 94:44:52:a6:e2:9c [ 13.664000] USB20H mdio control register: 0x80000008 [ 13.920000] SCSI subsystem initialized [ 13.956000] roboswitch: Probing device eth0: found a 53115! It's a 5350. [ 14.148000] usbcore: registered new interface driver usbfs [ 14.156000] usbcore: registered new interface driver hub [ 14.164000] usbcore: registered new device driver usb [ 15.144000] wl: module license 'unspecified' taints kernel. [ 15.148000] Disabling lock debugging due to kernel taint [ 15.260000] wl0: Broadcom BCM4329 802.11 Wireless Controller 5.10.56.27 [ 15.268000] SSB/BCMA glue driver successfully attached [ 15.580000] PPP generic driver version 2.4.2 [ 15.808000] ip_tables: (C) 2000-2006 Netfilter Core Team [ 16.068000] NET: Registered protocol family 24 [ 16.128000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver [ 16.136000] ehci-platform ehci-platform.0: Generic Platform EHCI Controller [ 16.144000] ehci-platform ehci-platform.0: new USB bus registered, assigned bus number 1 [ 16.176000] ehci-platform ehci-platform.0: irq 5, io mem 0x18004000 [ 16.192000] ehci-platform ehci-platform.0: USB 0.0 started, EHCI 1.00 [ 16.200000] hub 1-0:1.0: USB hub found [ 16.204000] hub 1-0:1.0: 2 ports detected [ 16.332000] nf_conntrack version 0.5.0 (968 buckets, 3872 max) [ 17.044000] uhci_hcd: USB Universal Host Controller Interface driver [ 17.076000] Initializing USB Mass Storage driver... [ 17.080000] usbcore: registered new interface driver usb-storage [ 17.088000] USB Mass Storage support registered. [ 22.344000] device eth0.0 entered promiscuous mode [ 22.348000] device eth0 entered promiscuous mode [ 22.412000] br-lan: port 1(eth0.0) entering forwarding state [ 22.420000] br-lan: port 1(eth0.0) entering forwarding state [ 32.280000] jffs2_scan_eraseblock(): End of filesystem marker found at 0x0 [ 32.296000] jffs2_build_filesystem(): unlocking the mtd device... done. [ 32.304000] jffs2_build_filesystem(): erasing all blocks after the end marker... [ 76.492000] JFFS2 notice: (1082) jffs2_build_xattr_subsystem: complete building xattr subsystem, 0 of xdatum (0 unchecked, 0 orphan) and 0 of xref (0 dead, 0 orphan) found. BusyBox v1.19.3 (2012-06-22 01:08:55 EDT) 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 ATTITUDE ADJUSTMENT (bleeding edge, r30776) ---------- * 1/4 oz Vodka Pour all ingredients into mixing * 1/4 oz Gin tin with ice, strain into glass. * 1/4 oz Amaretto * 1/4 oz Triple sec * 1/4 oz Peach schnapps * 1/4 oz Sour mix * 1 splash Cranberry juice ----------------------------------------------------- root@OpenWrt:/# Entry: OpenWRT kernel modules Date: Fri Jul 6 13:45:48 EDT 2012 Don't set these in "make kernel_menuconfig". Use "make config" -> Kernel Modules instead Entry: OpenWRT hacking Date: Fri Jul 6 15:49:50 EDT 2012 So what did we learn today? - tftp on CFE / Belkin Share Max N300 uses 192.168.2.1 - compiling kernel + modules incrementally is a mess - don't go without a serial console on a production box - backups don't work unless they are tested - the Logic USB LA is a nice tool Entry: OpenWRT and kernel modules Date: Fri Jul 6 16:28:57 EDT 2012 Problem: the kernel and modules from separate "make world" invocations are not compatible. Maybe it's best to just build everything at once to avoid this problem. It's a pain in the ass to have to reinstall the base image. The question is then: does it make sense to keep them as packages, or should they just go in the initial image? Alternatively, is there a way to prevent the version from changing all the time? Entry: OpenWRT + Debian: kernel only? Date: Fri Jul 6 18:35:46 EDT 2012 I'm thinking that it might be a better idea to only use openwrt for the kernel, and then boot into debian as in [1], instead of using a dual system with chroot hacks. Maybe it's best to start from scratch for this, and automate the process? Strategy: - 15c160f8b3f8aef2e696c2b30fc07dfd1bafca6d enabled most non-fixed-HW modules - io make IGNORE_ERRORS=m -j6 - save trx + kernel modules somewhere safe so they wont be overwritten next time [1] http://wpkg.org/Running_Debian_on_ASUS_WL-500G_deluxe Entry: Bridges and firewalls Date: Sat Jul 7 19:25:40 EDT 2012 It looks like bridged packets do come from the bridge and not the individual interfaces as far as iptables is concerned. The LOG target logs PHYSIN and PHYSOUT. How to match on those? Jul 7 19:26:49 localhost kernel: [ 8226.234791] IN=br1 OUT=br1 PHYSIN=eth0.11 PHYSOUT=ubit SRC=192.168.7.46 DST=192.168.7.77 LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=19600 DF PROTO=TCP SPT=43315 DPT=22 WINDOW=14600 RES=0x00 SYN URGP=0 Entry: Sandboxing problem Date: Sun Jul 8 09:15:08 EDT 2012 I'm trying to set up a sandbox that needs a separate DHCP server and a shielded (NATted) address space. This is hosted on a guest network, but the packets are transported raw over the trusted network. This doesn't fit in the current firewall rules because it is a security problem in general, though not so because the device that uses it is fully controlled. What I really need is a separate gateway that allows only internet access, and no access to any of the guest or private networks. Entry: Belkin F7D3302 Date: Wed Jul 11 15:45:14 EDT 2012 Got the wrong one: "Share" F7D3302 instead of "Share MAX" FD3301/FD7301. OpenWRT Image doesn't work on it. Trying DD-WRT instead: wget http://www.dd-wrt.com/dd-wrtv2/downloads/others/eko/V24-K26/svn16773/dd-wrt.v24-16773_NEWD-2_K2.6_mini_f7d3302.bin [1] http://www.dd-wrt.com/phpBB2/viewtopic.php?p=603693&sid=7edc20fe8941b0c8001cf0039d3de589 Entry: Forwarding localhost:12345 to 192.168.1.2:12345 ? Date: Tue Jul 17 15:29:42 EDT 2012 I don't find a way to do this using iptables, but I've found on several occasions a mention to rinetd: apt-get install rinetd Yep, that solved the problem. Entry: Belkin rsync Date: Sun Jul 22 13:12:55 EDT 2012 Running rsync over ssh on local network seems to create quite a load. Doesn't look like this is disk-limited! top shows: Cpu(s): 67.0%us, 26.7%sy, 0.0%ni, 0.0%id, 0.0%wa, 0.0%hi, 6.3%si, 0.0%st 2417 root 20 0 13512 5540 2356 R 65.9 8.9 77:29.60 sshd 2422 root 20 0 16484 1636 404 S 27.8 2.6 33:28.20 rsync I wonder if this is due to FPU emulation. I guess those would be software interrupts (si) File transfer rate tops out at about 2MB/sec. Using the OpenWRT ssh/rsync doesn't change the CPU ratios, and the rate slows to 1.5MB/sec. Looks like this is just due to slow CPU. Entry: Box reset Date: Sat Jul 28 08:57:08 EDT 2012 (Debian) zuk:~# uptime 08:57:18 up 3 days, 15:05, 2 users, load average: 1.62, 1.74, 1.82 /usr/sbin/rsyslogd -c5 Entry: OOM killer Date: Sun Jul 29 09:50:21 EDT 2012 Jul 28 09:33:56 zuk kernel: [315727.084000] rsync invoked oom-killer: gfp_mask=0x201da, order=0, oom_adj=0, oom_score_adj=0 Jul 28 09:33:56 zuk kernel: [315727.096000] Call Trace:[<8002b140>] 0x8002b140 Jul 28 09:33:56 zuk kernel: [315727.100000] [<8025a094>] 0x8025a094 Jul 28 09:33:56 zuk kernel: [315727.104000] [<8025a094>] 0x8025a094 Jul 28 09:33:56 zuk kernel: [315727.108000] [<80070428>] 0x80070428 Jul 28 09:33:56 zuk kernel: [315727.112000] [<8007e538>] 0x8007e538 Jul 28 09:33:56 zuk kernel: [315727.116000] [<800706f0>] 0x800706f0 Jul 28 09:33:56 zuk kernel: [315727.120000] [<8007106c>] 0x8007106c Jul 28 09:33:56 zuk kernel: [315727.120000] [<8007476c>] 0x8007476c Jul 28 09:33:56 zuk kernel: [315727.124000] [<8006f350>] 0x8006f350 Jul 28 09:33:56 zuk kernel: [315727.128000] [<80054204>] 0x80054204 Jul 28 09:33:56 zuk kernel: [315727.132000] [<8008d164>] 0x8008d164 Jul 28 09:33:56 zuk kernel: [315727.136000] [<800912e4>] 0x800912e4 Jul 28 09:33:56 zuk kernel: [315727.140000] [<80091978>] 0x80091978 Jul 28 09:33:56 zuk kernel: [315727.144000] [<800104b0>] 0x800104b0 Jul 28 09:33:56 zuk kernel: [315727.148000] [<800213b8>] 0x800213b8 Jul 28 09:33:56 zuk kernel: [315727.152000] [<8002158c>] 0x8002158c Jul 28 09:33:56 zuk kernel: [315727.156000] [<80023d0c>] 0x80023d0c Jul 28 09:33:56 zuk kernel: [315727.160000] [<8025d5d0>] 0x8025d5d0 Jul 28 09:33:56 zuk kernel: [315727.164000] [<80031568>] 0x80031568 Jul 28 09:33:56 zuk kernel: [315727.168000] [<8000bcc4>] 0x8000bcc4 Jul 28 09:33:56 zuk kernel: [315727.172000] [<80004ea4>] 0x80004ea4 Jul 28 09:33:56 zuk kernel: [315727.172000] Jul 28 09:33:56 zuk kernel: [315727.176000] Mem-Info: Jul 28 09:33:56 zuk kernel: [315727.180000] Normal per-cpu: Jul 28 09:33:56 zuk kernel: [315727.180000] CPU 0: hi: 18, btch: 3 usd: 2 Jul 28 09:33:56 zuk kernel: [315727.188000] active_anon:5770 inactive_anon:5774 isolated_anon:0 Jul 28 09:33:56 zuk kernel: [315727.188000] active_file:175 inactive_file:239 isolated_file:0 Jul 28 09:33:56 zuk kernel: [315727.188000] unevictable:0 dirty:0 writeback:0 unstable:0 Jul 28 09:33:56 zuk kernel: [315727.188000] free:254 slab_reclaimable:644 slab_unreclaimable:1229 Jul 28 09:33:56 zuk kernel: [315727.188000] mapped:11 shmem:0 pagetables:217 bounce:0 Jul 28 09:33:56 zuk kernel: [315727.216000] Normal free:1016kB min:1016kB low:1268kB high:1524kB active_anon:23080kB inactive_anon:23096kB active_file:700kB inactive_file:956kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:65024kB mlocked:0kB dirty:0kB writeback:0kB mapped:44kB shmem:0kB slab_reclaimable:2576kB slab_unreclaimable:4916kB kernel_stack:624kB pagetables:868kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:2492 all_unreclaimable? yes Jul 28 09:33:56 zuk kernel: [315727.256000] lowmem_reserve[]: 0 0 Jul 28 09:33:56 zuk kernel: [315727.260000] Normal: 28*4kB 77*8kB 18*16kB 0*32kB 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 1016kB Jul 28 09:33:56 zuk kernel: [315727.272000] 3614 total pagecache pages Jul 28 09:33:56 zuk kernel: [315727.276000] 3200 pages in swap cache Jul 28 09:33:56 zuk kernel: [315727.280000] Swap cache stats: add 295657, delete 292457, find 51420/81049 Jul 28 09:33:56 zuk kernel: [315727.284000] Free swap = 0kB Jul 28 09:33:56 zuk kernel: [315727.288000] Total swap = 125948kB Jul 28 09:33:56 zuk kernel: [315727.296000] 16384 pages RAM Jul 28 09:33:56 zuk kernel: [315727.300000] 884 pages reserved Jul 28 09:33:56 zuk kernel: [315727.304000] 195 pages shared Jul 28 09:33:56 zuk kernel: [315727.304000] 14843 pages non-shared Jul 28 09:33:56 zuk kernel: [315727.308000] [ pid ] uid tgid total_vm rss cpu oom_adj oom_score_adj name Jul 28 09:33:56 zuk kernel: [315727.316000] [ 279] 0 279 385 0 0 0 0 rcS Jul 28 09:33:56 zuk kernel: [315727.324000] [ 281] 0 281 374 0 0 0 0 logger Jul 28 09:33:56 zuk kernel: [315727.332000] [ 282] 0 282 376 0 0 0 0 init Jul 28 09:33:56 zuk kernel: [315727.340000] [ 395] 0 395 377 3 0 0 0 syslogd Jul 28 09:33:56 zuk kernel: [315727.348000] [ 397] 0 397 372 6 0 0 0 klogd Jul 28 09:33:56 zuk kernel: [315727.356000] [ 399] 0 399 212 1 0 0 0 hotplug2 Jul 28 09:33:56 zuk kernel: [315727.364000] [ 599] 0 599 372 4 0 0 0 watchdog Jul 28 09:33:56 zuk kernel: [315727.372000] [ 1156] 0 1156 377 0 0 0 0 udhcpc Jul 28 09:33:56 zuk kernel: [315727.380000] [ 1230] 0 1230 288 0 0 0 0 dropbear Jul 28 09:33:56 zuk kernel: [315727.388000] [ 1407] 0 1407 45 2 0 0 0 runsvdir Jul 28 09:33:56 zuk kernel: [315727.396000] [ 1415] 0 1415 1879 1 0 -17 -1000 sshd Jul 28 09:33:56 zuk kernel: [315727.404000] [ 1423] 0 1423 42 0 0 0 0 runsv Jul 28 09:33:56 zuk kernel: [315727.412000] [ 1424] 0 1424 49 5 0 0 0 svlogd Jul 28 09:33:56 zuk kernel: [315727.420000] [ 1425] 0 1425 895 49 0 0 0 dnsmasq Jul 28 09:33:56 zuk kernel: [315727.428000] [ 1433] 0 1433 1831 55 0 0 0 openvpn Jul 28 09:33:56 zuk kernel: [315727.436000] [ 1440] 65534 1440 1531 25 0 0 0 openvpn Jul 28 09:34:17 zuk kernel: [315727.444000] [ 1458] 0 1458 1831 Jul 28 12:33:09 zuk kernel: [326479.124000] openvpn invoked oom-killer: gfp_mask=0x201da, order=0, oom_adj=0, oom_score_adj=0 Jul 28 12:33:09 zuk kernel: [326479.132000] Call Trace:[<8002b140>] 0x8002b140 Jul 28 12:33:09 zuk kernel: [326479.140000] [<8025a094>] 0x8025a094 Jul 28 12:33:09 zuk kernel: [326479.144000] [<8025a094>] 0x8025a094 Jul 28 12:33:09 zuk kernel: [326479.148000] [<80070428>] 0x80070428 Jul 28 12:33:09 zuk kernel: [326479.152000] [<8007e538>] 0x8007e538 Jul 28 12:33:09 zuk kernel: [326479.152000] [<800706f0>] 0x800706f0 Jul 28 12:33:09 zuk kernel: [326479.156000] [<8007106c>] 0x8007106c Jul 28 12:33:09 zuk kernel: [326479.160000] [<8007476c>] 0x8007476c Jul 28 12:33:09 zuk kernel: [326479.164000] [<8006f350>] 0x8006f350 Jul 28 12:33:09 zuk kernel: [326479.168000] [<83371474>] 0x83371474 Jul 28 12:33:09 zuk kernel: [326479.172000] [<8008d164>] 0x8008d164 Jul 28 12:33:09 zuk kernel: [326479.176000] [<8304fcd8>] 0x8304fcd8 Jul 28 12:33:09 zuk kernel: [326479.180000] [<800912e4>] 0x800912e4 Jul 28 12:33:09 zuk kernel: [326479.184000] [<80091978>] 0x80091978 Jul 28 12:33:09 zuk kernel: [326479.188000] [<800e5488>] 0x800e5488 Jul 28 12:33:09 zuk kernel: [326479.192000] [<800104b0>] 0x800104b0 Jul 28 12:33:09 zuk kernel: [326479.196000] [<800a6b88>] 0x800a6b88 Jul 28 12:33:09 zuk kernel: [326479.200000] [<800bbc2c>] 0x800bbc2c Jul 28 12:33:09 zuk kernel: [326479.204000] [<800bcc44>] 0x800bcc44 Jul 28 12:33:09 zuk kernel: [326479.208000] [<800a6fec>] 0x800a6fec Jul 28 12:33:09 zuk kernel: [326479.208000] [<80004ea4>] 0x80004ea4 Jul 28 12:33:09 zuk kernel: [326479.212000] [<80030084>] 0x80030084 Jul 28 12:33:09 zuk kernel: [326479.216000] Jul 28 12:33:09 zuk kernel: [326479.220000] Mem-Info: Jul 28 12:33:09 zuk kernel: [326479.220000] Normal per-cpu: Jul 28 12:33:09 zuk kernel: [326479.224000] CPU 0: hi: 18, btch: 3 usd: 0 Jul 28 12:33:09 zuk kernel: [326479.228000] active_anon:5726 inactive_anon:5772 isolated_anon:0 Jul 28 12:33:09 zuk kernel: [326479.228000] active_file:156 inactive_file:186 isolated_file:32 Jul 28 12:33:09 zuk kernel: [326479.228000] unevictable:0 dirty:0 writeback:0 unstable:0 Jul 28 12:33:09 zuk kernel: [326479.228000] free:256 slab_reclaimable:669 slab_unreclaimable:1287 Jul 28 12:33:09 zuk kernel: [326479.228000] mapped:1 shmem:3 pagetables:196 bounce:0 Jul 28 12:33:09 zuk kernel: [326479.260000] Normal free:1024kB min:1016kB low:1268kB high:1524kB active_anon:22904kB inactive_anon:23088kB active_file:624kB inactive_file:744kB unevictable:0kB isolated(anon):0kB isolated(file):128kB present:65024kB mlocked:0kB dirty:0kB writeback:0kB mapped:4kB shmem:12kB slab_reclaimable:2676kB slab_unreclaimable:5148kB kernel_stack:568kB pagetables:784kB unstable:0kB bounce:0kB writeback_tmp:0kB pages_scanned:3675 all_unreclaimable? yes Jul 28 12:33:09 zuk kernel: [326479.300000] lowmem_reserve[]: 0 0 Jul 28 12:33:09 zuk kernel: [326479.304000] Normal: 34*4kB 41*8kB 29*16kB 3*32kB 0*64kB 0*128kB 0*256kB 0*512kB 0*1024kB 0*2048kB 0*4096kB = 1024kB Jul 28 12:33:09 zuk kernel: [326479.312000] 2881 total pagecache pages Jul 28 12:33:09 zuk kernel: [326479.316000] 2504 pages in swap cache Jul 28 12:33:09 zuk kernel: [326479.320000] Swap cache stats: add 613020, delete 610516, find 78478/141099 Jul 28 12:33:09 zuk kernel: [326479.328000] Free swap = 0kB Jul 28 12:33:09 zuk kernel: [326479.332000] Total swap = 125948kB Jul 28 12:33:09 zuk kernel: [326479.340000] 16384 pages RAM Jul 28 12:33:09 zuk kernel: [326479.344000] 884 pages reserved Jul 28 12:33:09 zuk kernel: [326479.344000] 203 pages shared Jul 28 12:33:09 zuk kernel: [326479.348000] 14837 pages non-shared Jul 28 12:33:09 zuk kernel: [326479.352000] [ pid ] uid tgid total_vm rss cpu oom_adj oom_score_adj name Jul 28 12:33:09 zuk kernel: [326479.360000] [ 279] 0 279 385 0 0 0 0 rcS Jul 28 12:33:09 zuk kernel: [326479.368000] [ 281] 0 281 374 0 0 0 0 logger Jul 28 12:33:09 zuk kernel: [326479.376000] [ 282] 0 282 376 0 0 0 0 init Jul 28 12:33:09 zuk kernel: [326479.384000] [ 395] 0 395 377 5 0 0 0 syslogd Jul 28 12:33:09 zuk kernel: [326479.392000] [ 397] 0 397 372 7 0 0 0 klogd Jul 28 12:33:09 zuk kernel: [326479.400000] [ 399] 0 399 212 1 0 0 0 hotplug2 Jul 28 12:33:09 zuk kernel: [326479.408000] [ 599] 0 599 372 4 0 0 0 watchdog Jul 28 12:33:09 zuk kernel: [326479.416000] [ 1156] 0 1156 377 0 0 0 0 udhcpc Jul 28 12:33:09 zuk kernel: [326479.424000] [ 1230] 0 1230 288 0 0 0 0 dropbear Jul 28 12:33:09 zuk kernel: [326479.432000] [ 1407] 0 1407 45 2 0 0 0 runsvdir Jul 28 12:33:09 zuk kernel: [326479.440000] [ 1415] 0 1415 1879 1 0 -17 -1000 sshd Jul 28 12:33:09 zuk kernel: [326479.448000] [ 1423] 0 1423 42 1 0 0 0 runsv Jul 28 12:33:09 zuk kernel: [326479.456000] [ 1424] 0 1424 49 5 0 0 0 svlogd Jul 28 12:33:09 zuk kernel: [326479.464000] [ 1425] 0 1425 895 43 0 0 0 dnsmasq Jul 28 12:33:09 zuk kernel: [326479.472000] [ 1433] 0 1433 1831 54 0 0 0 openvpn Jul 28 12:33:09 zuk kernel: [326479.480000] [ 1440] 65534 1440 1531 25 0 0 0 openvpn Entry: Resizing backup disk Date: Sun Jul 29 10:07:34 EDT 2012 (Debian) zuk:~# fsck -n /dev/sdb1 fsck from util-linux-ng 2.17.2 e2fsck 1.41.12 (17-May-2010) /dev/sdb1: clean, 12519238/122101760 files, 279995243/488378000 blocks Aborting operation - too much work right now. [1] http://www.howtoforge.com/linux_resizing_ext3_partitions Entry: e2fsck killed? Date: Sun Jul 29 10:34:26 EDT 2012 (Debian) zuk:~# e2fsck -f /dev/sdb1 e2fsck 1.41.12 (17-May-2010) Pass 1: Checking inodes, blocks, and sizes Error allocating directoryKilled Looks like this is wishful thinking.. Some remaining options are to run all these operations under OpenWRT, to see if memory usage can be kept lower. Anyways, it's possible to run e2fsck with a switch to use less memory. On the Ubuntu PC it uses RES size = 187m. [1] http://serverfault.com/questions/9218/running-out-of-memory-running-fsck-on-large-filesystems Entry: Rsync out-of-memory Date: Sun Jul 29 10:46:57 EDT 2012 From [1]: The usual reason for "out of memory" when running rsync is that you are transferring a _very_ large number of files. The size of the files doesn't matter, only the total number of files. [1] http://www.infoscience.co.jp/technical/rsync/original/FAQ.html Entry: Memory issues Date: Sun Jul 29 10:50:30 EDT 2012 Last 2 posts seem to indicate that some programs are just intrinsicly memory-hungry (rsync, e2fsck). The question now is: is it worth to try to work around these limitations, or should the idea be abandoned? Entry: PPTP on OpenWRT/Debian Date: Tue Aug 28 21:14:17 CEST 2012 Can't get pptpd to work properly on zuk. It doesn't give me any log output which is strange. I had to add /dev/ppp manually which had no noticable effect. Maybe modules missing? Killed openwrt syslogd, started debian rsyslogd now I have debug messages. Aug 28 15:25:44 zuk pppd[4678]: sent [LCP TermReq id=0x2 "MPPE required but not available"] Entry: OpenWRT kernel -> Debian Date: Tue Dec 11 13:09:18 EST 2012 I've been running a dual system: OpenWRT + Debian chroot. This is too complex. Next step is to eliminate the OpenWRT layer and boot straight into Debian. Problems to solve: - Keep the modules on the OpenWRT partition, i.e. start it as if it would be an initrd partition. Maybe even do the whole Debian initrd thing? - If that doesn't work, just copy the modules onto the Debian partition, and (find out how to) do a root change. Inspecting "init" script from a Debian initrd, it seems that the root system is switched by "run-init" [2]. The key parts of that are: mount(".", "/", NULL, MS_MOVE, NULL); chroot("."); chdir("/"); It looks like both the moving mount and chroot are necessary. The moving is also possible from the shell as: mount --move The rest seems to make sure that all open files on the old /dev are closed too. It seems that I can keep my previous approach, and lauch the Debian from OpenWRT with a full root transfer as long as there are no references to the old filesystem (open filedescriptors), then just run init. [1] http://www.linuxfromscratch.org/hints/downloads/files/initramfs.txt [2] http://gitorious.org/opensuse/mkinitrd/blobs/cc9b2909fde7393feb2256080f5547b23311070e/src/run-init.c Entry: Clean boot Date: Tue Dec 11 17:44:10 EST 2012 killall ntpd dnsmasq dropbear udhcpc hotplug2 klogd syslog killall watchdog umount /overlay umount /tmp umount /rom umount /proc/bus/usb umount /sys/kernel/debug umount /dev/pts umount /sys umount /proc # Won't work: umount /dev It seems that in order to do this properly, all processes need to be killed. Keeping a shell alive is already too much. Something I don't understand: when moving a different filesystem into root position, will /dev and /sys move to the new root or stay grafted on the old root? Anyways, lsof would help. Also would help is to find out if normal initrd keeps /dev mounted when root fs is moved. Maybe clearing the whole thing would work? Nope... hope that didn't kill my filesystem.. It's probably because init is still running. Running lsof on Debian indeed shows /dev/console as fd 0 1 2 of init. I don't see a way of replacing init at runtime. This seems to need a bootstrap in the OpenWRT init script. Probably best to patch OpenWRT init script to check for a USB drive and perform the chroot. Entry: Packaging an OpenWRT (or other) kernel for Debian Date: Thu Dec 13 09:12:15 EST 2012 I'd like to re-aquiant myself with building a kernel package for debian, figuring out the following: - What's the difference between a Debian kernel and mainline? - How does the rt-preempt on debian work? Can it be re-used for a different kernel? - How to package an OpenWRT kernel on Debian? How to split it into two parts? One for the device's Flash image / boot loader, and one for the Debian install on a USB disk? Entry: init Date: Fri Dec 14 09:15:49 EST 2012 Replacing init script with this: (OpenWRT) root@zuk:/# cat /sbin/init #!/bin/sh echo Starting "$0 $@" exec /bin/busybox init "$@" Shows that the -preinit- stage is run before init executes. ... kernel boot ... [ 3.364000] roboswitch: Probing device eth0: No such device [ 3.368000] roboswitch: Probing device eth1: No such device [ 3.376000] roboswitch: Probing device eth2: No such device [ 3.380000] roboswitch: Probing device eth3: No such device - preinit - Press the [f] key and hit [enter] to enter failsafe mode - regular preinit - [ 9.836000] JFFS2 notice: (261) jffs2_build_xattr_subsystem: complete building xattr subsystem, 5 of xdatum (0 unchecked, 5 orphan) and 15 of xref (0 dead, 15 orphan) found. switching to jffs2 - init - Starting /sbin/init [1] http://wiki.openwrt.org/doc/howto/generic.failsafe Entry: Mounting USB drive in init script Date: Fri Dec 14 09:35:27 EST 2012 cd /lib/modules/3.0.18 /sbin/insmod nls_base.ko /sbin/insmod usbcore.ko /sbin/insmod scsi_mod.ko /sbin/insmod uhci-hcd.ko /sbin/insmod usb-storage.ko /sbin/insmod crc16.ko /sbin/insmod jbd2.ko /sbin/insmod mbcache.ko # hangs: /sbin/insmod ext4.ko Maybe they should be added in the same order. [ 11.268000] bgmac ssb0:1: eth0: Broadcom SSB GMAC ethernet driver (ext. Robo Switch) 94:44:52:94:60:12 [ 11.404000] USB20H mdio control register: 0x80000008 [ 11.672000] SCSI subsystem initialized [ 11.708000] roboswitch: Probing device eth0: found a 53115! It's a 5350. [ 11.900000] usbcore: registered new interface driver usbfs [ 11.904000] usbcore: registered new interface driver hub [ 11.912000] usbcore: registered new device driver usb [ 12.924000] wl: module license 'unspecified' taints kernel. [ 12.932000] Disabling lock debugging due to kernel taint [ 13.056000] wl0: Broadcom BCM4329 802.11 Wireless Controller 5.10.56.27 [ 13.064000] SSB/BCMA glue driver successfully attached [ 13.404000] PPP generic driver version 2.4.2 [ 13.456000] tun: Universal TUN/TAP device driver, 1.6 [ 13.460000] tun: (C) 1999-2004 Max Krasnyansky [ 13.680000] ip_tables: (C) 2000-2006 Netfilter Core Team [ 13.940000] NET: Registered protocol family 24 [ 14.012000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver [ 14.016000] ehci-platform ehci-platform.0: Generic Platform EHCI Controller [ 14.024000] ehci-platform ehci-platform.0: new USB bus registered, assigned bus number 1 [ 14.056000] ehci-platform ehci-platform.0: irq 5, io mem 0x18004000 [ 14.072000] ehci-platform ehci-platform.0: USB 0.0 started, EHCI 1.00 [ 14.080000] hub 1-0:1.0: USB hub found [ 14.084000] hub 1-0:1.0: 2 ports detected [ 14.228000] nf_conntrack version 0.5.0 (968 buckets, 3872 max) [ 14.400000] usb 1-1: new high speed USB device number 2 using ehci-platform [ 15.004000] uhci_hcd: USB Universal Host Controller Interface driver [ 15.044000] Initializing USB Mass Storage driver... [ 15.048000] scsi0 : usb-storage 1-1:1.0 [ 15.056000] usbcore: registered new interface driver usb-storage [ 15.064000] USB Mass Storage support registered. [ 16.056000] scsi 0:0:0:0: Direct-Access SanDisk Cruzer Fit 1.22 PQ: 0 ANSI: 5 [ 16.068000] sd 0:0:0:0: [sda] 31266816 512-byte logical blocks: (16.0 GB/14.9 GiB) [ 16.092000] sd 0:0:0:0: [sda] Write Protect is off [ 16.108000] sd 0:0:0:0: [sda] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA [ 16.140000] sda: sda1 sda2 [ 16.156000] sd 0:0:0:0: [sda] Attached SCSI removable disk [ 18.580000] device wl0 entered promiscuous mode [ 18.616000] br-lan: port 1(wl0) entering forwarding state [ 18.620000] br-lan: port 1(wl0) entering forwarding state [ 21.452000] device eth0.0 entered promiscuous mode [ 21.456000] device eth0 entered promiscuous mode [ 21.464000] br-lan: port 2(eth0.0) entering forwarding state [ 21.468000] br-lan: port 2(eth0.0) entering forwarding state [ 30.744000] EXT4-fs (sda1): mounting ext3 file system using the ext4 subsystem [ 30.972000] EXT4-fs (sda1): warning: maximal mount count reached, running e2fsck is recommended [ 30.984000] EXT4-fs (sda1): recovery complete [ 30.992000] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null) [ 31.144000] device eth0.11 entered promiscuous mode [ 31.156000] br-wlan: port 1(eth0.11) entering forwarding state [ 31.160000] br-wlan: port 1(eth0.11) entering forwarding state [ 31.192000] device wl0 left promiscuous mode [ 31.196000] br-lan: port 1(wl0) entering forwarding state [ 31.228000] device wl0 entered promiscuous mode [ 31.232000] br-wlan: port 2(wl0) entering forwarding state [ 31.236000] br-wlan: port 2(wl0) entering forwarding state [ 32.568000] Algorithmics/MIPS FPU Emulator v1.5 [ 32.940000] Adding 125948k swap on /dev/sda2. Priority:-1 extents:1 across:125948k [ 33.700000] sshd (1225): /proc/1225/oom_adj is deprecated, please use /proc/1225/oom_score_adj instead. [ 46.176000] br-wlan: port 1(eth0.11) entering forwarding state [ 46.240000] br-wlan: port 2(wl0) entering forwarding state insmod scsi_mod.ko insmod nls_base.ko insmod usbcore.ko insmod ehci-hcd.ko insmod uhci-hcd.ko insmod usb-storage.ko ... still hangs on ext4.ko maybe it's better to use hotplug to load the modules, then kill hotplug or something liek this: /etc/init.d/boot start kilall mount usb exec run-init Entry: openwrt init stuff Date: Sat Dec 15 09:47:45 EST 2012 Start in failsafe mode # To make sure drivers are loaded, perform first part of OpenWRT startup rm /tmp/.failsafe /etc/init.d/boot start killall syslogd klogd hotplug2 telnetd lock umount /sys/kernel/debug umount /sys umount /dev/pts umount /tmp hmm... not so easy. I can't unmount /dev Entry: base files Date: Sat Dec 15 10:06:19 EST 2012 /opt/xc/openwrt/git/trunk/build_dir/linux-brcm4716/base-files/ipkg-brcm4716/base-files Entry: load_modules from functions.sh Date: Sat Dec 15 10:14:10 EST 2012 . /etc/functions.sh load_modules /etc/modules.d/* Entry: debian vs. openwrt Date: Sat Dec 15 10:22:11 EST 2012 Maybe I should just go with the flow.. The main trouble I'm having is the need of reinstalling the image every time there is a recompile, so it might be that simply using extroot[1] is already enough. Actually, the main problem is that I'm running a patched kernel. It would be nice to be able to download packages from a precompiled repo.. The target is brcm4716 which doesn't exist on openwrt.org, but maybe brcm47xx is good enough? Doesn't work: opkg complains: "has no valid architecture". What about splitting the build into two parts: one for kernel / system utilities (e.g. robocfg) and one for userspace? This will do it[4]: arch all 100 arch brcm4716 200 arch brcm47xx 300 Now to find a way to upgrade kernel without loosing configuration. This[5] is not what I'm looking for. Best is probably to figure out how to use the overlay. Maybe this can be used to mount Debian too? [1] http://wiki.openwrt.org/doc/howto/extroot [2] http://wiki.openwrt.org/doc/howto/extroot/extroot.theory [3] http://downloads.openwrt.org/snapshots/trunk/brcm47xx/ [4] http://wiki.openwrt.org/doc/techref/opkg [5] http://stackoverflow.com/questions/9290360/how-to-upgrade-openwrt-without-losing-the-configuration Entry: OpenWRT extroot Date: Sat Dec 15 11:26:10 EST 2012 [1] http://wiki.openwrt.org/doc/howto/extroot [2] http://wiki.openwrt.org/doc/howto/extroot/extroot.theory Entry: DebWrt Date: Sat Dec 15 11:35:36 EST 2012 [1] http://www.debwrt.net/ Entry: New router Date: Wed Mar 6 11:59:58 EST 2013 The Belkin one is still not supported in trunk, and it resets every 1 or 2 days.. Time to move to something else after trying pure OpenWRT (no Debian hack). Biggest constraint is memory. 64MB is still too tight. I found 2 major brands with 128 MB RAM: D-link DIR-825 (C1) 16MB flash $72 [1] TP-link TL-WDR3600 8MB flash $70 [2] [1] http://wiki.openwrt.org/toh/d-link/dir-825 [2] http://wiki.openwrt.org/toh/tp-link/tl-wdr3600 Entry: Belkin F7D7301 Date: Wed Mar 6 19:53:26 EST 2013 Some updates on manojpi's blog[2]: Bgmac driver seems to be now in the trunk (from Jan 3, 2013). rev@34995 brcm47xx: add bgmac driver. The remaining part of the diff is now fairly small[1] but won't be accepted until cleaned up. [1] https://docs.google.com/file/d/0B5aCWpK6ZrH7Mk5LM0IyWE5vRHc/edit?usp=sharing&pli=1 [2] http://manojpi.blogspot.com/2012/10/update-openwrt-on-belkin-share-max-n300.html Entry: SVN stuff Date: Thu Mar 7 10:32:21 EST 2013 Switching back to revision: svn switch -r r35445 svn://svn.openwrt.org/openwrt/trunk/ svn switch -r r35899 svn://svn.openwrt.org/openwrt/trunk/ Get a properly branched git representation of SVN versions. 1. Start with the base version: svn checkout -r r35445 svn://svn.openwrt.org/openwrt/trunk/ 2. Create a git repository cd trunk git init # Edit .gitignore, adding ".svn" git add . git commit -am r35445 git checkout -b r35445 3. Create second branch git checkout r35445 git checkout -b r35899 svn switch -r r35899 svn://svn.openwrt.org/openwrt/trunk/ git add . git commit -am r35899 4. Third (unofficial) branch git checkout r35445 git checkout -b r35445.7301 patch -p1 <../belkin.7301.r35445.patch git add . git commit -am r35445.7301 Entry: belkin.7301.r35445.patch Date: Thu Mar 7 11:00:50 EST 2013 Investigating manojpi's patch: https://docs.google.com/file/d/0B5aCWpK6ZrH7Mk5LM0IyWE5vRHc/edit?usp=sharing&pli=1 More info here: http://manojpi.blogspot.com/2013/02/update2-openwrt-on-belkin-share-max.html Affected files: target/linux/brcm47xx/patches-3.6/050-mtd-add-bcm47xx-part-parser.patch target/linux/brcm47xx/image/lzma-loader/src/decompress.c package/broadcom-diag/src/diag.c target/linux/brcm47xx/image/Makefile target/linux/brcm47xx/base-files/etc/init.d/netconfig package/base-files/files/etc/preinit tools/firmware-utils/src/trx.c - target/linux/brcm47xx/patches-3.6/050-mtd-add-bcm47xx-part-parser.patch First file is a patch of a patch, which is why it looks so weird. I don't have much experience maintaining a series of patches. How would one edit this? Assuming that manual editing of the patch is not the best way.. - target/linux/brcm47xx/image/lzma-loader/src/decompress.c Support different trx magic. - package/broadcom-diag/src/diag.c HACK: platform_detect_legacy() replaces "not found" condition with F7D7301 - target/linux/brcm47xx/image/Makefile HACK: Creates a separate build rule, passing the extra parameter "-t belkin" to $(STAGING_DIR_HOST)/bin/trx - target/linux/brcm47xx/base-files/etc/init.d/netconfig Config of VLAN ports HACK: ip address changed - package/base-files/files/etc/preinit HACK: ip address changed - tools/firmware-utils/src/trx.c HACK: add support for "-t" flag which inserts different magic. ----- cut here ----- diff -uN a/target/linux/brcm47xx/patches-3.6/050-mtd-add-bcm47xx-part-parser.patch b/target/linux/brcm47xx/patches-3.6/050-mtd-add-bcm47xx-part-parser.patch --- a/target/linux/brcm47xx/patches-3.6/050-mtd-add-bcm47xx-part-parser.patch 2013-02-01 21:04:38.750566738 -0600 +++ b/target/linux/brcm47xx/patches-3.6/050-mtd-add-bcm47xx-part-parser.patch 2013-02-02 00:20:59.008790052 -0600 @@ -26,7 +26,7 @@ obj-$(CONFIG_MTD_CHAR) += mtdchar.o --- /dev/null +++ b/drivers/mtd/bcm47xxpart.c -@@ -0,0 +1,541 @@ +@@ -0,0 +1,564 @@ +/* + * Copyright (C) 2006 Felix Fietkau + * Copyright (C) 2005 Waldemar Brodkorb @@ -87,6 +87,7 @@ +#define TRX_NO_HEADER 1 /* Do not write TRX header */ +#define TRX_GZ_FILES 0x2 /* Contains up to TRX_MAX_OFFSET individual gzip files */ +#define TRX_MAX_OFFSET 3 ++#define TRX_MAGIC_F7D3301 0x20100322 /* Belkin 3301*/ + +struct trx_header { + u32 magic; /* "HDR0" */ @@ -113,6 +114,7 @@ +#define ROUTER_NETGEAR_WNR3500L 4 +#define ROUTER_SIMPLETECH_SIMPLESHARE 5 +#define ROUTER_NETGEAR_WNDR3400 6 ++#define ROUTER_BELKIN_F7D3301 7 + +static int +find_cfe_size(struct mtd_info *mtd) @@ -151,6 +153,10 @@ + /* found a TRX header */ + if (le32_to_cpu(trx->magic) == TRX_MAGIC) + goto found; ++ if (le32_to_cpu(trx->magic) == TRX_MAGIC_F7D3301) { ++ pr_notice("Found Belkin_F7D3301 header:cfe\n"); ++ goto found; ++ } + } + + pr_notice("%s: Couldn't find bootloader size\n", mtd->name); @@ -313,6 +319,16 @@ + + goto found; + } ++ if (le32_to_cpu(trx.magic) == TRX_MAGIC_F7D3301) { ++ part->offset = le32_to_cpu(trx.offsets[2]) ? : ++ le32_to_cpu(trx.offsets[1]); ++ part->size = le32_to_cpu(trx.len); ++ ++ part->size -= part->offset; ++ part->offset += off; ++ pr_notice("Found Belkin_F7D3301 header:root\n"); ++ goto found; ++ } + } + + pr_warn("%s: Couldn't find root filesystem\n", @@ -433,6 +449,13 @@ + return ROUTER_SIMPLETECH_SIMPLESHARE; + } + ++ if (boardtype == 0xa4cf ++ && boardrev == 0x1102) { ++ /* Belkin 3301 */ ++ return ROUTER_BELKIN_F7D3301; ++ } ++ ++ + return 0; +} + diff -uN a/target/linux/brcm47xx/image/lzma-loader/src/decompress.c b/target/linux/brcm47xx/image/lzma-loader/src/decompress.c --- a/target/linux/brcm47xx/image/lzma-loader/src/decompress.c 2013-02-01 21:04:38.647231767 -0600 +++ b/target/linux/brcm47xx/image/lzma-loader/src/decompress.c 2013-02-01 21:43:54.505303409 -0600 @@ -78,6 +78,7 @@ } #define TRX_MAGIC 0x30524448 /* "HDR0" */ +#define TRX_MAGIC_F7D3301 0x20100322 /* "HDR0" */ struct trx_header { unsigned int magic; /* "HDR0" */ @@ -139,6 +140,7 @@ /* look for trx header, 32-bit data access */ for (data = ((unsigned char *) KSEG1ADDR(BCM4710_FLASH)); ((struct trx_header *)data)->magic != TRX_MAGIC && + ((struct trx_header *)data)->magic != TRX_MAGIC_F7D3301 && ((struct trx_header *)data)->magic != EDIMAX_PS_HEADER_MAGIC; data += 65536); diff -uN a/package/broadcom-diag/src/diag.c b/package/broadcom-diag/src/diag.c --- a/package/broadcom-diag/src/diag.c 2013-02-01 21:04:41.820615399 -0600 +++ b/package/broadcom-diag/src/diag.c 2013-02-01 22:10:09.846370426 -0600 @@ -115,6 +115,7 @@ /* Belkin */ BELKIN_UNKNOWN, BELKIN_F7D4301, + BELKIN_F7D3301, /* Netgear */ WGT634U, @@ -864,6 +865,20 @@ { .name = "led1", .gpio = 1 << 15, .polarity = REVERSE }, }, }, + [BELKIN_F7D3301] = { + .name = "Belkin PlayMax F7D3301", + .buttons = { + { .name = "reset", .gpio = 1 << 6 }, + { .name = "wps", .gpio = 1 << 8 }, + }, + .leds = { + { .name = "power", .gpio = 1 << 10, .polarity = REVERSE }, + { .name = "warn", .gpio = 1 << 11, .polarity = REVERSE }, + { .name = "wlan", .gpio = 1 << 13, .polarity = REVERSE }, + { .name = "led0", .gpio = 1 << 14, .polarity = REVERSE }, + { .name = "led1", .gpio = 1 << 15, .polarity = REVERSE }, + }, + }, /* Netgear */ [WGT634U] = { .name = "Netgear WGT634U", @@ -1121,6 +1136,7 @@ /* no easy model number, attempt to guess */ boardnum = getvar("boardnum"); boardtype = getvar("boardtype"); + printk("manoj: boardnum= %s : boardtype : %s\n", boardnum, boardtype); if (!strcmp(boardnum, "20070615")) { /* Linksys WRT600N v1/V1.1 */ if (!strcmp(boardtype, "0x478") && !strcmp(getvar("cardbus"), "0") && !strcmp(getvar("switch_type"),"BCM5395")) @@ -1306,6 +1322,7 @@ !strcmp(getvar("status_gpio"), "1")) /* gpio based detection */ return &platforms[PS1208MFG]; + return &platforms[BELKIN_F7D3301]; /* not found */ return NULL; } @@ -1463,6 +1480,7 @@ return; for(; l->name; l++) { + printk(MODULE_NAME ": led:%s\n",l->name); if (l->gpio & gpiomask) continue; diff -uN a/target/linux/brcm47xx/image/Makefile b/target/linux/brcm47xx/image/Makefile --- a/target/linux/brcm47xx/image/Makefile 2013-02-01 21:04:38.650565153 -0600 +++ b/target/linux/brcm47xx/image/Makefile 2013-02-01 22:37:08.314067909 -0600 @@ -107,6 +107,7 @@ define Image/Build/Initramfs $(STAGING_DIR_HOST)/bin/trx -o $(BIN_DIR)/$(IMG_PREFIX)-initramfs.trx -f $(KDIR)/loader.gz -f $(KDIR)/vmlinux.lzma + $(STAGING_DIR_HOST)/bin/trx -t belkin -o $(BIN_DIR)/$(IMG_PREFIX)-f7d3301-initramfs.trx -f $(KDIR)/loader.gz -f $(KDIR)/vmlinux.lzma endef define Image/Build/Chk @@ -117,6 +118,9 @@ $(STAGING_DIR_HOST)/bin/trx -o $(BIN_DIR)/$(IMG_PREFIX)-$(1).trx \ -f $(KDIR)/loader.gz -f $(KDIR)/vmlinux.lzma \ $(call trxalign/$(1),$(1)) + $(STAGING_DIR_HOST)/bin/trx -t belkin -o $(BIN_DIR)/$(IMG_PREFIX)-f7d3301-$(1).trx \ + -f $(KDIR)/loader.gz -f $(KDIR)/vmlinux.lzma \ + $(call trxalign/$(1),$(1)) $(call Image/Build/$(1),$(1)) $(call Image/Build/Motorola,$(1),wr850g,1,$(1)) $(call Image/Build/USR,$(1),usr5461,$(1)) diff -uN a/target/linux/brcm47xx/base-files/etc/init.d/netconfig b/target/linux/brcm47xx/base-files/etc/init.d/netconfig --- a/target/linux/brcm47xx/base-files/etc/init.d/netconfig 2013-02-01 21:04:38.663898698 -0600 +++ b/target/linux/brcm47xx/base-files/etc/init.d/netconfig 2013-02-01 22:31:36.294049100 -0600 @@ -131,6 +131,10 @@ c["vlan0ports"] = "0 1 2 3 5" c["vlan1ports"] = "4 5" } + if (model == "Belkin PlayMax F7D3301") { + c["vlan0ports"] = "0 1 2 3 8*" + c["vlan1ports"] = "4 8" + } if ((nvram["boardtype"] == "0x042f") || (nvram["boardtype"] == "0x0472")) { if (nvram["boardnum"] == "45") { # WL-500gP @@ -234,7 +238,7 @@ p("ifname", "lan_ifname") p("macaddr", "lan_macaddr") print " option proto static" - print " option ipaddr 192.168.1.1" + print " option ipaddr 192.168.2.1" print " option netmask 255.255.255.0" print "" print "" diff -uN a/package/base-files/files/etc/preinit b/package/base-files/files/etc/preinit --- a/package/base-files/files/etc/preinit 2013-02-01 21:04:40.773932143 -0600 +++ b/package/base-files/files/etc/preinit 2013-02-01 22:25:54.890508010 -0600 @@ -5,13 +5,13 @@ export PATH=/bin:/sbin:/usr/bin:/usr/sbin pi_ifname= -pi_ip=192.168.1.1 -pi_broadcast=192.168.1.255 +pi_ip=192.168.2.1 +pi_broadcast=192.168.2.255 pi_netmask=255.255.255.0 fs_failsafe_ifname= -fs_failsafe_ip=192.168.1.1 -fs_failsafe_broadcast=192.168.1.255 +fs_failsafe_ip=192.168.2.1 +fs_failsafe_broadcast=192.168.2.255 fs_failsafe_netmask=255.255.255.0 fs_failsafe_wait_timeout=2 diff -uN a/tools/firmware-utils/src/trx.c b/tools/firmware-utils/src/trx.c --- a/tools/firmware-utils/src/trx.c 2013-02-01 21:04:42.777297229 -0600 +++ b/tools/firmware-utils/src/trx.c 2013-02-01 21:58:35.610598691 -0600 @@ -66,6 +66,7 @@ /**********************************************************************/ /* from trxhdr.h */ +#define TRX_MAGIC_F7D3301 0x20100322 #define TRX_MAGIC 0x30524448 /* "HDR0" */ #define TRX_MAX_LEN 0x720000 #define TRX_NO_HEADER 1 /* Do not write TRX header */ @@ -105,6 +106,7 @@ struct trx_header *p; char trx_version = 1; unsigned char binheader[32]; + unsigned long trx_magic_c=TRX_MAGIC; fprintf(stderr, "mjn3's trx replacement - v0.81.1\n"); @@ -115,13 +117,13 @@ p = (struct trx_header *) buf; - p->magic = STORE32_LE(TRX_MAGIC); + //p->magic = STORE32_LE(TRX_MAGIC); cur_len = sizeof(struct trx_header) - 4; /* assume v1 header */ in = NULL; i = 0; - while ((c = getopt(argc, argv, "-:2o:m:a:x:b:f:A:F:")) != -1) { + while ((c = getopt(argc, argv, "-:2o:m:a:x:b:f:A:F:t:")) != -1) { switch (c) { case '2': /* take care that nothing was written to buf so far */ @@ -164,6 +166,9 @@ append = 0; break; + case 't': + trx_magic_c = TRX_MAGIC_F7D3301; + break; case 'o': ofn = optarg; if (ofn && !(out = fopen(ofn, "w"))) { @@ -247,6 +252,8 @@ usage(); } } + fprintf(stderr, "INFO: trxMagic=0x%8x\n",trx_magic_c); + p->magic = STORE32_LE(trx_magic_c); p->flag_version = STORE32_LE((trx_version << 16)); if (!in) { ----- cut here ----- Entry: OpenWRT dev - How to use CFE network image for testing without flashing? Date: Thu Mar 7 12:44:49 EST 2013 1. Find out how the CFE boot process works. What code is executed first? Where does the TRX fit in? - CFE loads decompress routine + compressed kernel at 0x80001000 and jumps to it. - Linux starts and later re-reads the partition table. From dmesg: [ 0.288000] bcm47xx_pflash: Flash device: 0x2000000 at 0x1fc00000 [ 0.296000] bcm47xx_part: Found Belkin_F7D3301 header:cfe [ 0.300000] bcm47xx_part: bootloader size: 196608 [ 0.308000] bcm47xx_part: Looking for dual image [ 0.316000] bcm47xx_part: Found Belkin_F7D3301 header:root [ 0.320000] bcm47xx_part: TRX offset : 0 [ 0.324000] 4 bcm47xx partitions found on MTD device Physically mapped flash [ 0.332000] Creating 4 MTD partitions on "Physically mapped flash": [ 0.340000] 0x000000000000-0x000000030000 : "cfe" [ 0.348000] 0x000000030000-0x0000007f0000 : "linux" [ 0.356000] 0x000000111000-0x0000007f0000 : "rootfs" [ 0.360000] mtd: partition "rootfs" must either start or end on erase block boundary or be smaller than an erase block -- forcing read-only [ 0.376000] mtd: partition "rootfs" set to be root filesystem [ 0.380000] mtd: partition "rootfs_data" created automatically, ofs=2D0000, len=520000 [ 0.392000] 0x0000002d0000-0x0000007f0000 : "rootfs_data" [ 0.400000] 0x0000007f0000-0x000000800000 : "nvram" First partition is 0x30000 (196608) bytes large and contains bootloader. I'm assuming this part is not overwritten. mtd0 "cfe" probably has the CFE bootloader, and is never touched. mtd1 "linux" has the TRX image At start, CFE says: Boot partition size = 131072(0x20000) Would this be on the flash? Not included in the TRX and other partition stuff? I don't find this number anywhere. -> at 0x20000 in mtd0.bin I find something extra: 00020000 42 52 4e 2d 42 4f 4f 54 00 00 00 00 00 00 00 00 |BRN-BOOT........| 00020010 00 00 00 00 00 00 31 2e 30 30 65 00 31 31 94 44 |......1.00e.11.D| So it looks like CFE is loaded by processor from the start of Flash. CFE looks for TRX image on the Flash and pulls out the loader binary from the first partition. Loader uncompresses Linux. Linux scans for the TRX again to find the squashfs and sets up mtd partitions, saving mtd0 for CFE bootloader. So how is default boot configured in CFE? 2. How to boot over the network? What format to use? It's probably simplest to just use a TFTP put. This will flash the whole TRX. atftp --trace --option "timeout 1" --option "mode octet" --put --local-file zuk.trx 192.168.2.1 Since the OpenWRT patch looks for TRX on Flash, it probably won't work to boot a whole image over the network. However, when there is a JFFS on the Flash, it might be possible to just boot the kernel if it is in the right format. See [1]. CFE> boot 192.168.2.2:openwrt Loader:raw Filesys:tftp Dev:eth0 File:192.168.2.2:openwrt Options:(null) Loading: TFTP error 1: File not found Failed. Could not load 192.168.2.2:openwrt: Network protocol error *** command status = -22 Next? - Build latest revision - Boot it, see where it fails - Add the TRX magic stuff - rest of patch.. [1] https://forum.openwrt.org/viewtopic.php?id=33184 Entry: CFE: tftp -> flash Date: Sat Mar 9 09:00:44 EST 2013 From [1]. Not everything works on Belkin F7D7301. ifconfig eth0 -addr=192.168.6.99 -mask=255.255.255.0 flash 192.168.6.8:zuk.trx flash0.os [1] http://wiki.openwrt.org/toh/netgear/wgt634u Entry: Playing with CFE Date: Sat Mar 9 09:10:25 EST 2013 The usual 'HDR0' trx doesn't work: CFE> flash 192.168.6.8:zuk.trx flash0.os flash 192.168.6.8:zuk.trx flash0.os Reading 192.168.6.8:zuk.trx: Done. 2887680 bytes read Invalid header seal. This is not a CFE flash image. *** command status = -1 Trying with "flash -noheader" works, but then it gives: Boot program checksum is invalid So it looks like the magic needs to be set correctly. # hd 7301.header 00000000 22 03 10 20 |".. | 00000004 # Patch trx from trunk build by overwriting the first 4 bytes with # different magic. cp openwrt-brcm47xx-squashfs.trx 7301.trx dd if=7301.header of=7301.trx conv=notrunc # On CFE ifconfig eth0 -addr=192.168.6.99 -mask=255.255.255.0 flash 192.168.6.8:7301.trx flash0.os This doesn't work. Probably CRC covers the header magic too. EDIT: it works with device flash1.trx (see below) kernel loads but doesn't boot properly Once flashed like this, it won't boot but will listen for tftp put, i.e. run this on server: atftp --trace --option "timeout 1" --option "mode octet" --put --local-file 4716.trx 192.168.2.1 I wonder what the difference is between these two. Here[1] it mentions to run "tftpd" command on CFE prompt. This doesn't work. The command "show devices" doesn't work either. It seems the CFE is seriously stripped down. Going to try to flash to flash0.trx It seems reasonably safe, looking at device map from another device[2]: flash0.boot New CFI flash at 1C000000 offset 00000000 size 256KB flash0.trx New CFI flash at 1C000000 offset 00040000 size 1KB flash0.os New CFI flash at 1C000000 offset 0004001C size 7904KB flash0.nvram New CFI flash at 1C000000 offset 007F8000 size 32KB flash1.boot New CFI flash at 1C000000 offset 00000000 size 256KB flash1.trx New CFI flash at 1C000000 offset 00040000 size 7904KB flash1.nvram New CFI flash at 1C000000 offset 007F8000 size 32KB flash0 New CFI flash at 1C000000 size 8192KB The os is 1C bytes into the TRX header, which makes sense. flash0.trx didn't work, but this one worked: flash -noheader 192.168.2.2:4716.trx flash1.trx But boot still says it's loading from flash0.os Next? Maybe wait until manoj reply.. Once it is ported to current trunk the work itself can be incremental. Learning the process itself might take a long time [3]. [1] http://www.myopenrouter.com/forum/thread/23008/Enabling-the-TFTP-server-from-the-CFE/ [2] http://pastebin.com/U4wTDv9p [3] https://dev.openwrt.org/wiki/SubmittingPatches Entry: Goals Date: Sat Mar 9 10:35:52 EST 2013 Might be good to write it down: - Fix trouble with current Belkin FD7D7301 setup (reboots once every 2 days). - Make an initrd to boot Debian mipsel from USB. Both are not urgent as device config doesn't need to change, but it would be nice to have them fixed. Roadblocks: - FD7D7301 nonstandard patches are annoying. - After initrd into debian, there might be plenty of pitfalls. Entry: Building last patch for Share Max Date: Tue Sep 3 11:33:52 EDT 2013 followed instructions on http://manojpi.blogspot.com/2013/02/update2-openwrt-on-belkin-share-max.html + make kernel_menuconfig -> [*] FPU emulation [master] tom@zoo:/opt/xc/openwrt/belkin.20130903/trunk$ ls -l bin/brcm47xx/openwrt-brcm47xx-f7d3301-squashfs.trx -rw-r--r-- 1 tom tom 2822144 Sep 3 02:23 bin/brcm47xx/openwrt-brcm47xx-f7d3301-squashfs.trx Entry: From scratch Date: Fri Sep 6 17:52:25 EDT 2013 Flashed the image using: mtd write /tmp/openwrt-brcm47xx-f7d3301-squashfs.trx linux Now, how to configure a box like this? I want to use it just as a switch / access point. The OpenWRT docs don't use roboconfig for enabling the WAN port. http://wiki.openwrt.org/doc/recipes/bridgedap #!/bin/sh # Minimal modification: # 0 to 3 (labeled 4->1) and 4 (WAN) are all tied to the lan segment eth0.0 echo ' ' >/proc/switch/eth0/vlan/1/ports echo '0 1 2 3 4 8t' >/proc/switch/eth0/vlan/0/ports killall dnsmasq killall udhcpc ifconfig eth0.1 down ifconfig br-lan 192.168.6.252 netmask 255.255.255.0 route add default gw 192.168.6.1 echo nameserver 192.168.6.1 >/etc/resolv.conf Can't get it to work properly.. Not in the right state of mind for hard core debugging... Anyway, using it in default config as normal router. Entry: Installing packages on a self-compiled base image Date: Tue Nov 12 13:02:26 EST 2013 root@portage:/etc# opkg install openvpn-openssl Installing openvpn-openssl (2.3.2-3) to root... Downloading http://downloads.openwrt.org/snapshots/trunk/brcm47xx/packages/openvpn-openssl_2.3.2-3_brcm47xx.ipk. Collected errors: * satisfy_dependencies_for: Cannot satisfy the following dependencies for openvpn-openssl: * kernel (= 3.10.18-1-a352f846a01e01046a29af4f5d304b86) * * opkg_install_cmd: Cannot install package openvpn-openssl. IIRC there is a way to disable this dependency checking. Switched to attitude_adjustment repo. How to override? opkg install --force-depends I'm guessing that installing older packages should work, and that installing newer packages might introduce problems with the older core. Looks like openvpn needs kmod-tun and I didn't put that in there. It's not worth the trouble really. Better to get a supported router. EDIT: Let's try to compile the package using the openwrt build. I still have it in /opt/xc/openwrt/belkin.20130903/trunk [master] tom@zoo:/opt/xc/openwrt/belkin.20130903/trunk/bin/brcm47xx/packages$ ls -l kmod-tun_3.6.11-1_brcm47xx.ipk -rw-r--r-- 1 tom tom 11015 Nov 12 13:27 kmod-tun_3.6.11-1_brcm47xx.ipk I put them here: http://zwizwa.be/openwrt/belkin.20130903/packages This still needs --force-depends, but at least tun.ko loads. Also, the kmod-tun from attitude adjustment seems to be ignored since mine is newer? Entry: Picking a new router Date: Tue Nov 12 13:18:07 EST 2013 http://wiki.openwrt.org/toh/buyerguide this has a filter for openwrt support: http://skinflint.co.uk/?cat=wlanrout&xf=758_OpenWrt&sort=p Entry: Weird bridging/routing problem on Belkin Share Max Date: Tue Nov 12 14:19:03 EST 2013 OpenWRT doesn't route between eth0.0 (LAN) and wl0 on br-lan. Disabling firewall completely doesn't change behavior. Trying with ping: router -> raspi OK raspi -> router OK tx-wlan -> router -> raspi raspi sees packets, sends reply, but router doesn't see replies on eth0.0 raspi -> router -> tx-wlan router doesn't see incoming on eth0.0 This looks like a routing issue, but in that case the packets coming from the ethernet through the switch should at least be visable to the router on eth0.0 (part of br-lan). They are not. Something is wrong with that switch. If I change the arp entry of tx-wlan in raspi tables to mac of router, packets come trough but cause redirect packets. Best guess: The hardware switch doesn't properly learn the location of tx-wlan. It doesn't seem to be linux bridge because the ethernet port doesn't see the packets coming in. Nothing gets dropped in the firewall (iptables -L -v) ARP packets do seem to get through since both raspi and tx-wlan can learn each other's mac addresses. Since I've seen other weird stuff happen with that switch, it's going to take the final blame.. ARP stuff: raspi sends arp request for tx-wlan, reply ok tx-wlan sends arp request for raspi, no reply Reason is the same: the switch still doesn't recognize the return path for the arp reply. Entry: Properly setting up USB Storage on OpenWRT Date: Sat Nov 30 14:51:03 EST 2013 http://wiki.openwrt.org/doc/howto/usb.storage http://wiki.openwrt.org/doc/uci/fstab Not sure if this is necessary... Disk showed up as /mnt/sda1 after reboot ignoring /etc/fstab.. Entry: AA asterisk18 Date: Fri Dec 6 11:32:05 EST 2013 bugfix: link /var/lib/asterisk/sounds -> /usr/lib/asterisk/sounds Entry: USB boot Belkin F7D7301 - manojpi Date: Fri Mar 21 08:12:11 EDT 2014 I've run into problems with the hardware, so this is experimentation only. manojpi has a working USB boot setup [1]. He uses a custom /etc/preinit script. So basically, keep a core openwrt around. It doesn't look like I need to keep the images around. Every time I've built from scratch because it's too hard to keep track of details when months pass... To run debian, the important parts are to enable floating point EMU as described in [2]. [1] http://manojpi.blogspot.com/search?updated-min=2014-01-01T00:00:00-08:00&updated-max=2015-01-01T00:00:00-08:00&max-results=1 [2] entry://20130903-113352 Entry: Client wifi node on Share Max Date: Sun Aug 17 11:39:03 EDT 2014 I have two of these. It doesn't seem they will ever be supported, so let's put them to use as wifi <-> USB bridges. It would be nice to get a webcam to work. Needed: - latest working patch from manojpi - setting client mode - driver for webcam Entry: Client mode Date: Sun Aug 17 11:43:09 EDT 2014 Setting this up using serial console since it's already soldered and it avoids problems with connectivity. So it looks like I don't have wpa-supplicant Trying to download packages from [2] using opkg update. That didn't work. Directory is not there. 47xx is though. Replacing that in /etc/opkg.conf The real problem to solve is to set up a local package mirror and compile things from source. This will take some time. Is it worth trying? I just have today to figure this out, so let's to this: - store the manojpi build system in a permanet spot - let it build packages - manually install them or set up a repo In parallel: - get raspi wireless to work [1] http://wiki.openwrt.org/doc/howto/clientmode [2] http://downloads.openwrt.org/snapshots/trunk/brcm4716/packages/Packages.gz. Entry: Last manojpi patch Date: Sun Aug 17 12:13:31 EDT 2014 What I have here is: /opt/xc/openwrt/belkin.20130903 with belkin.7301.r35445.patch # See also[1]: how to build a single package cd /opt/xc/openwrt/belkin.20130903/trunk make menuconfig Base System -> Network -> wpa_supplicant (or -mini) make tools/install make toolchain/install Then the wpa supplicant directory is not found.. So I'm just trying: make world This takes a while but should give the correct sub-make. tom@zoo:/opt/xc/openwrt/belkin.20130903/trunk$ make world make[1] world make[2] target/compile make[3] -C target/linux compile make[2] package/cleanup make[2] package/compile make[3] -C package/toolchain compile make[3] -C package/libs/libnl-tiny compile make[3] -C package/libs/libjson-c compile make[3] -C package/lua compile make[3] -C package/libs/libubox compile make[3] -C package/ubus compile make[3] -C package/uci compile make[3] -C package/network/config/netifd compile make[3] -C package/opkg host-compile make[3] -C package/procd compile make[3] -C package/base-files compile make[3] -C package/broadcom-diag compile make[3] -C package/network/utils/wireless-tools compile make[3] -C package/broadcom-wl compile make[3] -C package/busybox compile make[3] -C package/hotplug2 compile make[3] -C package/kernel compile make[3] -C package/mtd compile make[3] -C package/network/utils/iptables compile make[3] -C package/network/config/firewall compile make[3] -C package/network/services/dnsmasq compile make[3] -C package/network/services/dropbear compile make[3] -C package/network/services/hostapd compile make[3] -C package/network/services/hostapd compile make[3] -C package/libs/libpcap compile make[3] -C package/linux-atm compile make[3] -C package/network/utils/resolveip compile make[3] -C package/network/services/ppp compile make[3] -C package/opkg compile make[3] -C package/switch compile make[3] -C package/system/utils/nvram compile make[2] package/install make[3] package/preconfig make[2] target/install make[3] -C target/linux install make[6] -C target/linux/brcm47xx/image/lzma-loader clean install make[2] package/index It did compile it: ./build_dir/target-mipsel_uClibc-0.9.33.2/hostapd-supplicant-mini/hostapd-20120910/wpa_supplicant ./bin/brcm47xx/packages/wpa-supplicant-mini_20120910-1_brcm47xx.ipk Probably is part of a meta-package or something: make package/network/services/hostapd compile After setting up apache I get: Package wpa-supplicant version 20120910-1 has no valid architecture, ignoring I think I've got the wrong box... (OpenWRT) root@zuk:/etc# cat /proc/version Linux version 3.0.18 (tom@zoo) (gcc version 4.6.3 20120201 (prerelease) (Linaro GCC 4.6-2012.02) ) #14 PREEMPT Fri Jul 6 13:47:25 EDT 2012 Other box: root@(none):/# cat /proc/version Linux version 3.6.11 (tom@zoo) (gcc version 4.6.4 20121210 (prerelease) (Linaro GCC 4.6-2012.12) ) #1 Tue Sep 3 02:23:06 EDT 2013 Looks like I already had some trouble with this before: # src/gz attitude_adjustment http://downloads.openwrt.org/attitude_adjustment/12.09/brcm47xx/generic/packages # src/gz belkin http://zwizwa.be/openwrt/belkin.20130903/packages Adding: src/gz local http://openwrt.i/brcm47xx/packages So this box was already setup config wifi-iface option device 'wl0' option network 'lan' option mode 'sta' option ssid 'pine' option key 'XXX' option encryption 'psk' Now also change config/network Yeah I don't like the abstraction in openwrt.. How to start wpa_supplicant manually? So after editing a bit - changed to 'psk2', will dump configs when done - at least something is running: wl0 IEEE 802.11bgn ESSID:"pine" But no supplicant running. How does this supplicant thing actually work? So adding iw package as it's mentioned here[2]. ( Update with make menuconfig, then make world ) [1] http://wiki.openwrt.org/doc/howtobuild/single.package [2] http://wiki.openwrt.org/doc/recipes/bridgedclient Entry: wpa_supplicant Date: Sun Aug 17 14:13:13 EDT 2014 This[1] mentions the nas package which is installed. I am missing something. Why is wpa_supplicant not starting? And why is there no config file in /var/run? I'm seeing this when runnning 'wifi': wl0: invalid argument Yeah I can't get it to do anything following usual instructions. Let's start it manually. Create /script/wpa_supplicant.conf and run wpa_supplicant -B -iwl0 -c /script/wpa_supplicant.conf So how does it work? The config remnant I have on my system looks like this: network={ ssid="" psk=.... # looks like a hashed password } This is generated by "wpa_passphrase" in the old scripts I have.. So maybe that's what's missing? Can't find the wpa_passphrase application, so just generating the file on another host. wpa_supplicant -Dwext -iwl0 -c/script/wpa_supplicant.pine.conf root@portage:/script# wpa_supplicant -dd -iwl0 -c/script/wpa_supplicant.pine.con f Successfully initialized wpa_supplicant wl0: Associated with 01:80:c2:00:00:03 That is not right.. Maybe it is about this 'nas' thing[2]. Maybe sta mode is just not supported? What a mess.. [1] http://wiki.openwrt.org/doc/uci/wireless/encryption [2] http://wiki.openwrt.org/doc/hardware/soc/soc.broadcom.bcm47xx Entry: flashing Date: Sun Aug 17 18:01:24 EDT 2014 Setup laptop with atftpd and run this in CFE> Press space bar on serial console to get to CFE. flash -noheader 192.168.2.2:zuk.trx flash1.trx Ok that worked. Trying now to flash DD[2] as explained here[1]. flash -noheader 192.168.2.2:ddwrt.bin flash1.trx DD seems it works in client bridge mode with WPA2 personal, AES. DD next: try a later version? For now this is actually ok, but it would be nice to have USB access as well. [1] http://jonathanmanning.com/2013/03/31/installing-tomato-firmware-on-a-belkin-n300-router/ [2] http://download1.dd-wrt.com/dd-wrtv2/downloads/others/eko/V24-K26/svn15396/dd-wrt.v24-15396_NEWD-2_K2.6_mini_f7d3301.bin Entry: fswebcam Date: Sun Aug 17 20:39:38 EDT 2014 raspi: apt-get install fswebcam Entry: What to put on a WRT54g v4 ? Date: Sat Sep 13 17:11:47 CEST 2014 wget http://downloads.openwrt.org/backfire/10.03.1/brcm-2.4/openwrt-brcm-2.4-squashfs.trx Hmm... Maybe stick to whiterussian? [2] ipkg install nas nvram unset wl0_auth_mode nvram set wl0_akm psk2 nvram set wl0_crypto aes nvram set wl0_wpa_psk nvram set wl0_auth 0 nvram commit ?? using nas directly might be a better option since it's heavily modified # Security WPA2-PSK-TKIP nas -P /tmp/nas.lan.pid -l br0 -H 34954 -i eth1 -A -m 128 -k -s linksys -w 2 -g 3600 [1] http://wiki.openwrt.org/toh/linksys/wrt54g [2] http://wiki.openwrt.org/doku.php?id=oldwiki:historic.whiterussian.nvram#wpa.encryption [3] http://wiki.openwrt.org/doku.php?id=oldwiki:wireless.nas Entry: Rootfs on External Storage (extroot) Date: Fri Aug 12 19:39:22 EDT 2016 Maintaining all these devices is too much work. I'd like to place them all on the same filesystem, with only kernel different. It can use overlays which is a nice fallback. https://wiki.openwrt.org/doc/howto/extroot https://wiki.openwrt.org/doc/howto/extroot/extroot.theory Entry: Building, recap Date: Mon Apr 30 08:28:09 EDT 2018 make menuconfig make download make -j24 root@buffalo:~# cat /etc/openwrt_release DISTRIB_ID="OpenWrt" DISTRIB_RELEASE="12.09" DISTRIB_REVISION="r36088" DISTRIB_CODENAME="attitude_adjustment" DISTRIB_TARGET="ar71xx/generic" DISTRIB_DESCRIPTION="OpenWrt Attitude Adjustment 12.09" Configure needs: - Target System (Atheros AR7xxx/AR9xxx) - Subtarget (Generic) - Target Profile (Buffalo WZR-6000DHP) root@nexx0:~# cat /etc/openwrt_release DISTRIB_ID='LEDE' DISTRIB_RELEASE='17.01.4' DISTRIB_REVISION='r3560-79f57e422d' DISTRIB_CODENAME='reboot' DISTRIB_TARGET='ramips/rt305x' DISTRIB_ARCH='mipsel_24kc' DISTRIB_DESCRIPTION='LEDE Reboot 17.01.4 r3560-79f57e422d' DISTRIB_TAINTS='no-all' Configure: - Target System (MediaTek Ralink MIPS) - Subtarget (RT3x5x/RT5350 based boards) - Target Profile (Nexx WT1520 (8MB)) Entry: Client mode? Date: Tue May 1 13:02:13 EDT 2018 So client mode works, but once I bridge it, it doesn't seem to work. root@nexx0:~# ifconfig wlan0 0 root@nexx0:~# brctl addif br-wlan wlan0 brctl: bridge br-wlan: Not supported Entry: Additional packages? Date: Wed May 2 13:54:41 EDT 2018 I want to add this: https://github.com/openwrt/packages/blob/master/libs/hidapi/Makefile How to include this package in my build? https://wiki.openwrt.org/doc/howtobuild/single.package https://openwrt.org/docs/guide-developer/quickstart-build-images ./scripts/feeds update -a ./scripts/feeds install -a With this, I was able to install hidapi library. Now, try to compile a package with that library. Entry: Building against staging_dir : usbrelay Date: Wed May 2 14:33:15 EDT 2018 How to do this automatically, i.e. without having to provide compiler flags? EDIT: It seems that normally, in configure, there is some magic done to properly set up for cross-compiling. This package does none of that, so let's just figure out everything. EDIT: Going through the motions to create a package. Copied some arbitrary package based on PKG_SOURCE_PROTO:=git Then using this as a guide: https://wiki.openwrt.org/doc/devel/packages Created a usbrelay directory and linked it into ~/cross/nex/package tom@buildroot:~/cross/nexx$ make package/usbrelay/download V=s tom@buildroot:~/cross/nexx$ make package/usbrelay/check V=s Then do "make oldconfig" and the new option should be present. Select for compilation and do: tom@buildroot:~/cross/nexx$ make package/usbrelay/compile V=s Entry: Creating a patch for a package Date: Thu May 3 18:13:15 EDT 2018 first attempt: tom@buildroot:~/cross/nexx/build_dir/target-mipsel_24kc_musl-1.1.16/usbrelay-4335db3854044e986023cb5d628735a32ae540a7$ diff -Naur Makefile.orig Makefile >~/cross/openwrt_package/usbrelay/patches/000-make-variables-optional It seems to assume -p1 Second attempt tom@buildroot:~/cross/nexx/build_dir/target-mipsel_24kc_musl-1.1.16$ diff -Naur usbrelay-4335db3854044e986023cb5d628735a32ae540a7-orig/Makefile usbrelay-4335db3854044e986023cb5d628735a32ae540a7/Makefile >~/cross/openwrt_package/usbrelay/patches/000-make-variables-optional So the simplest way to do this is to iterate until it compiles, then perform the diff for files changed. Entry: Stripping it down Date: Thu May 17 18:27:40 EDT 2018 I think it will probably be easier to create a full custom boot script... with procd, things are different... Let's create a buildroot using an openwrt kernel? Or just play a bit.. ubus call service delete '{"name":"dnsmasq"}' ubus call service delete '{"name":"uhttpd"}' ubus call service delete '{"name":"odhcpd"}' Is this persistent? Nope. Next, figure out what to do when RNDIS devices get plugged. Somehow this goes through hotplug.