Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

adding linuxrc to initrd

9 views
Skip to first unread message

Velocity

unread,
Oct 23, 2007, 1:51:13 AM10/23/07
to
I need some help in modifying the initrd on installation DVD of one of
the distributions it does not have the linuxrc script by the same name
rather it has linuxrc.conf file
and an init script which I guess is the same as the linuxrc because
without it I can not start installation ,I would like to know how to
create a initrd file that has linuxrc also if some one can point to
sample linuxrc
and any documentation for making initrd from scratch (ex busybox etc)
not from the mkinitrd script that works that would be great.


as on man pages of initrd
http://www.netadmintools.com/html/initrd.man.html


What I understood is executable /linuxrc determines what is needed to
(1) mount the normal root file-system (i.e. device type, device
drivers, file system) and (2) the distribution media (e.g. CD-ROM,
network, tape, ...). This can be done by asking the user, by auto-
probing, or by using a hybrid approach.

I want to be able to create an initrd which I can give to my friend
who can start installation from it . by mounting root on cd or dvd
etc. Starting from scratch.

Jan Kandziora

unread,
Oct 23, 2007, 6:29:06 AM10/23/07
to
Velocity schrieb:

> What I understood is executable /linuxrc determines
>

Well, actually, no. /linuxrc is just the first executable startet in the old
(mountable filesystem) version of initrd.

Newer kernels (don't remember exactly when the transistion was) need an
initramfs (cpio archive) initrd and start /init inside that initrd instead
of /linuxrc. /init usually is a shell script resembling the contents of the
old /linuxrc.


>
> I want to be able to create an initrd which I can give to my friend
> who can start installation from it . by mounting root on cd or dvd
> etc. Starting from scratch.
>

Well, the initrd from the installation DVD achieves exactly that. If you
want to build a similar thing from scratch, why don't you just investigate
it further? If you just want to add own startup code to the initrd, add
a "vendor_init.sh" file to it and make it executable.

If you want to create an initrd from scratch, you need an /init executable
(may be a shell script), a shell if you want to execute any shell script
(of course), kernel modules, the "insmod" executable, and an executable
which does the pivot_root() system call and calls init at the end of
the /init script, this is e.g. bin/run-init from the installation DVD, but
the "pivot_root" command will work, too.

You may put all these components into the base directory of the initrd for
simplicity reasons.

Kind regards

Jan

Velocity

unread,
Oct 25, 2007, 9:09:55 AM10/25/07
to

> If you want to create an initrd from scratch, you need an /init executable
> (may be a shell script), a shell if you want to execute any shell script
> (of course), kernel modules, the "insmod" executable, and an executable
> which does the pivot_root() system call and calls init at the end of
> the /init script, this is e.g. bin/run-init from the installation DVD, but
> the "pivot_root" command will work, too.
>
> You may put all these components into the base directory of the initrd for
> simplicity reasons.


Thanks a lot you again got exactly what I needed. To do this /init
executable do I need a busybox to statically link the executables with
the script.

0 new messages