1827294 Members
3337 Online
109717 Solutions
New Discussion

Re: ioinit explained?!

 
Max_4
Frequent Advisor

ioinit explained?!

Hi!

I am trying to understand the process that the system goes through to install new devices by itself. Please correct me:

In major steps:

1)Kernel loaded using info in LIF entries on boot dev.
2)Kernel forks init.
3)init executes boot* entries
4)init executes sysinit entries
And then, the line of interest:
ioin::sysinit:/sbin/ioinitrc > /dev/console 2>&1

And then this is what ioinit(1M) says:

"...where ioinitrc is a script to invoke ioinit with the -i and -r options. Given the -i option, ioinit checks consistency between the
kernel I/O data structures (initialized with /stand/ioconfig, which is accessible for NFS-diskless support when the system boots up) and information read from /etc/ioconfig. If these are consistent, ioinit invokes insf to install special files for all new devices. If the kernel is inconsistent with /etc/ioconfig, ioinit updates /stand/ioconfig from /etc/ioconfig, and, if the -r option is given, reboots the system...."

And then to confuse things a little bit further for me, an excerpt from the comments in /sbin/ioinitrc:
"
#...
# invoke ioinit to compare /stand/ioconfig with /etc/ioconfig,
# and to create new device files (if needed).
"

Please check this part carefully:

ioinit -i checks consistency between kernel io_tree data structures and /etc/ioconfig, but it happens to be that io_tree was initialized using info in /stand/ioconfig which happens to be identical (in a good running system) to /etc/ioconfig!? Then where is the part when io_tree is updated with new devices that have just been plugged into the system?

This is my guessed explanation:

io_tree as the man says is initialized using /stand/ioconfig then *some* (unexplained on man) process (I guess) should update io_tree with the new devices, after that it (ioinit) does *some* consistency checks (also not documented on man) between kernel io_tree data structure and /etc/ioconfig, if successful then ioinit invokes insf on the new entries (the entries that are different comparing to /etc/ioconfig) reported in io_tree, insf subsequently updates both ioconfig (under /stand and /etc) files.

Am I correct?
What am I missing?
What does the consistency checks (io_tree versus /etc/ioconfig) mainly consist of?
HOW and When does io_tree gets updated with new entries after being initialized with /stand/ioconfig?

Thanks a lot in advance

4 REPLIES 4
Sridhar Bhaskarla
Honored Contributor

Re: ioinit explained?!

Hi,
//Then where is the part when io_tree is updated with new devices that have just been plugged into the system?//

If I am correctly interpreting your question, 'ioscan' is the command that finds the new devices and 'insf' is the command that installs special files. Both these commands update the io_tree as well 'ioconfig' files.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Max_4
Frequent Advisor

Re: ioinit explained?!

Yep... I know that ioscan updates io_tree, but the thing is that at least the man pages don't say or imply completely the following:

io_tree initialized with /stand/ioconfig, then !!****ioinit runs ioscan****!! updates io_tree, and then ioinit checks consistency between /etc/ioconfig and io_tree, then if OK ioinit sees that there are new entries in io_tree that differ from /etc/ioconfig then ioinit invokes insf on these new entries.

I don't know if I am making myself clear. I'd like to know how the system installs new devices by itself, at the early stages of booting after connecting a new device.

How does the system knows it has a 'new device' and therefore needs to run insf? As I said if io_tree is initialized with /stand/ioconfig and since /stand/ioconfig records the devices known to the system ***before*** turning off the system and plugging the new device, ***how*** and ***when*** does io_tree gets updated with the new devices during boot stage after new devices have been plugged in?

I wanna know the whole story... ;)

Thanks a lot in advance...
Max_4
Frequent Advisor

Re: ioinit explained?!

Could any other expert share his/her knowledge on this subject?

Thank you very much in advance, to anyone who is kind enough to take his/her time to bring some light on my doubts. I really appreciate this.

Max
Ivajlo Yanakiev
Respected Contributor

Re: ioinit explained?!

Every time when server boot it start insf -e which recreate /dev/*
O/S do not know that there is new device.
It do it every boot time :)