Tar output mode for installworld
Ulrich Spoerlein
uspoerlein at gmail.com
Wed Jul 18 17:13:37 UTC 2007
On Tue, 17.07.2007 at 13:00:20 -0700, Matthew Dillon wrote:
> Probably the best way to do this is to pre-cache the data with an
> /etc/rc.d script. Write a little program to do it or build it as a
> script. Inode numbers for files on a CD tend to reflect the location
That is an interesting project in itself. This could be used to speed up
the boot process on any FreeBSD installation and I think MacOS' new init
system is where I got the idea from.
What I envisioned (quick n dirty):
- Init runs rc inside a ktrace session
- after the rc scripts have finished, you turn off ktrace
- kdump and read all files which were read during rc[2]
- do some magic to sort the list based on their hard disk location
- put this list in /var/db/precache.db
- /etc/rc.d/precache (which will run very early[1]):
(for file; cat $file >/dev/null)&; sleep 3
yes, it will be run in the background
Problems with this naive approach: It reads entire files, not blocks.
The filelist has to be kept small and only "small" files should appear
in the list. With direct kernel support one could do a lot more, I
guess.
I'm running on a fast laptop with a crappy 4800RPM hard disk which is
dog slow. I have the feeling my bootup time could be reduced drastically
by this approach. Perhaps some day I get around to prototyping it.
[1] I know this is hard to decide.
[2] To make this self-tuning, the output of the precache script must not
appear in the ktrace/kdump list.
Cheers,
Ulrich Spoerlein
--
"The trouble with the dictionary is you have to know how the word is
spelled before you can look it up to see how it is spelled."
-- Will Cuppy
More information about the freebsd-hackers
mailing list