The udev init script is currently run before the bootmisc one. This means that if an "ADD" event for a block device happens _before_ the bootmisc script has terminated the content of /tmp will get deleted (bootmisc removes /tmp completely before creating a symlink to /var/tmp). This results in the /media/$name directory not being cleaned-up when the device is removed. To reproduce: - Start your device with a usb flash drive plugged in (on my system this usually yields to /media/sdb1 being created); - Once the system has finished booting, unplug the flash drive; - Look in /media, the sdb1 directory should still be there even if the drive was removed. What about creating a ram drive very early on boot? Just before udev would be a nice place.
Symlink /tmp to /var/tmp should be done in populate_volatiles.sh. So I would suggest delete it from bootmisc.sh, add it to /etc/default/volatiles/<config>. Let populate_volatiles.sh handle the details. Something like: --- a/meta/recipes-core/initscripts/initscripts-1.0/volatiles +++ b/meta/recipes-core/initscripts/initscripts-1.0/volatiles @@ -31,6 +31,7 @@ l root root 1777 /var/lock /var/volatile/lock l root root 0755 /var/log /var/volatile/log l root root 0755 /var/run /var/volatile/run l root root 1777 /var/tmp /var/volatile/tmp +l root root 1777 /tmp /var/tmp d root root 0755 /var/lock/subsys none f root root 0664 /var/log/wtmp none f root root 0664 /var/run/utmp none A related bug is Bug#3181.
One more problem: udev seems to have a high priority in initscripts that it does no deserve. The udev script states clearly that it needs 'mountvirtfs'. root@beagleboard:/etc/init.d# head udev #!/bin/sh ### BEGIN INIT INFO # Provides: udev # Required-Start: mountvirtfs # Required-Stop: # Default-Start: S # Default-Stop: # Short-Description: Start udevd, populate /dev and load drivers. ### END INIT INFO On the other hand, we can see mountall.sh which provides 'mountvirtfs' has a lower priority then udev. This should be fixed. root@beagleboard:/etc/rcS.d# ls -1 S00psplash.sh S02banner.sh S02sysfs.sh S03udev S04modutils.sh S06alignment.sh S07bootlogd S10checkroot.sh S35mountall.sh S37populate-volatile.sh S38devpts.sh S39alsa-state S39hostname.sh S40networking S43portmap S45mountnfs.sh S55bootmisc.sh udev should have a lower priority than mountall.sh and populate_volatiles.sh. Any suggestion would be welcome.
(In reply to comment #1) > Symlink /tmp to /var/tmp should be done in populate_volatiles.sh. So I would > suggest delete it from bootmisc.sh, add it to > /etc/default/volatiles/<config>. Let populate_volatiles.sh handle the > details. > Something like: > --- a/meta/recipes-core/initscripts/initscripts-1.0/volatiles > +++ b/meta/recipes-core/initscripts/initscripts-1.0/volatiles > @@ -31,6 +31,7 @@ l root root 1777 /var/lock /var/volatile/lock > l root root 0755 /var/log /var/volatile/log > l root root 0755 /var/run /var/volatile/run > l root root 1777 /var/tmp /var/volatile/tmp > +l root root 1777 /tmp /var/tmp > d root root 0755 /var/lock/subsys none > f root root 0664 /var/log/wtmp none > f root root 0664 /var/run/utmp none > > A related bug is Bug#3181. After a second thought, I realize that updating populate_volatile.sh script described in Bug#3181, together with the changes described above would solve this problem.
Blocked due to read-only rootfs support. (I'm somewhat confused about it, for the previous scripts don't support RO rootfs as well.)
merged into poky/master: 297906d39cfcaa56009214e8759b9853f82f02d7 http://git.openembedded.org/?p=openembedded-core.git&a=commit;h=12c4acd7ac5a27cf3676065b60f1c8395c96854c
Reopen this bug. Because if it's not first boot, /tmp has already been symlinked to /var/volatile/tmp which is not created when udev starts, resulting in touch /tmp/.automount-$name failed. I'll send out a patch to fix this problem soon. Mark the milestone to 1.5 since dylan has been released.
merged into poky/master: cab467dfd78e667775a3969350961358acf1daaf