Although I'm pleased with the design of the hotplug replacement (hpr), the module separation/scalability and potential configuration is not optimal. While allowing optimal design for block devices, it does support char devices very well. For example, implementing a simple interface for diverse communications devices is not as easy as it may seem. And supplementing hpr for wlan sticks, bluetooth devices and profiles cannot be performed per plugin or freetz-module.
While searching for alternatives I came across busybox's own mdev: an udev replacement. I had to look at a few times at different perspectives to realize it's flexibility. Device configuration and module loading are held simple and easily allow good functional separation while not reducing scalability and flexibility.
In any case, I found a post at uclibc where Natanael Copa was requesting link support in mdev. In this post, he shows his mdev configuration and escorting scripts. In particular I admire how the required modules are loaded. It does however, have a few short-comings: the largest being mdev scan produces no event environment variables. Using a concept I found in the udev source, it was easily overcome. Big thanks to the guys at udev and kernel[/edit]
In order to incorporate the idea of his implementation (self loading modules) we would need to customize the following files
Solved in 0.0.2. There is at least one line (mtd creation) that needs to be changed dependent upon the hardware model.
There is at least one line (piglet module option definition) that needs to be changed dependent upon the hardware model.
- the devices maps in ./root and ./tools
Most of the static device creation is commented while building the mdev configuration modification. We could probably still tweak the one or the other entry.
- /lib/modules/<kernel version>/modules.dep is already supported
The file /etc/modprobe.conf modification must be mainly hardware version/revision based while all other files are modified per configured module. I believe this maintains optimal granularity between image configuration and build. The entries in this file can also be used correlate modules to hardware with out having to patch the kernel or modules.
This could also allow addons like usbroot to allow the system to bring up the required devices independent of the underlying hardware. There is an example of how one can simplify piglet loading. I used it while analyzing mdev at boot in scan mode.
Additionally, /dev and /dev/pts are mounted in rc.S at boot as the mdev documentation suggests. Subsequently, mdev is executed in scan mode to set up cold-plugged devices. Lastly, announce mdev hotplugging to the kernel.
- mdev should have some kind notification while booting into usbroot or initrd to allow only the required devices to be initialized. a dot file/directory indicating initialization @boot is complete. Each mdev script must voluntarily adhere to this conventionor integrate support directly in mdev.confCode:#!/bin/sh [ -e /dev/.mdev ] || exit ...This is still on my TODO list and will remain there for a while. Device (lp) / service (aura) implementation is more important.Code:usblp[0-9] root:root 0660 @[ -e /dev/.mdev ] && /lib/mdev/printer
- may require extensive modifications to the init scripts
This was not as much as I expected.
- Even after implementation, the system requires /sbin/makedevs
At the moment the following devices are explicitly supported
- HDs and memory keys (disk, partition, swap, vfat, ext2, ext3 with fsck)
The naming convention has been altered to allow as many devices as the kernel does. swaps haven't been tested yet.
- bluetooth dongles with bluez-util mod
- hid (keyboard, mouse) are recognized but have no module support
- stick n surf usb wlan sticks and possibly mini fon (don't have one to test)
The attached patches and tar file are included only for review purposes or for the extremely brave or immensely stupid. If you don't know how the box boots or how hotplug works you should not include the package in an image to be installed. The current implementation is intended for only the 7270 and has been tested with the freetz trunk at 2365
Version 0.0.2 - 02.Jul.2008
- harmonized mtd char double-up node creation (hardware independent)
Version 0.0.3 - 10.Jul.2008
- register/unregister mountpoint with tam (telephone answering machine), no automatic activation
Version 0.0.4 - 13.Jul.2008
- change mdev scan behavior for ohio kernels
---- scan additionally for modalias files
---- scan entire sysfs w/o following symlinks
---- workaround for missing uevent files on ohio kernels required for scanning
- correct mdev remove event behavior (remove evtl. node aliases)
- include busybox patch for Config.4mb_26 configurations
Version 0.0.5 - Not released
Version 0.6.1 - 10.Sep.2008
Version 0.6.2 - 11.Sep.2008 [your mileage may vary]
- updated busybox patches to 1.11.2
- updated freetz patches to 2524
- updated e2fsprogs patches (e2fsprogs.mk)
- tam hotplug session fixes
- new build accounts for hardware differences (modprobe piglet) part one
* these are used for both 2.6.19 and 2.6.13 kernels and have been thoroughly tested on the 7270
- adjusted patching to freetz r2531
- eleminated e2fsprogs and busybox configuration patches (in freetz trunk)
- mdev patches for tailoring scan behavior (primarily required for ohio kernels)
- mdev configuration build uses new bb conf in freetz trunk
- acquiescing hardware part two: after running /lib/mdev/misc/bitfile piglet can be loaded using 'modprobe avm_piglet'
- load usbhost (usbahcicore, musb_hdrc) modules hardware independently: modprobe avm_usb_host