1 (edytowany przez Tytan69 2010-05-08 11:11:00)

Temat: extroot i sdhc mod na WRT54GL

Jak w temacie nie che zadziałać.
Samo SDHC działa poprawnie i montuje się ręcznie i automatycznie.
block-extroot i broadcom-kmod-sdhc są wkompilowane w obraz.
Po dokonaniu wpisów w /etc/fstab jak w opisie na eko extroot nie rusza.
Czytając wątki na forach widzę że problemem może być potrzeba inicjalizacji modułu sdhc z ustawieniami gpio przed extroot.
Obecnie mam wpisy konfiguracji sdhc w sdcard.conf.

Próbowałem też gpio wpisac do /etc/modules.d/29-sdhc:

# cat 29-sdhc
# May be required for rootfs
sdhc din=2 dout=4 clk=3 cs=7

Nie pomogło.

---------------------------------------------------------------------------------------------------------------------
root@OpenWrt:~# dmesg
CPU revision is: 00029008
Primary instruction cache 16kB, physically tagged, 2-way, linesize 16 bytes.
Primary data cache 8kB, 2-way, linesize 16 bytes.
Linux version 2.4.37.9 (nico@desktop-de-nico) (gcc version 3.4.6 (OpenWrt-2.0))                                              #15 Fri Apr 9 02:19:07 CEST 2010
Setting the PFC to its default value
Determined physical RAM map:
memory: 01000000 @ 00000000 (usable)
On node 0 totalpages: 4096
zone(0): 4096 pages.
zone(1): 0 pages.
zone(2): 0 pages.
Kernel command line: root=/dev/mtdblock2 rootfstype=squashfs,jffs2 init=/etc/pre                                             init noinitrd console=ttyS0,115200
CPU: BCM5352 rev 0 at 200 MHz
Using 100.000 MHz high precision timer.
Calibrating delay loop... 199.47 BogoMIPS
Memory: 14240k/16384k available (1447k kernel code, 2144k reserved, 100k data, 8                                             4k init, 0k highmem)
Dentry cache hash table entries: 2048 (order: 2, 16384 bytes)
Inode cache hash table entries: 1024 (order: 1, 8192 bytes)
Mount cache hash table entries: 512 (order: 0, 4096 bytes)
Buffer cache hash table entries: 1024 (order: 0, 4096 bytes)
Page-cache hash table entries: 4096 (order: 2, 16384 bytes)
Checking for 'wait' instruction...  unavailable.
POSIX conformance testing by UNIFIX
PCI: no core
PCI: Fixing up bus 0
Linux NET4.0 for Linux 2.4
Based upon Swansea University Computer Society NET3.039
Initializing RT netlink socket
Starting kswapd
Registering mini_fo version $Id$
devfs: v1.12c (20020818) Richard Gooch (rgooch@atnf.csiro.au)
devfs: boot_options: 0x1
JFFS2 version 2.1. (C) 2001 Red Hat, Inc., designed by Axis Communications AB.
squashfs: version 3.0 (2006/03/15) Phillip Lougher
pty: 256 Unix98 ptys configured
Serial driver version 5.05c (2001-07-08) with MANY_PORTS SHARE_IRQ SERIAL_PCI en                                             abled
ttyS00 at 0xb8000300 (irq = 3) is a 16550A
ttyS01 at 0xb8000400 (irq = 3) is a 16550A
b44.c:v0.93 (Mar, 2004)
PCI: Setting latency timer of device 00:01.0 to 64
eth0: Broadcom 47xx 10/100BaseT Ethernet 00:1d:7e:bd:3e:0e
Physically mapped flash: Found an alias at 0x400000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x800000 for the chip at 0x0
Physically mapped flash: Found an alias at 0xc00000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x1000000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x1400000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x1800000 for the chip at 0x0
Physically mapped flash: Found an alias at 0x1c00000 for the chip at 0x0
Amd/Fujitsu Extended Query Table v1.1 at 0x0040
number of CFI chips: 1
cfi_cmdset_0002: Disabling fast programming due to code brokenness.
Flash device: 0x400000 at 0x1c000000
bootloader size: 262144
Physically mapped flash: Filesystem type: squashfs, size=0x1a2a16
Creating 5 MTD partitions on "Physically mapped flash":
0x00000000-0x00040000 : "cfe"
0x00040000-0x003f0000 : "linux"
0x000bc000-0x00260000 : "rootfs"
mtd: partition "rootfs" doesn't start on an erase block boundary -- force read-o                                             nly
0x003f0000-0x00400000 : "nvram"
0x00260000-0x003f0000 : "rootfs_data"
sflash: found no supported devices
Initializing Cryptographic API
NET4: Linux TCP/IP 1.0 for NET4.0
IP Protocols: ICMP, UDP, TCP, IGMP
IP: routing cache hash table of 512 buckets, 4Kbytes
TCP: Hash tables configured (established 1024 bind 2048)
Linux IP multicast router 0.06 plus PIM-SM
NET4: Unix domain sockets 1.0/SMP for Linux NET4.0.
NET4: Ethernet Bridge 008 for NET4.0
802.1Q VLAN Support v1.8 Ben Greear <greearb@candelatech.com>
All bugs added by David S. Miller <davem@redhat.com>
VFS: Mounted root (squashfs filesystem) readonly.
Mounted devfs on /dev
Freeing unused kernel memory: 84k freed
diag: Detected 'Linksys WRT54G/GS/GL'
b44: eth0: Link is up at 100 Mbps, full duplex.
b44: eth0: Flow control is off for TX and off for RX.
roboswitch: Probing device eth0: found a 5325! It's a 5350.
b44: eth0: Link is up at 100 Mbps, full duplex.
b44: eth0: Flow control is off for TX and off for RX.
b44: eth0: Link is up at 100 Mbps, full duplex.
b44: eth0: Flow control is off for TX and off for RX.
Journalled Block Device driver loaded
mini_fo: using base directory: /
mini_fo: using storage directory: /overlay
b44: eth0: Link is up at 100 Mbps, full duplex.
b44: eth0: Flow control is off for TX and off for RX.
b44: eth0: Link is up at 100 Mbps, full duplex.
b44: eth0: Flow control is off for TX and off for RX.
jffs2.bbc: SIZE compression mode activated.
b44: eth0: Link is up at 100 Mbps, full duplex.
b44: eth0: Flow control is off for TX and off for RX.
[INF] sdhc: Version: 2.0.2  Parms: major=0 din=2 dout=4 clk=3 cs=7 maxsec=32 rah                                             ead=2
[INF] sdhc: SD Card detected & initialized
[INF] sdhc: Assigned dynamic major number 254
Partition check:
/dev/sdcard:<7>eth0.0: add 01:00:5e:00:00:01 mcast address to master interface
p1
[INF] sdhc: Module loaded
CSLIP: code copyright 1989 Regents of the University of California
..
..
..........................................................................................................................................................................................
Jak extroot poprawnie uruchomić na sdhc mod?

