Thursday, 24 November 2011

WRT54GL Hacking

Driver for SD card downloaded from here
mmc-v1.3.4-gpio2.tgz file

tar xzvf mmc-v1.3.4-gpio2.tgz
cp mmc-v1.3.4-gpio2/mmc-v1.3.4-gpio2/mmc /lib/modules/2.4.37.4
insmod mmc (comment: at this point check with dmesg if every thing is ok)
mkfs.ext3 dev/mmc/disc0/part1



opkg update update the package list
opkg install kmod-fs-ext3 install package ext3 filesystem
insmod ext3 activate the module ext3
lsmod List installed modules
mkdir /mmc create the directory /mmc
echo "0x9c" > /proc/diag/gpiomask Mask the gpio for the SD card and Wifi
insmod mmc Activate the module mmc (sd card driver)
mount /dev/mmc/disc0/part1 /mmc Mount the SD card to /mmc
grep /mnt /proc/mounts List the mounts to check SD card is mounted

Mounting to External Media
Mount root to SD Card

#!/bin/sh
. /etc/functions.sh
mount proc /proc -t
insmod diag
echo 0x9c > /proc/diag/gpiomask
insmod mmc
insmod ext2
mount -o rw /dev/mmc/disc0/disc /mnt
[ -x /mnt/sbin/init ] && {
. /bin/firstboot
pivot /mnt /mnt
}
exec /bin/busybox init


We have to format the thing:
opkg install e2fsprogs kmod-fs-ext2
mkfs.ext2 /dev/mmc/disc0/disc # See above for the correct partition path
mount -t ext2 /dev/mmc/disc0/disc /mnt/


Now we are going to copy over the root stuff
mkdir -p /tmp/root
mount -o bind /rom /tmp/root
cp /tmp/root/* /mnt -a
sync
umount /tmp/root
umount /mnt


Another way of mounting root to SD Card

rm /sbin/init Remove this file

File /sbin/init Create this file script is below

#!/bin/sh
echo "0x9c" > /proc/diag/gpiomask
insmod mmc
insmod ext2
boot_dev="/dev/mmc/disc0/part1"

sleep 15s
mount "$boot_dev" /mmc
[ -x /mmc/sbin/init ] && {
mount -o move /proc /mmc/proc && \
pivot_root /mmc /mmc/mmc && {
mount -o move /mmc/dev /dev
mount -o move /mmc/tmp /tmp
mount -o move /mmc/jffs2 /jffs2 2>&-
mount -o move /mmc/sys /sys 2>&-
}
}
exec /bin/busybox init


chmod a+x /sbin/init Make the file executable

reboot


df -h You should see that /dev/mmc/disc0/part1 is mounted to /

OpenWRT Website

OpenWRT Downloads

openwrt-brcm-2.4-squashfs.trx file This is a 2.4 Kernel



Flashing Firmware (This is a 2.4 Kernel)

Script to clean nvram settings


./nvram-clean.sh
nvram commit




sysupgrade /tmp/openwrt-brcm-2.4-squashfs.trx
or
mtd write /tmp/openwrt-brcm-2.4-squashfs.trx


The commands below allows the use of a tftp server to flash firmware by allowing a delay in the startup to access tftp

nvram set boot_wait=on
nvram set boot_time=10
nvram commit && reboot

1 comment:

Defender 300tdi Lucas 10AS Alarm Immobiliser (Spider) Problems

We have a 1997 Landrover Defender 300tdi that has given immobiliser problems intermittently. I had initially fixed the fuel solenoid as we w...