Bug in the boot process using mdev
Get series with b4
b4 am 20110704085419.47aa9b62@skateVersions newest first
- v1 Latest0 of 1 patch 0 repliesNew
Patches in v1 No applies recorded yet
The patch the cover letter announces is not in this archive.
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [Buildroot] [PATCH 0/1] Bug in the boot process using mdev
Hello Luca,
Le Sun, 3 Jul 2011 12:47:57 +0200,
Luca Ceresoli <[email protected]> a ?crit :
Quoted 12 lines
The init process I use is busybox's init, with the inittab that comes with buildroot. This starts with:
# Startup the system
null::sysinit:/bin/mount -t proc proc /proc
null::sysinit:/bin/mount -o remount,rw /
null::sysinit:/bin/mkdir -p/dev/pts
null::sysinit:/bin/mount -a
null::sysinit:/bin/hostname -F/etc/hostname# now run any rc scripts ::sysinit:/etc/init.d/rcS
Quoted 8 lines
Busybox init takes the first field, adds "
/dev/" in front if it and uses the result as the input and output device the the process to be launched. This is normally used for ttys, but in this case the processes will read from and write to/dev/null.Alas,
/dev/nulldoes not exist when the first few "sysinit" lines are executed, since it will be created by mdev, which in turn will be launched only by rcS, in the last of the cited inittab lines.
I initially implemented mdev support as you proposed, with a separate static device table for the few device nodes that are mandatory to get the system up to a point where mdev can be started.
However, after discussions on the list, we decided that both our mdev and udev configurations should rely on devtmpfs. So when the mdev or udev mechanisms are selected in Buildroot configuration, we assume that devtmpfs will be mounted in /dev at boot time.
This is automatically ensured when Buildroot is responsible for building the kernel. See linux/linux.mk :
ifneq ($(BR2_ROOTFS_DEVICE_CREATION_STATIC),y)
$(call KCONFIG_ENABLE_OPT,CONFIG_DEVTMPFS,$(@D)/.config)
$(call KCONFIG_ENABLE_OPT,CONFIG_DEVTMPFS_MOUNT,$(@D)/.config)endif
However, if you build your kernel separately, then indeed, it's your responsibility to make sure that DEVTMPFS and DEVTMPFS_MOUNT are enabled.
This is probably a requirement that should be better documented, at least in the static/devtmpfs/mdev/udev configuration option help.
Regards,
Thomas
Signature · 4 lines
Thomas Petazzoni, Free Electrons Kernel, drivers, real-time and embedded Linux development, consulting, training and support. http://free-electrons.com