hotplug II / mdev discussion and implementation

USB hub - works without mdev

When the mdev hotplug is in place insertion of a passive USB hub results in errors, but the original AVM hotplug handles this device without any problem.

Extract from syslog when not using mdev:
Code:
usb 1-1: new full speed USB device using ahci and address 3
hub 1-1:1.0: USB hub found
hub 1-1:1.0: 4 ports detected
usb 1-1.4: new full speed USB device using ahci and address 4
USB Mass Storage device (0781:5406) detected...
scsi1 : SCSI emulation for USB Mass Storage devices
usb-storage: device found at 4
usb-storage: waiting for device to settle before scanning
  Vendor: SanDisk   Model: U3 Cruzer Micro   Rev: 6.51
  Type:   Direct-Access                      ANSI SCSI revision: 00
SCSI device sdb: 2014271 512-byte hdwr sectors (1031 MB)
sdb: Write Protect is off
sdb: Mode Sense: 45 00 00 08
sdb: assuming drive cache: write through
SCSI device sdb: 2014271 512-byte hdwr sectors (1031 MB)
sdb: Write Protect is off
sdb: Mode Sense: 45 00 00 08
sdb: assuming drive cache: write through
 sdb: sdb1 sdb2 sdb3
Attached scsi removable disk sdb at scsi1, channel 0, id 0, lun 0
  Vendor: SanDisk   Model: U3 Cruzer Micro   Rev: 6.51
  Type:   CD-ROM                             ANSI SCSI revision: 00
usb-storage: device scan complete
EXT2-fs warning: mounting unchecked fs, running e2fsck is recommended
kjournald starting.  Commit interval 5 seconds
EXT3 FS on sdb3, internal journal
EXT3-fs: mounted filesystem with ordered data mode.


Code:
/var/mod/root # cat /proc/bus/usb/devices 

T:  Bus=01 Lev=00 Prnt=00 Port=00 Cnt=00 Dev#=  1 Spd=12  MxCh= 1
B:  Alloc=  0/900 us ( 0%), #Int=  0, #Iso=  0
D:  Ver= 1.10 Cls=09(hub  ) Sub=00 Prot=00 MxPS= 8 #Cfgs=  1
P:  Vendor=0000 ProdID=0000 Rev= 0.00
S:  Product=USB AHCI Root Hub
S:  SerialNumber=be008000
C:* #Ifs= 1 Cfg#= 1 Atr=40 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=   8 Ivl=255ms

T:  Bus=01 Lev=01 Prnt=01 Port=00 Cnt=01 Dev#=  3 Spd=12  MxCh= 4
D:  Ver= 2.00 Cls=09(hub  ) Sub=00 Prot=00 MxPS=64 #Cfgs=  1
P:  Vendor=05e3 ProdID=0608 Rev= 7.02
S:  Product=USB2.0 Hub
C:* #Ifs= 1 Cfg#= 1 Atr=e0 MxPwr=100mA
I:  If#= 0 Alt= 0 #EPs= 1 Cls=09(hub  ) Sub=00 Prot=00 Driver=hub
E:  Ad=81(I) Atr=03(Int.) MxPS=   1 Ivl=255ms
 
On a 7170, are the mdev-scan patches still required on top of the 0.0.4 patch set, or do these patches just provide for extra logging and tracing?

Everything needed is included in the current download of all four files.
 
When the mdev hotplug is in place insertion of a passive USB hub results in errors, but the original AVM hotplug handles this device without any problem.

Extract from syslog when not using mdev:

I don't believe the software itself can produce those errors. Perhaps, the events come quicker using mdev. It would be interesting to see the pure events. You could change the very last line in /etc/mdev.conf
Code:
# everything else
.* root:root 0600 */lib/mdev/common/mdevlog
Code:
# everything else
.* root:root 0600 */lib/mdev/common/mdevlog [B]on[/B]
and post syslog and console ouput.

Second thing, those supposedly syslog messages are output to the console, aren't they? Syslog entries are timestamped.
 
Another test of the hub handling by mdev gave NO errors! Strange.
The syslog may have been output from dmesg, I am not sure.
 
Habe in Syslogd diese ausgaben, der FTP Server startet aber problemlos.
Was ist das für ein Fehler oder Warnung: line 32.......

Der Log ist von einer 7170.



Code:
Jul 19 23:53:37 fritz local0.info partition[639]: starting 'S01ftpd'...
Jul 19 23:53:37 fritz local0.err partition[639]: /var/media/ftp/uStora1/.freetz/service/S01ftpd: line 32: a7value: not found
Jul 19 23:53:38 fritz local0.err partition[639]: /var/media/ftp/uStora1/.freetz/service/S01ftpd: line 32: a7value: not found
Jul 19 23:53:38 fritz local0.err partition[639]: /var/media/ftp/uStora1/.freetz/service/S01ftpd: line 32: log_info: not found
 
