Re: How loader2 create ide/scsi device node file?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2006-05-26 at 14:38 +0800, Levin Du wrote:
>  init will create some basic devices such as console, ttys, fb 
> etc, 
Yes.  These are, as you mention, created by Anaconda's hacked init, out
of the full chart hardcoded in the devnodes[] array.

> but no device files of hard disks or floppy. 
> And I look into loader2. Loader2 will load all the require modules. Yet I 
> cannot find code creating those block device files.
> 
> Would anyone kindly point it out for me?
See devMakeInode in isys/devNodes.c.  You'll see references to 's' 'd'
and 'h' 'd' and so forth.  This is called from makeDevInode, in
isys/isys.c.

The code that you want is in iutil.py:

>     hardDrives = isys.hardDriveDict()
>     for drive in hardDrives.keys():
>         if drive.startswith("mapper"):
>             continue
>         isys.makeDevInode(drive, "/dev/%s" % (drive,))
> 
>         if drive.startswith("hd"):
>             num = 32
>         elif drive.startswith("dasd"):
>             num = 4
>         else:
>             num = 15
> 
>         if (drive.startswith("cciss") or drive.startswith("ida") or
>             drive.startswith("rd") or drive.startswith("sx8")):
>             sep = "p"
>         else:
>             sep = ""
> 
>         for i in range(1, num):
>             dev = "%s%s%d" % (drive, sep, i)
>             isys.makeDevInode(dev, "/dev/%s" % (dev,))

I hope this helps you understand the source code.

--Steven



[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux