OpenWrt Forum Archive

Topic: Linksys WRT54GL V1.1 Open Wrt 8.09 SD/MMC Help Please!!

The content of this topic has been archived on 20 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi All,

I have very sucessfully installed OpenWrt 8.09 Kamikaze (r14417) and installed a SD/MMC card, but when I reboot the router all is lost, here is what I have done.

1. Installed the mmc.o for GPI02 Module to /lib/modules/2.4.35.4
2. echo 0x9c > /proc/diag/gpiomask
3. insmod mmc
4. dmesg gives me the following.

[INFO] mmc_hardware_init: initializing GPIOs
[INFO] mmc_card_init: the period of a 380KHz frequency lasts 524 CPU cycles
[INFO] mmc_card_init: powering card on. sending 80 CLK
[INFO] mmc_card_init: 80 CLK sent in 43646 CPU cycles
[INFO] mmc_card_init: resetting card (CMD0)
[INFO] mmc_card_init: doing initialization loop
[INFO] mmc_card_init: card inited successfully in 663 tries (20453423 CPU cycles).
[INFO] mmc_init: MMC/SD Card ID:
03 53 44 53 55 30 32 47 80 00 e3 a7 61 00 93 7b [INFO] Manufacturer ID : 03
[INFO] OEM/Application ID: SD
[INFO] Product name : SU02G
[INFO] Product revision : 8.0
[INFO] Product SN : 00e3a761
[INFO] Product Date : 2009-3
[INFO] mmc_card_config: size = 1931264, hardsectsize = 1024, sectors = 1931264
[WARN] mmc_init: hd_sizes=1931264, hd[0].nr_sects=3862528
[INFO] mmc_card_init: set_blocklen (CMD16) succeeded !
Partition check:
mmca: p1

5. opkg install e2fsprogs
6. mkfs.ext3 /dev/mmc/disc0/part1

Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
241440 inodes, 482311 blocks
24115 blocks (5.00%) reserved for the super user
First data block=0
15 block groups
32768 blocks per group, 32768 fragments per group
16096 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912

Writing inode tables: done
Writing superblocks and filesystem accounting information: done
This filesystem will be automatically checked every 25 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.


7. opkg install kmod-fs-ext3
8. mount -t ext3 /dev/mmc/disc0/part1 /mnt/
9. df -h

Filesystem                Size      Used Available Use% Mounted on
rootfs                    1.6M      1.6M         0 100% /
/dev/root                 1.6M      1.6M         0 100% /rom
tmpfs                     7.0M     48.0k      7.0M   1% /tmp
/dev/mtdblock/4           1.7M    888.0k    840.0k  51% /jffs
mini_fo:/jffs             1.6M      1.6M         0 100% /
/dev/mmc/disc0/part1      1.8G     34.8M      1.7G   2% /mnt

I can now write or create whatever I want, in "mnt" which is my SD/MMC Card

------ Here is the strange part -------

1a. When I go "mount -t ext3 /dev/mmc/disc0/part1 /mnt/" the power LED keep flashing why is this?.
2b. The next is that this does not survive a reboot how can I fix this.

(Last edited by newboy on 1 Jun 2009, 03:41)

1a. When I go "mount -t ext3 /dev/mmc/disc0/part1 /mnt/" the power LED keep flashing why is this?.

I think mine has this problem too, but the router appears to be functioning normally otherwise....

2b. The next is that this does not survive a reboot how can I fix this.

You need to do two things in order to have the mmc mounted during boot:

a) create a script to load the mmc module during boot in /etc/modules.d, a text file with mmc in it named something like 30-mmc
b) add an entry in /etc/config/fstab to mount the file system

Hi Coolbird,

coolbird wrote:

1a. When I go "mount -t ext3 /dev/mmc/disc0/part1 /mnt/" the power LED keep flashing why is this?.

I think mine has this problem too, but the router appears to be functioning normally otherwise....

Good to hear I am not the only one.

coolbird wrote:

2b. The next is that this does not survive a reboot how can I fix this.

You need to do two things in order to have the mmc mounted during boot:

