Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 107258 - Pre-creation of /sys should be noted in diskless boot for 2.6+ kernels
Summary: Pre-creation of /sys should be noted in diskless boot for 2.6+ kernels
Status: RESOLVED FIXED
Alias: None
Product: [OLD] Docs-user
Classification: Unclassified
Component: Other (show other bugs)
Hardware: All Linux
: High critical (vote)
Assignee: Jan Kundrát (RETIRED)
URL: http://www.gentoo.org/doc/en/diskless...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-26 02:44 UTC by Rabbe Fogelholm
Modified: 2005-12-19 04:59 UTC (History)
3 users (show)

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 Rabbe Fogelholm 2005-09-26 02:44:31 UTC
"Diskless Nodes with Gentoo", September 16, 2005 version:

Code listing 2.13 says to create certain directories in the slave filesystem.
The directory /sys must be added here.

(Failure to include /sys causes a boot screen warning, and the boot process
hangs. The hang occurs a couple of lines after the warning for missing /sys.)
Comment 1 SpanKY gentoo-dev 2005-09-26 05:45:44 UTC
not really

if your system is hanging at boot, it's unrelated to /sys

this feature is completely optional in Gentoo
Comment 2 Rabbe Fogelholm 2005-09-27 06:45:55 UTC
I went back and double-checked what difference pre-creation of /sys makes. My
setup is a DHCP/TFTP/NFS server and a diskless node on a private network
(Pentium-III boxes, one of them with a PXE NIC). I have tried to set up
everything as simple as possible, following the x86 Quick Install Guide and the
Diskless Nodes with Gentoo guide.

I have a script that creates the /diskless/192.168.1.21/ tree from scratch. When
I exclude creation of /diskless/192.168.1.21/sys I get the following screen
messages on the diskless node trying to boot:

* Mounting proc at /proc ...
* No /sys to mount sysfs needed in 2.6 and later kernels!
* Mounting /dev for udev ...
* Configuring system to use udev ...
*   Populating /dev with device nodes ...
*   Setting /sbin/udevsend as hotplug agent ...
* Mounting devpts at /dev/pts ...
* Activating (possible) swap ...
* Remounting root filesystem read/write ...
* Setting hostname to h21 ...
* Calculating module dependencies ...
* Mounting local filesystems ...
* Activating (possibly) more swap ...
* Setting system clock to hardware clock [Local Time] ...
* Caching service dependencies ...

After that point the diskless machine hangs. It responds to ping but not ssh
(sshd would be started in the default runlevel).

Regenerating the /diskless/192.168.1.21/ tree with /diskless/192.168.1.21/sys
cures the problem: bootup completes and I get a login prompt on the console.

It is interesting to note that the second message above (No /sys ..) is now
replaced by

* Mounting sysfs at /sys

The messages are issued by /sbin/rc. From looking at the code I get the
impression that the "happy case" occurs when /sys is present.
Comment 3 SpanKY gentoo-dev 2005-09-27 07:41:38 UTC
that looks like some dependency on the utils (prob udev/hotplug ?) which search
for sysfs or some device node

no way to say for sure w/out being able to debug it locally ... if you added a
call to startup sshd in the boot runlevel you could probably ssh in and find out
whats up
Comment 4 Rabbe Fogelholm 2005-10-21 08:16:12 UTC
(In reply to comment #3)
> that looks like some dependency on the utils (prob udev/hotplug ?) which search
> for sysfs or some device node
> 
> no way to say for sure w/out being able to debug it locally ... if you added a
> call to startup sshd in the boot runlevel you could probably ssh in and find out
> whats up

I still think that the "Diskless Nodes with Gentoo" should advise to pre-create
/sys, unless there is some reason where it would actually be harmful. I took me
considerable effort to carefully test the two scenarios on a minimal system:
with /sys pre-created, and without. In the latter case bootup fails as described
in Comment #2.

It may of course be argued that there is some different underlying problem and
that we should sort that out instead. But in the meantime my suggestion is to
accept pre-creation of /sys as a solution for now, and then optionally file
another bug reporting that diskless boot fails if /sys is not pre-created even
though it ought to work (I am not claiming that but someone might). Then when
that bug is solved the document may again be adjusted, removing the advice to
pre-create /sys.

IMHO, with the current version (6th October 2005) of the Diskless Nodes paper
everyone is likely to run into this problem.
Comment 5 Jan Kundrát (RETIRED) gentoo-dev 2005-12-19 04:59:53 UTC
Well, from the docs-team POV:

I've added the mkdir call for the /sys directory, but if its lack stops the boot process, you should bug baselayout folks. Please open separate bugreport for the maintainer of apropriate init script.