Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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
Yes Actually what I did was
#gzip -dc initrd | cpio -id
so I got a directory that had a lot of files which I could modify including the init script but the only problem I faced was init was executable can I get the source code of this init script which actually does a pivot_root to mount the ISO to start the installation for any distribution fedora ,debian or suse etc etc any one
Ok am not able to get ur query properly still.
U want to edit linuxrc ? U can directly edit it since its a shell script [and not an exe].
Or can u post the list of files in ur initrd and as to which file u need the source for..
Yes you got it exactly but when I tried to edit that it was an executable ELF 32 bit some thing like that which was not opening in vi properly so I posted this question. So I feel If I get the source code then that would help me either of init or linuxrc
initrd.img of your system is created by mkinitrd command.
This command comes as a part of mkinitrd package.
In your Fedora PC try
$ rpm -qi mkinitrd
This will give your the rpm version.
Download the corresponding source rpm and this should have all your source files that are used to created the initrd image.
The kernel rpm runs the mkinitrd command before installing kernel to create the initrd file system. Happy tinkering ...
And one thing you may like to know [if u dont know already]
In a fedora,redhat box if u need source for any file ,
check which package the file belongs to
$ rpm -qif <filename>
Download the corresponding source rpm and installing this rpm should give you the source code.
[Default the source falls into /usr/src/redhat/SOURCES directory ]
The kernel rpm runs the mkinitrd command before installing kernel to create the initrd file system. Happy tinkering ...
But what about the initrd that is present on the dvd or cd that comes for installation is it also created by the same command which I don't think so
since I have checked both the initrd on cd and the one in boot folder the one installed has only the modules that are required for booting the system appropritately with the lini to script init that reads some where /etc/rc.S or inittab files and in case of the init on the dvd it should be different
since the fstab entries are to be different for installing the system
Quote:
Originally Posted by zulfilee
$ rpm -qif <filename>
[Default the source falls into /usr/src/redhat/SOURCES directory ]
Ok I really did not knew this thing I am gonna try this and tell the result.
Ok by now I have checked as per said I downloaded mkinitrd-6.0.9-5.src.rpm
sysvinit-2.86 src rpm and installed which gave bz2 and tar files in /usr/src/redhat/SOURCES directory that I had to manually extract
there was an mkinitrd script which had functions named findnetdriver(),handlenetdev(),to me the interesting part started from line number 1209 where the script started building the filesystem
vecho "Building initrd in $MNTIMAGE"
this was the line after which I guess it starts making the initrd but here what I saw it took the entries from /etc/fstab which I think should not be done because when you start installation from CDROM it does not have any entries in /etc/fstab except the ones like proc etc
some lines I am copy pasting line no 1249
===================================
mkdir $MNTIMAGE/dev/mapper
mknod $MNTIMAGE/dev/ram0 b 1 0
mknod $MNTIMAGE/dev/ram1 b 1 1
ln -sf ram1 $MNTIMAGE/dev/ram
mknod $MNTIMAGE/dev/null c 1 3
mknod $MNTIMAGE/dev/zero c 1 5
mknod $MNTIMAGE/dev/systty c 4 0
if ! echo "$(uname -m)" | grep -q "s390"; then
for i in 0 1 2 3 4 5 6 7 8 9 10 11 12 ; do
mknod $MNTIMAGE/dev/tty$i c 4 $i
done
fi
for i in 0 1 2 3 ; do
mknod $MNTIMAGE/dev/ttyS$i c 4 $(($i + 64))
done
mknod $MNTIMAGE/dev/tty c 5 0
mknod $MNTIMAGE/dev/console c 5 1
mknod $MNTIMAGE/dev/ptmx c 5 2
mknod $MNTIMAGE/dev/rtc c 10 135
if [ "$(uname -m)" == "ia64" ]; then
mknod $MNTIMAGE/dev/efirtc c 10 136
fi
=============================================
and there onwards it gives all the messages like loading drivers etc but the linuxrc part that I had been searching is missing here
now what next should I try.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.