a) create a script to load the mmc module during boot in /etc/modules.d, a text file with mmc in it named something like 30-mmc
b) add an entry in /etc/config/fstab to mount the file system

Could you please elaborate or tell me exactly what I need to do in a couple of steps as I am a total noob and dont know exactly what I should be doing, greatly appriciate your help.

(Last edited by newboy on 5 Jun 2009, 04:56)

Actually 3 steps:

1. Go to /etc/init.d directory, open up a file named "boot" in vi editor, the last line of this file is "load_modules /etc/modules.d/*", you need to put a line with text "echo 0x9c > /proc/diag/gpiomask" above the load_modules line, save the file and exit vi, assuming you know how to use vi.

2. Go to /etc/modules.d directory, there are a whole bunch files in this directory, if you view the contents of any file, it only has a line or two with the name of the module(s) that needed to be loaded during boot up. Now use vi to create a new file, I named it "30-mmc", put text "mmc" in this file, save and quit vi.

3. Go to /etc/config directory, open file named "fstab" with vi, add the following block of text to the file, save and quit vi.

config mount
        option target   /mnt/sd
        option device   /dev/mmc/disc0/part1
        option fstype   ext3
        option options  defaults
        option enabled  1

for my router, I use ext3 file system, and mount point is /mnt/sd. If you mount to /mnt directory, with a different file system, you need to change the above test accordingly. If you you decided mount to a different mount point other than /mnt, you need to create the directory manually, for me, I had to create the sd directory by running "mkdir /mnt/sd"

After you done all above, reboot your router and the sd card should be mounted.

coolbird wrote:

Actually 3 steps:

1. Go to /etc/init.d directory, open up a file named "boot" in vi editor, the last line of this file is "load_modules /etc/modules.d/*", you need to put a line with text "echo 0x9c > /proc/diag/gpiomask" above the load_modules line, save the file and exit vi, assuming you know how to use vi.

2. Go to /etc/modules.d directory, there are a whole bunch files in this directory, if you view the contents of any file, it only has a line or two with the name of the module(s) that needed to be loaded during boot up. Now use vi to create a new file, I named it "30-mmc", put text "mmc" in this file, save and quit vi.

3. Go to /etc/config directory, open file named "fstab" with vi, add the following block of text to the file, save and quit vi.

config mount
        option target   /mnt/sd
        option device   /dev/mmc/disc0/part1
        option fstype   ext3
        option options  defaults
        option enabled  1

for my router, I use ext3 file system, and mount point is /mnt/sd. If you mount to /mnt directory, with a different file system, you need to change the above test accordingly. If you you decided mount to a different mount point other than /mnt, you need to create the directory manually, for me, I had to create the sd directory by running "mkdir /mnt/sd"

After you done all above, reboot your router and the sd card should be mounted.

Coolbird

You beauty, thanks a lot pal, just to think that I was struggling for weeks to do this. Wonder if we could make this a sticky in the wiki.

Just another question I want to install Asterisk on the SD card too, and this too I struggled like mad to get it started at bootup would you know what I would have to do to get it to start in the same way?.

I had all kind of problems on starting the programs installed in mmc/sd, I did a lot of googlings and asked the question here but no resolution. I ended up giving up on it and upgrade my wrt54g to a 16MB flash chip (hard moded) and installed all the programs to the flash chip and everything is ok now. I am current running tinyproxy, dansguardian, asterisk, along with qos-scripts. My unit has the 64M ram mod also....

coolbird wrote:

I had all kind of problems on starting the programs installed in mmc/sd, I did a lot of googlings and asked the question here but no resolution. I ended up giving up on it and upgrade my wrt54g to a 16MB flash chip (hard moded) and installed all the programs to the flash chip and everything is ok now. I am current running tinyproxy, dansguardian, asterisk, along with qos-scripts. My unit has the 64M ram mod also....

Looks like I am having the same issue as well, how did you do these mods & what parts did you use?.

upgrade my wrt54g to a 16MB flash chip (hard moded) & My unit has the 64M ram mod also....

The discussion might have continued from here.