2

Odp: extroot i sdhc mod na WRT54GL

Czy te opcje w 29-sdhc masz wkompilowane w obraz? Bo powinno, całość uruchamia się zaraz po starcie, przed jeszcze zabawami z jffs.

Pokaż mi logread (cały). Czy w czasie startu widzi już kartę? Inaczej, jak zrobisz bez extroot  tylko sam wpis w fstab, to karta montuje się automatem?

Edit: sd Ci za późno startuje. Przed tym jffs juz musi być. Wkompiluj to w obraz, parametry też umieść na stałe.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

3 (edytowany przez Tytan69 2010-05-08 11:28:28)

Odp: extroot i sdhc mod na WRT54GL

29-sdhc mam dopisane już później, nie ma tego w obrazie.

Karta za pomocą samego wpisu w ftstab w wyłączonym extroot:

config 'mount'
        option 'target' '/mnt/sd'
        option 'device' '/dev/sdcard/part1'
        option 'fstype' 'ext3'
        option 'options' 'rw,sync'
        option 'enabled_fsck' '1'
        option 'enabled' '1'
        option 'is_rootfs' '0'


nie montuje się sama - wymaga jeszcze dopisanie gdzieś  sdcard start.

a to logread gdy w fstab wyłączę extroot:

--------------------------------------------------------------------------------------------------------------
root@OpenWrt:~# logread
Jan  1 00:00:33 OpenWrt syslog.info syslogd started: BusyBox v1.15.3
Jan  1 00:00:33 OpenWrt user.notice kernel: klogd started: BusyBox v1.15.3 (2010-04-06 04:14:37 CEST)
Jan  1 00:00:33 OpenWrt user.warn kernel: CPU revision is: 00029008
Jan  1 00:00:33 OpenWrt user.warn kernel: Primary instruction cache 16kB, physically tagged, 2-way, linesize 16 bytes.
Jan  1 00:00:33 OpenWrt user.warn kernel: Primary data cache 8kB, 2-way, linesize 16 bytes.
Jan  1 00:00:33 OpenWrt user.warn kernel: Linux version 2.4.37.9 (nico@desktop-de-nico) (gcc version 3.4.6 (OpenWrt-2.0)) #15 Fri Apr 9 02:19:07 CEST 2010
Jan  1 00:00:33 OpenWrt user.warn kernel: Setting the PFC to its default value
Jan  1 00:00:33 OpenWrt user.warn kernel: Determined physical RAM map:
Jan  1 00:00:33 OpenWrt user.warn kernel:  memory: 01000000 @ 00000000 (usable)
Jan  1 00:00:33 OpenWrt user.warn kernel: On node 0 totalpages: 4096
Jan  1 00:00:33 OpenWrt user.warn kernel: zone(0): 4096 pages.
Jan  1 00:00:33 OpenWrt user.warn kernel: zone(1): 0 pages.
Jan  1 00:00:33 OpenWrt user.warn kernel: zone(2): 0 pages.
Jan  1 00:00:35 OpenWrt user.info kernel: b44: eth0: Link is up at 100 Mbps, full duplex.
Jan  1 00:00:35 OpenWrt user.info kernel: b44: eth0: Flow control is off for TX and off for RX.
Jan  1 00:00:36 OpenWrt user.debug kernel: eth0.0: add 01:00:5e:00:00:01 mcast address to master interface
Jan  1 00:00:36 OpenWrt user.info kernel: [INF] sdhc: Version: 2.0.2  Parms: major=0 din=2 dout=4 clk=3 cs=7 maxsec=32 rahead=2
Jan  1 00:00:36 OpenWrt user.info kernel: [INF] sdhc: SD Card detected & initialized
Jan  1 00:00:36 OpenWrt user.info kernel: [INF] sdhc: Assigned dynamic major number 254
Jan  1 00:00:36 OpenWrt user.info kernel: Partition check:
Jan  1 00:00:37 OpenWrt user.info kernel:  /dev/sdcard: p1
Jan  1 00:00:37 OpenWrt user.info kernel: [INF] sdhc: Module loaded
Jan  1 00:00:37 OpenWrt user.info kernel: CSLIP: code copyright 1989 Regents of the University of California
Jan  1 00:00:37 OpenWrt user.info kernel: PPP generic driver version 2.4.2
Jan  1 00:00:38 OpenWrt user.warn kernel: ip_tables: (C) 2000-2002 Netfilter core team
Jan  1 00:00:40 OpenWrt user.warn kernel: ip_conntrack version 2.1 (5953 buckets, 5953 max) - 352 bytes per conntrack
Jan  1 00:00:41 OpenWrt user.debug kernel: eth0.1: add 01:00:5e:00:00:01 mcast address to master interface
Jan  1 00:00:41 OpenWrt user.info kernel: eth0.0: dev_set_promiscuity(master, 1)
Jan  1 00:00:41 OpenWrt user.info kernel: device eth0 entered promiscuous mode
Jan  1 00:00:41 OpenWrt user.info kernel: device eth0.0 entered promiscuous mode
Jan  1 00:00:41 OpenWrt user.info kernel: br-lan: port 1(eth0.0) entering learning state
Jan  1 00:00:41 OpenWrt user.info kernel: br-lan: port 1(eth0.0) entering forwarding state
Jan  1 00:00:41 OpenWrt user.info kernel: br-lan: topology change detected, propagating
Jan  1 00:00:41 OpenWrt user.debug kernel: eth0.1: del 01:00:5e:00:00:01 mcast address from vlan interface
Jan  1 00:00:41 OpenWrt user.debug kernel: eth0.1: del 01:00:5e:00:00:01 mcast address from master interface
Jan  1 00:00:41 OpenWrt user.warn kernel: eth0.1: Setting MAC address to  00 c0 26 a8 ef 27.
Jan  1 00:00:41 OpenWrt user.debug kernel: eth0.1: add 01:00:5e:00:00:01 mcast address to master interface
Jan  1 00:00:44 OpenWrt user.info sysinit: Loading defaults
Jan  1 00:00:46 OpenWrt user.info sysinit: Loading synflood protection
Jan  1 00:00:46 OpenWrt user.info sysinit: Adding custom chains
Jan  1 00:00:47 OpenWrt user.info sysinit: Loading zones
Jan  1 00:00:48 OpenWrt user.info sysinit: Loading forwarding
Jan  1 00:00:48 OpenWrt user.info sysinit: Loading redirects
Jan  1 00:00:48 OpenWrt user.info sysinit: Loading rules
Jan  1 00:00:48 OpenWrt user.info sysinit: Loading includes
Jan  1 00:00:48 OpenWrt user.info sysinit: Loading zone defaults
Jan  1 00:00:49 OpenWrt user.notice root: adding lan (br-lan) to firewall zone lan
Jan  1 00:00:50 OpenWrt user.info sysinit: sdcard - Already started...
Jan  1 00:00:50 OpenWrt authpriv.info dropbear[650]: Running in background
Jan  1 00:00:51 OpenWrt daemon.info dnsmasq[665]: started, version 2.52 cachesize 150
Jan  1 00:00:51 OpenWrt daemon.info dnsmasq[665]: compile time options: IPv6 GNU-getopt no-DBus no-I18N DHCP TFTP
Jan  1 00:00:51 OpenWrt daemon.info dnsmasq[665]: using local addresses only for domain lan
Jan  1 00:00:51 OpenWrt daemon.warn dnsmasq[665]: no servers found in /tmp/resolv.conf.auto, will retry
Jan  1 00:00:51 OpenWrt daemon.info dnsmasq[665]: read /etc/hosts - 1 addresses
Jan  1 00:01:08 OpenWrt authpriv.info dropbear[673]: Child connection from 192.168.1.101:1242
Jan  1 00:01:13 OpenWrt authpriv.notice dropbear[673]: password auth succeeded for 'root' from 192.168.1.101:1242
------------------------------------------------------------------------------------------------------------------------------------
Cyt" Wkompiluj to w obraz, parametry też umieść na stałe." wkompilować 29-sdhc i coś jeszcze? Może fstab od razu z extroot włączonym?

