OpenWrt Forum Archive

Topic: SD mount on JFFS - Kamikaze 7.09

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

Hi guys,
I've spent more times in these days to solve this problem on my WRT54G v3.1 with SDmod. I've read and used the howto follow this link: http://forum.openwrt.org/viewtopic.php?id=10816 and iìve try to do this on my environ...

I have modified the mount_root script with these line:

#!/bin/sh
# Copyright (C) 2006 OpenWrt.org
. /etc/functions.sh

jffs2_ready () {
        mtdpart="$(find_mtd_part rootfs_data)"
        magic=$(hexdump $mtdpart -n 4 -e '4/1 "%02x"')
        [ "$magic" != "deadc0de" ]
}

grep rootfs_data /proc/mtd >/dev/null 2>/dev/null && {
        . /bin/firstboot
        mtd unlock rootfs_data
        jffs2_ready && {
        echo "loading USB and ext2 modules"
                insmod ext2
                insmod mmc
                echo "0x9c" > /proc/diag/gpiomask
                sleep 2
                echo "switching to jffs2"
             
        mount /dev/mmc/disk0/part1 /jffs -t ext2 && \
                        fopivot /jffs /rom
        } || {
                echo "jffs2 not ready yet; using ramdisk"
                ramoverlay
        }
} || {
        mtd unlock rootfs
        mount -o remount,rw /dev/root /
}

I have correctly make image with ImageBuilder for Kamikaze 7.09 but when i reboot the router the jffs not change, the sd is loaded correctly but is not mounted properly the df -h command returns the sequences:

root@OpenWrt:/# df -h
Filesystem                Size      Used Available Use% Mounted on
none                      7.0M     32.0k      7.0M   0% /tmp
mini_fo:/tmp/root       832.0k    832.0k         0 100% /tmp/root
/dev/mtdblock/4           2.4M    324.0k      2.1M  13% /jffs
mini_fo:/jffs           832.0k    832.0k         0 100% /

As you can see, no sd (/dev/mmc/disc0/part1) has mounted...

I don't know where i'd wrong!!!grrrrggrrrr.....
What can i try?

p.s.
If someone have solve this problem on wrt, please post the right mount_root script.

Thank you

Oh...I have solve the problem with this USB howto http://wiki.openwrt.org/UsbStorageHowto … 6ac90d98fe

Some file must to be modified...for example the usb module is not necessary, so the different are:

create script /etc/init.d/pivotroot (Kamikaze 7.09 on my WRT54G v3.1 with sdmod GPIO5)

#!/bin/sh
# change this to your boot partition
boot_dev="/dev/mmc/disco0/part1"
# install needed modules for usb and the ext3 filesystem
# **NOTE** for usb2.0 replace "uhci" with "ehci-hcd"
# **NOTE** for ohci chipsets replace "uhci" with "usb-ohci"
for module in mmc ext2 ext3 ; do {
        insmod $module
}; done
# this may need to be higher if your disk is slow to initialize
sleep 2s
echo "0x9c" > /proc/diag/gpiomask
# mount the usb stick
mount "$boot_dev" /mnt
# if everything looks ok, do the pivot root
[ -x /mnt/sbin/init ] && {
        mount -o move /proc /mnt/proc && \
        pivot_root /mnt /mnt/mnt && {
                mount -o move /mnt/dev /dev
                mount -o move /mnt/tmp /tmp
                mount -o move /mnt/jffs2 /jffs2 2>&-
                mount -o move /mnt/sys /sys 2>&-
        }
}


and then these package must to be installed kmod-fs-ext2, kmod-fs-ext3, kmod-broadcom-mmc

The others things to do are always the same in the USB howto


Another problem solved!!! hehehe.....GREAT!!!

(Last edited by marcotrapani on 2 Feb 2008, 15:26)

I have a Pronghorn Metro (ADI) board.
I simply want to mount the cf. I installed squashfs(with included jffs2).
But I cannot mount anyway the cf.

mount /dev/hda1 /mnt/disk :failed

Any suggestions?

G

Does anyone succed in mountig the compact flash card?
Please, help.
G

Why do you need the CF; Openwrt runs fine on the on-board flash.

Sorry for not answering, but i have two pronghorns and i have never tried to mount a CF. They are running fine from the onboard flash memmory.

The discussion might have continued from here.