initramfs should not rely on /dev existing after init-bottom

Bug #6696 reported by Martin Kreiner
8
Affects Status Importance Assigned to Milestone
initramfs-tools (Ubuntu)
Fix Released
Low
Adam Conrad
udev (Ubuntu)
Invalid
Medium
Unassigned

Bug Description

initramfs's "init" calls the "init-bottom/udev" script:

[ "$quiet" != "y" ] && log_begin_msg "Running /scripts/init-bottom"
run_scripts /scripts/init-bottom
[ "$quiet" != "y" ] && log_end_msg

"init-bottom/udev" moves the real filesystem's "/dev" away:

mount -n -o move /dev ${rootmnt}/dev

so update_progress() called by log_end_msg() will not succeed:

echo "PROGRESS_STATE=${PROGRESS_STATE}" > /dev/.initramfs/progress_state

the directory "/dev/.initramfs" does not exist any more.
furthermore it's a bad idea to move "/dev" away because other scripts in "/scripts/init-bottom" may depend on device files.

i suggest cutting this mount call and pasting it to initramfs's "init" file:

# Move virtual filesystems over to the real filesystem
mount -n -o move /sys ${rootmnt}/sys
mount -n -o move /dev ${rootmnt}/dev # <---
mount -n -o move /proc ${rootmnt}/proc

so the initramfs-tools package would be affected to.

martin

-- package information:
udev-079-0ubuntu3
initramfs-tools-0.40ubuntu13

Revision history for this message
Scott James Remnant (Canonical) (canonical-scott) wrote :

This is deliberate, it means that udev's behaviour is entirely self-contained within the files supplied by the udev package.

The introduction of the /dev/.initramfs is recent (within the last few days) and incorrect ... nothing after init-bottom should rely on /dev existing.

Scripts in init-bottom should use the existing ordering to ensure they are run *before* udev is tidied away.

Changed in udev:
status: Unconfirmed → Rejected
Changed in initramfs-tools:
assignee: nobody → adconrad
Revision history for this message
Adam Conrad (adconrad) wrote :

initramfs has been checking for the existance of its private directory for a while now, so this bug is fixed, just never got to closing it.

Changed in initramfs-tools:
status: Unconfirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.