4

Odp: extroot i sdhc mod na WRT54GL

Nie, fstab nie koniecznie. Ważne żeby sdhc był z parametrami wkompilowany.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

5

Odp: extroot i sdhc mod na WRT54GL

Dodałem do kompilacji 29-sdhc.
Fstab nie ruszam.

fdisk -l pokazuje /dev/sdcard/part1

Po dodaniu do /etc/config/fstab wpisu aby montował bez extroot nie montuje nadal.

komenda mount -a
root@OpenWrt:~# mount -a
mount: cannot read /etc/fstab: No such file or directory

W /etc/fstab to symlink który pokazuje na /tmp/fstab którego nie ma wcale !

gdy zmienie tyn symlink aby pokazywał /etc/config/fstab to:

root@OpenWrt:~# mount -a
mount: mounting config on global failed: No such file or directory
mount: mounting option on from_fstab failed: No such file or directory
mount: mounting option on anon_mount failed: No such file or directory

Co jest źle?

6

Odp: extroot i sdhc mod na WRT54GL

ma być do /tmp/fstab. Czy zainstalowałeś block-mount? Czy zrobiłeś /etc/init.d/fstab enable?

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

7 (edytowany przez Tytan69 2010-05-08 16:52:33)

Odp: extroot i sdhc mod na WRT54GL