Habe in Syslogd diese ausgaben, der FTP Server startet aber problemlos.
Was ist das für ein Fehler oder Warnung: line 32.......

Der Log ist von einer 7170.



Code:
Jul 19 23:53:37 fritz local0.info partition[639]: starting 'S01ftpd'...
Jul 19 23:53:37 fritz local0.err partition[639]: /var/media/ftp/uStora1/.freetz/service/S01ftpd: line 32: a7value: not found
Jul 19 23:53:38 fritz local0.err partition[639]: /var/media/ftp/uStora1/.freetz/service/S01ftpd: line 32: a7value: not found
Jul 19 23:53:38 fritz local0.err partition[639]: /var/media/ftp/uStora1/.freetz/service/S01ftpd: line 32: log_info: not found

ooppps, didn't see those on my box, but I'll fix... As soon I get the samba session running like I want, 0.0.5 will be released.
 
Trying to apply mdev 0.0.4 for my 7170 fails. Freetz 1.0, svn-upped to r2382
Code:
[...]
mkdir -p source/ref-8mb_26
tar -C source/ref-8mb_26  -xjf dl/busybox-1.9.2.tar.bz2
for i in make/busybox/patches/*.patch; do \
                tools/freetz_patch source/ref-8mb_26/busybox-1.9.2 $i; \
        done
ERROR: modpatch: Error in patch-file make/busybox/patches/300-mdev_option_linkalias.patch
ERROR: modpatch: Error in patch-file make/busybox/patches/310-mdev_scan_mode.patch
ERROR: modpatch: Error in patch-file make/busybox/patches/320-mdev_scan_file.patch
ERROR: modpatch: Error in patch-file make/busybox/patches/330-mdev_delete_alias.patch
make: *** [source/ref-8mb_26/busybox-1.9.2/.unpacked] Fehler 2

Your using the wrong bb version... Do a clean svn co of the trunk;
 
signature of johnbock schrieb:
(freetz 2379M dnsmasq, dropbear, ..., mdev 0.0.5a)

In case you're enjoying your holidays, have a nice time.
You show 0.0.5a allready some time, it makes me curious. What is holding the release of mdev 0.0.5?
 
In case you're enjoying your holidays, have a nice time.
You show 0.0.5a allready some time, it makes me curious. What is holding the release of mdev 0.0.5?

I've been testing 0.0.5b for 3-4 days now and will release it very soon and includes
  • minor fixes
  • reworked storage interface for avm
    better separation between avm and mdev
  • reference implementation for ftp session
  • samba session (replacement only)
  • syslogd session
  • tam (telefon answering machine) session
 
Having services started on mount and stopped on unmount is very nice. What I would really like is that it would possible to start a service that has its software stored on the hot-plugged medium. This would yield most of the benefits that usbroot offers - btw. a test with a small change in usbroot so that it would not blindly and unconditionally reset the /proc/sys/kernel/hotplug with /sbin/hotplug, so that it would re-enable hotplug with mdev, did not succeed.

One would populate the storage the same way as one does with usbroot and create the links to the init.d scripts (on the medium!) in the .freetz/services directory as required. Problem here is that those software components and the init.d scripts are stored on the hot-plugged medium and not on the flash memory based file system root.

Maybe a chroot to the file system image on the plugged medium would help. When this file system image would be like one uses with usbroot, then any needed file would be present in the chroot, but I'm uncertain whether that suffices.

Any ideas?
 
What I would really like is that it would possible to start a service that has its software stored on the hot-plugged medium.
There is no requirement for the scripts nor the referenced programs to reside in flash. They must be executable, have a single parameter (start/stop) and follow the naming convention [SK][0-9][0-9][_a-Z0-9]. These scripts have a contingent of environment variables at their disposal, of those the most important may be MOUNT_DST: mount destination, the position in the filesystem at which the device was mounted.

This would yield most of the benefits that usbroot offers - btw. a test with a small change in usbroot so that it would not blindly and unconditionally reset the /proc/sys/kernel/hotplug with /sbin/hotplug, so that it would re-enable hotplug with mdev, did not succeed.

One would populate the storage the same way as one does with usbroot and create the links to the init.d scripts (on the medium!) in the .freetz/services directory as required. Problem here is that those software components and the init.d scripts are stored on the hot-plugged medium and not on the flash memory based file system root.

Maybe a chroot to the file system image on the plugged medium would help. When this file system image would be like one uses with usbroot, then any needed file would be present in the chroot, but I'm uncertain whether that suffices.

Any ideas?

Paramount to mdev is that it automatically performs a chdir to /dev at runtime. Chrooting to the mounted device is secondary. Mounting tmpfs to /dev prior to populating and then mount mv /dev to $MOUNT_DST/dev after population with a subsequent bind to /dev prior to restoring the hotplug program may be better.
Take a look at build/modified/filesystem/etc/init.d/rc.S;)

Once the partition in question is visible, make the node (cat /sys/block/sda/sda1/dev for major and minor) set MDEV to the partition (export MDEV=sda1) and call /lib/mdev/block/partition, the mdev configuration will take care of the rest (mounting, checking and script execution). Only a minimal of /dev nodes must be populated before manually calling this point in the hotplug chain. Again, take a look at build/modified/filesystem/etc/init.d/rc.S;)

Hint, do not attempt to run mdev -s to populate /dev...

HTH


BTW, I'll be releasing 0.0.5 in next couple of days. I want to ensure those problems with partitions being intermittently umounted after a couple of days (unrelated to mdev) are not surfacing in this version and model combination.
 
BTW, I'll be releasing 0.0.5 in next couple of days. I want to ensure those problems with partitions being intermittently umounted after a couple of days (unrelated to mdev) are not surfacing in this version and model combination.

any luck with that? Just tried to apply the patches to the latest trunk (r2402), and it fails because of changes in busybox (which was bumped to 1.11.1). I'd really love to see me stick being usable with all three partitions - swap, rootfs and separate storage for calls, logs, ...
 
any luck with that? Just tried to apply the patches to the latest trunk (r2402), and it fails because of changes in busybox (which was bumped to 1.11.1). I'd really love to see me stick being usable with all three partitions - swap, rootfs and separate storage for calls, logs, ...

You'll have to excuse my absence the last month... I won't be as present as in the past, but intend to keep up development of the mdev configuration project.

I hope to be releasing mdev configuration 0.6.1 which will be patched against freetz-trunk r2515 in the coming days. And will feature:
  • first of two parts simplifying module/device recognition during usbroot booting
  • new build routine to overcome differences in the different hardware
  • integration in the newer avm labor releases
 
Hi, lange nichts mehr von dir gehört , dachte schon das Projekt ist schon eingeschlafen...

Danke für die neue Version


Gruss
 
Hi John, will this new version go into Freetz trunk?
 
Back on the job, hope all is well.
A suggestion: add the 7170 in the make/mdev/Config.in, now I do it by hand.
Ciao, Paul
 
A few findings:

- the file mdev_my_uuid.patch seems personal to you
- build fails with:
Code:
  setup mdev boot sequence
    applying patch file ./patches/cond/mdev_fstab.patch
    patching file etc/fstab
    Hunk #1 FAILED at 3.
    1 out of 1 hunk FAILED -- saving rejects to file etc/fstab.rej

contents of fstab.rej
Code:
***************
*** 3,7 ****
  # <file system> <mount point>   <type>  <options>               <dump>  <pass>
  proc            /proc           proc    nosuid,nodev,noexec     0       0
  tmpfs           /var            tmpfs   defaults                0       0
- sysfs           /sys            sysfs   nosuid,nodev,noexec     0       0
- none            /dev/shm        tmpfs   nosuid,nodev,noexec     0       0
--- 3,5 ----
  # <file system> <mount point>   <type>  <options>               <dump>  <pass>
  proc            /proc           proc    nosuid,nodev,noexec     0       0
  tmpfs           /var            tmpfs   defaults                0       0
 
Hi John, will this new version go into Freetz trunk?
If it works and we consider it as good we will integrate it. ;-)

MfG Oliver

edit: I added the e2fsprogs patch to the trunk. This patch is obsolete now.
 
Zuletzt bearbeitet:
make menuconfig: no mdev in packages testing

I can not find mdev in menuconfig.
Only starting with char 'm':
madplay
Matrixtunnel
microperl
module-init-tools

Any ideas ?
Got it: make/mdev/Config.in says only
depends on FREETZ_TYPE_FON_WLAN_7270

Is it not possible for 7141 ?
 

Zurzeit aktive Besucher

Neueste Beiträge

Statistik des Forums

Themen
244,872
Beiträge
2,219,909
Mitglieder
371,594
Neuestes Mitglied
AA-Idealbau
Holen Sie sich 3CX - völlig kostenlos!
Verbinden Sie Ihr Team und Ihre Kunden Telefonie Livechat Videokonferenzen

Gehostet oder selbst-verwaltet. Für bis zu 10 Nutzer dauerhaft kostenlos. Keine Kreditkartendetails erforderlich. Ohne Risiko testen.

3CX
Für diese E-Mail-Adresse besteht bereits ein 3CX-Konto. Sie werden zum Kundenportal weitergeleitet, wo Sie sich anmelden oder Ihr Passwort zurücksetzen können, falls Sie dieses vergessen haben.