26

Odp: E353S-2 czy da się w końcu zrobić extroot'a na karcie SD modemu?

Ok tak zrobię (dopiero wieczorem będę miał możliwość) ale możliwe że w ogóle nie wchodzi w ten preinit? Pytam bo tak jak mówiłem - albo działa extroot albo modem i jak były "te razy" co działał modem to w logread było widać wpisy mówiące o przełączaniu - tu jest po prostu cisza.. Samo wydanie takiej komendy już po starcie routera powoduje przełączenie na modem tylko wtedy z wiadomych przyczyn sypie się extroot..

27

Odp: E353S-2 czy da się w końcu zrobić extroot'a na karcie SD modemu?

Jak by nie wchodził w preinit to by Ci extroota z czytnika nie zrobił.

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

28

Odp: E353S-2 czy da się w końcu zrobić extroot'a na karcie SD modemu?

Ok dam znać wieczorem - dzięki za pomoc smile

29

Odp: E353S-2 czy da się w końcu zrobić extroot'a na karcie SD modemu?

Tak więc pomijając fakt, że trzeba robić zmiany w pliku gdy nie ma zamontowanego exroot'a (bo ten co edytujemy nie jest przeglądany tylko ten przed włączeniem exroot'a - we flashu) to swithmode wypluwa info:

Looking for target devices ...
 No devices in target mode or class found
Looking for default devices ...
 No devices in default mode found. Nothing to do. Bye.