pakiet block-mount jest.
Ale gdzie to dopisać/zrobić   /etc/config/fstab enable  ?

takie coś przy robieniu obrazka wyskakuje:

Activating init scripts
.: 11: Can't open /lib/functions/mount.sh
sdcard - /etc/sdcard.conf not found
make[1]: Leaving directory `/home/andrzej/Openwrt/Imagebuilder/OpenWrt-ImageBuilder-brcm-2.4'
make[1]: Entering directory `/home/andrzej/Openwrt/Imagebuilder/OpenWrt-ImageBuilder-brcm-2.4'
sdcard.conf dodaję w files.
??

8

Odp: extroot i sdhc mod na WRT54GL

/etc/init.d/fstab enable.

A teraz zrób /etc/init.d/fstab  start, fstab powinien się wygenerować i zamontować nośnik.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

9 (edytowany przez Tytan69 2010-05-08 17:15:04)

Odp: extroot i sdhc mod na WRT54GL

Pewnie do mety blisko smile

Powyższe zadziałało.

Ale gdzie to /etc/init.d/fstab enable  powinno być ustawione przy kompilacji aby było od razu i to odpowiednio wczesnie?
Jedyna mozliwość to wrzucić symlink do /etc/rc.d czy jakoś inaczej ładniej?

10

Odp: extroot i sdhc mod na WRT54GL

No własne powinieneś to już mieć, powinien się z automatu zrobić. Wyczyść źródła i skompiluj jeszcze raz.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

11

Odp: extroot i sdhc mod na WRT54GL

Robie to Imagebuilderem....
Moze spróbuję jednak z svn.

Zmieniłem wpis w fstab (gdy juz karta automatycznie się montowała) aby się robił extroot - dioda power miga i miga jakby wiecznie system się ładował... zalogować się nie daje..
Teraz jestem w kropce.. zgaduj zgadula...

12

Odp: extroot i sdhc mod na WRT54GL

A gdzie masz serial? Wszystko byś wiedział wtedy...

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

13

Odp: extroot i sdhc mod na WRT54GL

