Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 211827 - mdev-start.sh should create /dev/null
Summary: mdev-start.sh should create /dev/null
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Embedded Gentoo Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-28 19:45 UTC by Ed Wildgoose
Modified: 2008-04-20 01:17 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Wildgoose 2008-02-28 19:45:35 UTC
In /lib/rcscripts/addons/mdev-start.sh, function seed_dev(), we need to create /dev/null or else it's not available for use elsewhere in the startup scripts.  

Now, most of the current scripts supplied with baselayout, *just about* scrape by without tickling this (although you can see on the lines below my ammendments  that you would tickle a bug just by having a dev overlay, see the "> /dev/null" ?).  But not having /dev/null makes writing all scripts rather tricky and it hits a lot of areas, for example any mdev scripts would also need to avoid using /dev/null (quite a pain)

What is happening is that any use of > /dev/null creates a real file in that dir and "mdev -s" doesn't then overwrite this with a proper character device, leading to a broken system

Patch is simple and below, grateful if someone could apply it:

--- mdev-start.sh.old   2008-02-28 19:35:03 +0000
+++ mdev-start.sh       2008-02-28 19:36:09 +0000
@@ -33,6 +33,9 @@
        [ ! -c /dev/console ] && mknod /dev/console c 5 1
        [ ! -c /dev/tty1 ] && mknod /dev/tty1 c 4 1

+       # Create /dev/null to be able to use it in startup and mdev scripts
+       [ ! -c /dev/null ] && mknod /dev/null c 1 3
+
        # copy over any persistant things
        if [ -d /lib/mdev/devices ] ; then
                cp --preserve=all --recursive --update /lib/mdev/devices/* /dev 2>/dev/null
Comment 1 SpanKY gentoo-dev 2008-04-20 01:17:32 UTC
fixed in the tree