root@Gargoyle:/tmp$ cat /proc/bus/usb/devices

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=480 MxCh= 1
B:  Alloc=  0/800 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=01 MxPS=64 #Cfgs=  1
P:  Vendor=1d6b ProdID=0002 Rev= 2.06
S:  Manufacturer=Linux 2.6.32.27 ehci_hcd
S:  Product=Atheros AR91xx built-in EHCI controller
S:  SerialNumber=ar71xx-ehci
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=  0mA
I:* If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   4 Ivl=256ms

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  2 Spd=480 MxCh= 0
D:  Ver= 2.00 Cls=00(>ifc ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=12d1 ProdID=14fe Rev= 1.02
S:  Manufacturer=HUAWEI
S:  Product=HUAWEI Mobile
C:* #Ifs= 2 Cfg#= 1 Atr=80 MxPwr=500mA
I:* If#= 0 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
E:  Ad=01(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=81(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
I:* If#= 1 Alt= 0 #EPs= 2 Cls=08(stor.) Sub=06 Prot=50 Driver=usb-storage
E:  Ad=02(O) Atr=02(Bulk) MxPS= 512 Ivl=0ms
E:  Ad=82(I) Atr=02(Bulk) MxPS= 512 Ivl=0ms
root@Gargoyle:~$ cat /lib/preinit/50_determine_usb_root
#!/bin/sh
# Copyright (C) 2010 Vertical Communications
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.


determine_external_root() {
        pi_include /lib/functions/extmount.sh
        pi_include /lib/functions/mount.sh

        local OLD_UCI_CONFIG_DIR="$UCI_CONFIG_DIR"
        set_jffs_mp
        determine_root_device

        # extroot requires extroot and fstab config files, therefore
        # we assume configuration is incomplete and not to be used if either of them
        # is missing (for jffs versions of these files on squashfs image)
        if [ "$jffs" = "/tmp/overlay" ] && [ -r "/tmp/overlay/etc/config/fstab" ]; then
                UCI_CONFIG_DIR="/tmp/overlay/etc/config"
                ER_IS_SQUASHFS=true
                ER_OVERLAY_PREFIX="/tmp/overlay"
        fi

        # For squashfs on firstboot root_device will be tmpfs for the ramoverlay,
        # unless there is a saved config, in which case it will be /dev/root,
        # however in the case of a saved config, it won't be restored until after
        # this script, so there won't be a config on the first boot after
        # flashing a squashfs-based filesystem
        # For ext2, ramdisk, or jffs2 root filesystems root_device is /dev/root
        # For squashfs after firstboot, root filesystem is /dev/root
        # We only use the config from the root or jffs if the root_device is
        # /dev/root
        [ "$root_device" = "/dev/root" ] && {
                er_load_modules
                /usr/bin/usb_modeswitch -v 12d1 -p 14fe -c /etc/usb_modeswitch.d/12d1:14fe > /tmp/plik2.txt
                [ -n "$extroot_settle_time" ] && [ "$extroot_settle_time" -gt 0 ] && {
                        sleep $extroot_settle_time
                }
                config_load fstab
                config_foreach config_mount_by_section mount 1

                [ "$rootfs_found" = "1" ] && grep -q ' /overlay ' /proc/mounts && {
                        pi_extroot_mount_success=true
                        pi_mount_skip_next=false
                }
        }
        UCI_CONFIG_DIR="$OLD_UCI_CONFIG_DIR"
}

boot_hook_add preinit_mount_root determine_external_root

root@Gargoyle:~$

30

Odp: E353S-2 czy da się w końcu zrobić extroot'a na karcie SD modemu?

Przed /usr/bin/usb_modeswitch dodaj

/bin/mount -t usbfs none /proc/bus/usb
sleep 10

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

31 (edytowany przez byrrt 2012-04-19 20:42:04)

Odp: E353S-2 czy da się w końcu zrobić extroot'a na karcie SD modemu?

No wiec po tej modyfikacji wynik działania aplikacji /usr/bin/usb_modeswitch wygląda tak:

root@Gargoyle:/tmp$ cat plik2.txt

Looking for target devices ...
 No devices in target mode or class found
Looking for default devices ...
   found matching product ID
   adding device
 Found device in default mode, class or configuration (1)
Accessing device 002 on bus 001 ...
Getting the current device configuration ...
 OK, got current device configuration (1)
Using first interface: 0x00
Using endpoints 0x01 (out) and 0x81 (in)
Inquiring device details; driver will be detached ...
Looking for active driver ...
 OK, driver found ("usb-storage")
 OK, driver "usb-storage" detached

SCSI inquiry data (for identification)
-------------------------
  Vendor String: HUAWEI
   Model String: Mass Storage
Revision String: 2.31
-------------------------

USB description data (for identification)
-------------------------
Manufacturer: HUAWEI
     Product: HUAWEI Mobile
  Serial No.: not provided
-------------------------
Setting up communication with interface 0
Using endpoint 0x01 for message sending ...
Trying to send message 1 to endpoint 0x01 ...
 OK, message successfully sent
Resetting response endpoint 0x81
 Could not reset endpoint (probably harmless): -71
Resetting message endpoint 0x01
 Could not reset endpoint (probably harmless): -19
 Device is gone, skipping any further commands
-> Run lsusb to note any changes. Bye.

Edit:
I generalnie to działa smile

32

Odp: E353S-2 czy da się w końcu zrobić extroot'a na karcie SD modemu?

Prześledziłem ten wątek bo mam taki sam problem z włączeniem modemu  z extroot na karcie SD w E353. Router to TP-LINK 1034ND z OpenWRT  r32561 by obsy. Wykonalem, wydaje mi się, wszystkie kroki z powyższych sugestii ale niestety nie działa. Najgorsze jest to że plik \tmp\plik.txt powstaje ale jest pusty :-( (sprawdzałem na pamięci flash po uruchomieniu routera bez extroota) Nawet komenda logread > \tmp\plik.txt tworzy tylko pusty plik. Macie jakieś pomysły dlaczego się tak dzieje ? Może jest jeszcze jakiś inny sposób by to działało.

Uprzedzając pytanie informuję że modem jest rozpoznawany poprawnie jak włożę go dopiero po uruchomieniu routera (oczywiście wtedy bez extroota)

33

Odp: E353S-2 czy da się w końcu zrobić extroot'a na karcie SD modemu?

block-extroot-usb-modeswitch sprawdź. Szczegóły masz tu: http://eko.one.pl/forum/viewtopic.php?pid=47103#p47103

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

34

Odp: E353S-2 czy da się w końcu zrobić extroot'a na karcie SD modemu?

Dzięki, podążyłem za linkiem.