Serial mam w szufladzie i na razie służył tylko do WRT160NL  smile

Ale eureka po około 10 minutach migania system załadował się !

To kwestia wolnego strasznie transferu z karty SD. Dziwne bo normalnie gdy montowałem miała ok. 400kB/s.
Karta ma 4GB ale to chyab nie ma znaczenia pojemność. Potrzebny tuning.

14

Odp: extroot i sdhc mod na WRT54GL

Nie zrobisz żadnego. sdhc to najszybszy sterownik jaki jest smile

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

15

Odp: extroot i sdhc mod na WRT54GL

Myślę, że teraz nie ma tych 400kB/s. coś nie tak.
Pisali, że sync w fstab wyłączyć ... szperam dalej w czym problem.

16

Odp: extroot i sdhc mod na WRT54GL

rw,noatime tylko zostaw.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

17

Odp: extroot i sdhc mod na WRT54GL

Trochę testów i stwierdzam, że wpis 29-sdhc w modules źle inicjuje kartę.
W ten sposób sterownik strasznie obciąża system aż momentami staje dęba i stąd takie długie ładowanie systemu (20min !).
Bez tego wpisu w module załadowany przez /et/init.d/sdcard start (na podstawie configu sdcard.conf) karta zamontowana pracuje dobrze i nie obiąża za bardzo. Różnica jest jeszcze taka że w drugim przypadku karta jest montowana ręcznie mount a nie przez fstab (rw,noatime)
GPIO w obu przypadkach mam dokładnie tak samo.
Jakiś pomysł?

18

Odp: extroot i sdhc mod na WRT54GL

Zobacz sobie ten /etc/init.d/sdcard Tam w sumie nie mia nic poza załadowaniem moduły z paramterami, raz wyliczeniem i zrobieniem maski dla gpio. Może to to.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

19

Odp: extroot i sdhc mod na WRT54GL

Kompilacja z svn poprawiła znacząco.
Można uznać że działa system na extroot:
---------------------------------------------------------------------------------------
root@OpenWrt:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 2.1M      2.1M         0 100% /rom
tmpfs                     7.0M     40.0K      7.0M   1% /tmp
/dev/sdcard/part1         3.6G     71.5M      3.4G   2% /overlay
mini_fo:/overlay          2.1M      2.1M         0 100% /
root@OpenWrt:~#
------------------------------------------------------------------------------------------
Imagebuilder do kosza !!!

Jeszcze coś z pamiecią lub jakimś buforem:
-----------------------------------------------------------------------------------
root@OpenWrt:~# fdisk -l

Disk /dev/sdcard/disc: 3958 MB, 3958898688 bytes
126 heads, 61 sectors/track, 1006 cylinders
Units = cylinders of 7686 * 512 = 3935232 bytes
Disk identifier: 0x00000000

           Device Boot      Start         End      Blocks   Id  System
/dev/sdcard/part1               1        1006     3866027+  82  Linux swap / Solaris
root@OpenWrt:~# hdparm -Tt /dev/sdcard/part1

/dev/sdcard/part1:
read(2097152) returned 876544 bytes
could not allocate timing buf: Cannot allocate memory
root@OpenWrt:~# free
              total         used         free       shared      buffers
  Mem:        14336        13216         1120            0          452
Swap:            0            0            0
Total:        14336        13216         1120
-------------------------------------------------------------------------------------------

konieczny swap czy w czym rzecz?

20

Odp: extroot i sdhc mod na WRT54GL

Swap przydałby się, ale i tak nie powinno się wywalić przy hdparmie.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

21

Odp: extroot i sdhc mod na WRT54GL

Po wielu próbach i testach potwierdziłem, że karta odpalona z ustawieniami w modules
chodzi bardzo wolno i obciąża system. Odpalona przez sdcard start na etapie odpalania usług chodzi sprawnie.
Dziwne ale prawdziwe a powodu na razie nie znalazłem.

22

Odp: extroot i sdhc mod na WRT54GL

Zrób proszę test (tak jak to sdhc robi) w jednym i drugim przypadku. Naprawdę ciekawe co jest powodem.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

23

Odp: extroot i sdhc mod na WRT54GL

Skoro już się bawisz, sprawdź to: https://forum.openwrt.org/viewtopic.php … 65#p108765

Ma być zapisany jako /lib/preinit/45_init-sd-card, konfigurację zostawiasz normalnie w /etc/sdcard.conf. w modules.d nic.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

24

Odp: extroot i sdhc mod na WRT54GL

Czytałem wątek ale rano jak nie było posta ostatniego.
Według tego preinit działa jak należy. Dzięki za link.