WGT634U Tips & Tricks: Difference between revisions

From
Jump to navigation Jump to search
No edit summary
 
 
(2 intermediate revisions by one other user not shown)
Line 4: Line 4:
# Get the patches for bcm947xx support from OpenWrt's Kamikaze branch at https://dev.openwrt.org/browser/trunk/openwrt/target/linux/brcm-2.6/patches/
# Get the patches for bcm947xx support from OpenWrt's Kamikaze branch at https://dev.openwrt.org/browser/trunk/openwrt/target/linux/brcm-2.6/patches/
# Apply the patches: <br /><code>$ cd linux-2.6.16<br />$ patch -p1 < <var>/path/to/</var>001-bcm947xx.patch<br />$ patch -p1 < <var>/path/to/</var>002-flash-map.patch<br />$ patch -p1 < <var>/path/to/</var>003-bcm4710_cache_fixes.patch<br />$ patch -p1 < <var>/path/to/</var>004-b44_bcm47xx_support.patch</code>
# Apply the patches: <br /><code>$ cd linux-2.6.16<br />$ patch -p1 < <var>/path/to/</var>001-bcm947xx.patch<br />$ patch -p1 < <var>/path/to/</var>002-flash-map.patch<br />$ patch -p1 < <var>/path/to/</var>003-bcm4710_cache_fixes.patch<br />$ patch -p1 < <var>/path/to/</var>004-b44_bcm47xx_support.patch</code>
# You may use the .config file (it's in <code>/proc/config.gz</code>) from the old kernel, but there are some tweaks to do:
# You may use the .config file from the old kernel (it's in <code>/proc/config.gz</code>), but there are some tweaks to do:
## <tt>Machine selection</tt> -> <tt>System type: Support for BCM947xx based boards</tt>
## <tt>Machine selection</tt> -> <tt>System type: Support for BCM947xx based boards</tt>
## <tt>Device drivers</tt> -> <tt>Network device support</tt>: <tt>[*] Ethernet (10 or 100Mbit)</tt>, <tt>[*] EISA, VLB, PCI and on board controller</tt> -> <tt><*> Broadcom 4400 ethernet support (EXPERIMENTAL)</tt>
## <tt>Device drivers</tt> -> <tt>Network device support</tt>: <tt>[*] Ethernet (10 or 100Mbit)</tt>, <tt>[*] EISA, VLB, PCI and on board controller</tt> -> <tt><*> Broadcom 4400 ethernet support (EXPERIMENTAL)</tt>
## (Do ''not'' check <tt>Device drivers</tt> -> <tt>Input device support</tt> -> <tt>Hardware I/O ports</tt> -> <tt>< > Serial I/O support</tt>)
## (Do ''not'' enable <tt>Device drivers</tt> -> <tt>Input device support</tt> -> <tt>Hardware I/O ports</tt> -> <tt>Serial I/O support</tt> -> <tt>i8042 PC Keyboard controller</tt>, the kernel would hang while probing for a keyboard controller.)
## <tt>Device drivers</tt> -> <tt>Character devices</tt> -> <tt>Serial drivers</tt> -> <tt><*> 8250/16550 and compatible serial support</tt>, <tt>[*] Console on 8250/16550 and compatible serial port</tt>
## <tt>Device drivers</tt> -> <tt>Character devices</tt> -> <tt>Serial drivers</tt> -> <tt><*> 8250/16550 and compatible serial support</tt>, <tt>[*] Console on 8250/16550 and compatible serial port</tt>
## '''Attention''': <tt>Kernel hacking</tt> -> <tt>Default kernel command string</tt>, the 2.6.12-rc3 needed <code>console=ttyS1,115200</code> while the 2.6.16 needs <code>console=ttyS0,115200</code> for the serial console. Also: <code>/etc/inittab</code> should be changed to give a shell on <code>tts/0</code>.
## '''Attention''': <tt>Kernel hacking</tt> -> <tt>Default kernel command string</tt>, the 2.6.12-rc3 needed <code>console=ttyS1,115200</code> while the 2.6.16 needs <code>console=ttyS0,115200</code> for the serial console. Also: <code>/etc/inittab</code> should be changed to give a shell on <code>tts/0</code>.
# Big change: OpenWgt used devfs for its device file system which has been deprecated for some time and is completely removed by now. For the time being you'll need to set up a static <code>/dev</code> directory on your root file system. Simply use tar to pack up a copy of your old <code>/dev</code> and untar it in your root. Note: your root will most likely be readonly, but the logger wants to create its <code>/dev/log</code> socket on startup. Thus you should create a symlink that links <code>/dev/log</code> to <code>/tmp/log</code> (for example).
# Big change: OpenWgt used devfs for its device file system which has been deprecated for some time and is completely removed by now. For the time being you'll need to set up a static <code>/dev</code> directory on your root file system. Simply use tar to pack up a copy of your old <code>/dev</code> and untar it in your root. Note: your root will most likely be readonly, but the logger wants to create its <code>/dev/log</code> socket on startup. Thus you should create a symlink that links <code>/dev/log</code> to <code>/tmp/log</code> (for example).

== Unionfs for linux-2.6.16 ==
* UnionFS version 1.1.4 use a broken locking mechanism, so try a snapshot instead, e.g.:
* Prepare build
$ wget ftp://ftp.fsl.cs.sunysb.edu/pub/unionfs/snapshots/unionfs-20060503-0408.tar.gz
$ tar xzf unionfs-20060503-0408.tar.gz
$ cd unionfs-20060503-0408
$ ./patch-kernel.sh ~/linux-2.6.16-with-unionfs/
* Configure kernel
$ cd ~/linux-2.6.16-with-unionfs/
$ make menuconfig ARCH=mips (Select "File Systems" -> "Miscellaneous filesystems" -> "<M> Union fs support")
$ # patch Makefile as described [[MathiasJeschke|here]], if you don't want debugging stuff -> saves many (useless) code
* Build kernel (and/or modules)
$ cat build.sh
#!/bin/sh
CROSS_PATH=/home/mj/openwgt-dev/buildroot/build_mipsel/staging_dir/bin/
make \
CC=$CROSS_PATH/mipsel-linux-gcc \
LD=$CROSS_PATH/mipsel-linux-ld \
AR=$CROSS_PATH/mipsel-linux-ar \
NM=$CROSS_PATH/mipsel-linux-nm \
ARCH=mips $*
$ sh build.sh modules
$ ls -l fs/unionfs/unionfs.ko
-rw-r--r-- 1 mj users 111415 2006-05-13 14:33 fs/unionfs/unionfs.ko

Latest revision as of 11:00, 13 May 2006

New Kernel Howto

OpenWgt offers the choice of a 2.6.12-rc3 for the linux 2.6 series. This kernel comes from the Tuxap project and is slightly outdated by now. Here's how to get a more recent kernel up and running:

  1. Get a new kernel (I'll go with 2.6.16) from kernel.org (I used linux-mips.org, but kernel.org should be fine) and unpack it.
  2. Get the patches for bcm947xx support from OpenWrt's Kamikaze branch at https://dev.openwrt.org/browser/trunk/openwrt/target/linux/brcm-2.6/patches/
  3. Apply the patches:
    $ cd linux-2.6.16
    $ patch -p1 < /path/to/001-bcm947xx.patch
    $ patch -p1 < /path/to/002-flash-map.patch
    $ patch -p1 < /path/to/003-bcm4710_cache_fixes.patch
    $ patch -p1 < /path/to/004-b44_bcm47xx_support.patch
  4. You may use the .config file from the old kernel (it's in /proc/config.gz), but there are some tweaks to do:
    1. Machine selection -> System type: Support for BCM947xx based boards
    2. Device drivers -> Network device support: [*] Ethernet (10 or 100Mbit), [*] EISA, VLB, PCI and on board controller -> <*> Broadcom 4400 ethernet support (EXPERIMENTAL)
    3. (Do not enable Device drivers -> Input device support -> Hardware I/O ports -> Serial I/O support -> i8042 PC Keyboard controller, the kernel would hang while probing for a keyboard controller.)
    4. Device drivers -> Character devices -> Serial drivers -> <*> 8250/16550 and compatible serial support, [*] Console on 8250/16550 and compatible serial port
    5. Attention: Kernel hacking -> Default kernel command string, the 2.6.12-rc3 needed console=ttyS1,115200 while the 2.6.16 needs console=ttyS0,115200 for the serial console. Also: /etc/inittab should be changed to give a shell on tts/0.
  5. Big change: OpenWgt used devfs for its device file system which has been deprecated for some time and is completely removed by now. For the time being you'll need to set up a static /dev directory on your root file system. Simply use tar to pack up a copy of your old /dev and untar it in your root. Note: your root will most likely be readonly, but the logger wants to create its /dev/log socket on startup. Thus you should create a symlink that links /dev/log to /tmp/log (for example).

Unionfs for linux-2.6.16

  • UnionFS version 1.1.4 use a broken locking mechanism, so try a snapshot instead, e.g.:
  • Prepare build
$ wget ftp://ftp.fsl.cs.sunysb.edu/pub/unionfs/snapshots/unionfs-20060503-0408.tar.gz
$ tar xzf unionfs-20060503-0408.tar.gz
$ cd unionfs-20060503-0408
$ ./patch-kernel.sh ~/linux-2.6.16-with-unionfs/
  • Configure kernel
$ cd ~/linux-2.6.16-with-unionfs/
$ make menuconfig ARCH=mips (Select "File Systems" -> "Miscellaneous filesystems" -> "<M> Union fs support")
$ # patch Makefile as described here, if you don't want debugging stuff -> saves many (useless) code
  • Build kernel (and/or modules)
$ cat build.sh
#!/bin/sh

CROSS_PATH=/home/mj/openwgt-dev/buildroot/build_mipsel/staging_dir/bin/

make \
CC=$CROSS_PATH/mipsel-linux-gcc \
LD=$CROSS_PATH/mipsel-linux-ld \
AR=$CROSS_PATH/mipsel-linux-ar \
NM=$CROSS_PATH/mipsel-linux-nm \
ARCH=mips $*
$ sh build.sh modules
$ ls -l fs/unionfs/unionfs.ko
-rw-r--r--  1 mj users 111415 2006-05-13 14:33 fs/unionfs/unionfs.ko