With the implementation version 0.1 of the hotplug proposal I was able get hotplugging to perform the operations documented in the time-line.
Prerequisites and presumptions:
1) no connected usb devices
2) copied proposal implementation v0.1 onto the box, default /tmp/_dev_hot_plug_
3) hotplug program path of 1) loaded to /proc/sys/kernel/hotplug
4) usb hard disk
5) delete corresponding device nodes in /dev
6) absence of the kernel modules scsi_mod, sd_mod, usb_storage, ext2, ext3, mbcache, fat, vfat, nls_iso8859-1, nls_cp437
7) the program blkid of the e2fs-tools is in $PATH
The implementation can handle certain error conditions such as the presence of the above modules and missing mount points. This run should show that the system is able to handle missing the above. In other words, the proposal can be used at boot
For this run I have added two entries to /etc/fstab:
Code:
UUID=a43c59fa-8c6c-4ab1-9fb5-56055bbb84e9 none swap sw 0 0
UUID=8767bfe9-6747-4937-81c3-eb56d1b76d22 /var/opt ext2 noatime,nodiratime 0 1
Here the results from syslog
Code:
Apr 12 10:51:36 fritz local0.debug hotplug: ignoring 'usb_endpoint.add' hotplug event
Apr 12 10:51:36 fritz local0.debug hotplug: starting hotplug chain 'usb.add'
Apr 12 10:51:36 fritz local0.debug hotplug: starting hotplug chain 'usb.add'
Apr 12 10:51:36 fritz local0.debug hotplug: ignoring 'usb_endpoint.add' hotplug event
Apr 12 10:51:36 fritz local0.debug hotplug: ignoring 'usb_endpoint.add' hotplug event
Apr 12 10:51:36 fritz local0.debug hotplug: starting hotplug chain 'usb_device.add'
Apr 12 10:51:36 fritz local0.debug hotplug: loading usb-storage kernel module
Apr 12 10:51:37 fritz local0.debug hotplug: ignoring 'module.add' hotplug event
Apr 12 10:51:37 fritz local0.info hotplug: attached device 'TrekStor - HS020GB '
Apr 12 10:51:37 fritz local0.debug hotplug: ignoring 'module.add' hotplug event
Apr 12 10:51:37 fritz local0.debug hotplug: ignoring 'drivers.add' hotplug event
Apr 12 10:51:37 fritz local0.debug hotplug: ignoring 'scsi_host.add' hotplug event
Apr 12 10:51:37 fritz local0.debug hotplug: loading sd_mod kernel module
Apr 12 10:51:37 fritz local0.debug hotplug: ignoring 'module.add' hotplug event
Apr 12 10:51:37 fritz local0.debug hotplug: ignoring 'drivers.add' hotplug event
Apr 12 10:51:42 fritz local0.debug hotplug: ignoring 'scsi.add' hotplug event
Apr 12 10:51:42 fritz local0.debug hotplug: ignoring 'scsi_disk.add' hotplug event
Apr 12 10:51:42 fritz local0.debug hotplug: starting hotplug chain 'block.add'
Apr 12 10:51:43 fritz local0.debug hotplug: starting hotplug chain 'block.add'
Apr 12 10:51:43 fritz local0.debug hotplug: ignoring 'scsi_device.add' hotplug event
Apr 12 10:51:43 fritz local0.debug hotplug: starting hotplug chain 'block.add'
Apr 12 10:51:43 fritz local0.debug hotplug: loading swap kernel module
Apr 12 10:51:43 fritz local0.err hotplug: modprobe: module swap not found
Apr 12 10:51:43 fritz local0.err hotplug: modprobe: failed to load module swap
Apr 12 10:51:43 fritz local0.debug hotplug: loading ext2 kernel module
Apr 12 10:51:43 fritz local0.info hotplug: activated swap on '/dev/sda1'
Apr 12 10:51:43 fritz local0.debug hotplug: ignoring 'module.add' hotplug event
Apr 12 10:51:43 fritz local0.debug hotplug: ignoring 'module.add' hotplug event
Apr 12 10:51:43 fritz local0.info hotplug: created mount point '/var/opt'
Apr 12 10:51:43 fritz local0.debug hotplug: m_fst=>ext2< m_src=>/dev/sda2< m_dst=>/var/opt< m_opt=>-o noatime,nodiratime<
Apr 12 10:51:44 fritz local0.debug hotplug: starting hotplug chain 'block.mount'
Apr 12 10:51:44 fritz local0.info hotplug: not starting any applications on '/var/opt'
Apr 12 10:51:44 fritz local0.info hotplug: mounted '/dev/sda2' on '/var/opt' with options 'noatime,nodiratime'
with out debug messages
Code:
Apr 12 10:51:37 fritz local0.info hotplug: attached device 'TrekStor - HS020GB '
Apr 12 10:51:43 fritz local0.err hotplug: modprobe: module swap not found
Apr 12 10:51:43 fritz local0.err hotplug: modprobe: failed to load module swap
Apr 12 10:51:43 fritz local0.info hotplug: activated swap on '/dev/sda1'
Apr 12 10:51:43 fritz local0.info hotplug: created mount point '/var/opt'
Apr 12 10:51:44 fritz local0.info hotplug: not starting any applications on '/var/opt'
Apr 12 10:51:44 fritz local0.info hotplug: mounted '/dev/sda2' on '/var/opt' with options 'noatime,nodiratime'
and a few other systems...
Code:
/var # lsmod
Module Size Used by Tainted: P
ext2 58194 1
mbcache 7035 1 ext2
sd_mod 17211 3
usb_storage 36164 2
scsi_mod 92657 2 sd_mod,usb_storage
userman 32623 2
wlan_scan_ap 11051 1
wlan_acl 4478 1
wlan_wep 6623 0
wlan_tkip 13986 2
wlan_ccmp 9315 1
wlan_xauth 1182 0
ath_pci 158200 0
ath_rate_atheros 29493 1 ath_pci
wlan 246993 9 wlan_scan_ap,wlan_acl,wlan_wep,wlan_tkip,wlan_ccmp,wlan_xauth,ath_pci,ath_rate_atheros
ath_hal 203744 3 ath_pci,ath_rate_atheros
ath_dfs 24350 1 ath_pci
avm_ath_extensions 28085 3 ath_pci,wlan,ath_hal
kdsldmod 882042 5 userman
musb_hdrc 35988 0
usbcore 126185 3 usb_storage,musb_hdrc
dect_io 21060 2
avm_dect 549025 1 dect_io
capi_codec 93998 0
isdn_fbox_fon5 764139 0
pcmlink 156761 3 avm_dect,capi_codec,isdn_fbox_fon5
dsl_ur8 166948 0
jffs2 115489 1
Piglet_noemif 21607 0
Code:
/var # ls -l /dev/sd*
brw-rw---- 1 root root 8, 0 Apr 12 10:51 /dev/sda
brw-rw---- 1 root root 8, 1 Apr 12 10:51 /dev/sda1
brw-rw---- 1 root root 8, 2 Apr 12 10:51 /dev/sda2
Code:
/var # cat /proc/partitions
major minor #blocks name
31 0 6725 mtdblock0
31 1 890 mtdblock1
31 2 64 mtdblock2
31 3 256 mtdblock3
31 4 256 mtdblock4
31 5 384 mtdblock5
8 0 19569312 sda
8 1 125936 sda1
8 2 19442688 sda2
Code:
/var # cat /proc/swaps
Filename Type Size Used Priority
/dev/sda1 partition 125928 0 -6
Code:
/var # mount
rootfs on / type rootfs (rw)
/dev/root on / type squashfs (ro)
dev on /dev type tmpfs (rw,nosuid)
proc on /proc type proc (rw,nosuid,nodev,noexec)
ramfs on /var type ramfs (rw)
sysfs on /sys type sysfs (rw,nosuid,nodev,noexec)
/dev/mtdblock5 on /data type jffs2 (rw)
ramfs on /data/tam/rec type ramfs (rw)
usbfs on /proc/bus/usb type usbfs (rw)
/dev/sda2 on /var/opt type ext2 (rw,noatime,nodiratime)