Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/1] Bug in the boot process using mdev
@ 2011-07-03 10:47 Luca Ceresoli
  2011-07-03 10:47 ` [Buildroot] [PATCH 1/1] Fix boot with mdev Luca Ceresoli
  2011-07-04  6:54 ` [Buildroot] [PATCH 0/1] Bug in the boot process using mdev Thomas Petazzoni
  0 siblings, 2 replies; 4+ messages in thread
From: Luca Ceresoli @ 2011-07-03 10:47 UTC (permalink / raw)
  To: buildroot

Hi,

I ran into trouble when trying to activate mdev in buildroot.
The symptoms were amazing, but I won't delight you with them.
I'll report my analysis of the cause and a solution instead.

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

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/null does 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.

The result is that some of these processes may spit out weird error messages on
the console, and some will fail.
I didn't go further down on this, but on some tests I got a system without mdev
working and with a /dev/null created as a regular file -- not as a char device.

The story is long, but the solution is actually simple, as you can see in the
patch: just create the /dev/null character device in the target root filsystem,
so it is there also before mdev starts.

I sould not test udev, but it should have the same problem, and the same
solution should work.

Luca

Luca Ceresoli (1):
  Fix boot with mdev

 target/generic/Config.in                    |    2 +-
 target/generic/device_table_dynamic_dev.txt |   10 ++++++++++
 2 files changed, 11 insertions(+), 1 deletions(-)
 create mode 100644 target/generic/device_table_dynamic_dev.txt

-- 
1.7.4.1

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-07-04  9:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-03 10:47 [Buildroot] [PATCH 0/1] Bug in the boot process using mdev Luca Ceresoli
2011-07-03 10:47 ` [Buildroot] [PATCH 1/1] Fix boot with mdev Luca Ceresoli
2011-07-04  6:54 ` [Buildroot] [PATCH 0/1] Bug in the boot process using mdev Thomas Petazzoni
2011-07-04  9:04   ` Luca Ceresoli

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox