Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
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.
I use GRUB as bootloader and the kernel used is 2.4.19-mdk.
The line in GRUB bootloader reads:
title Test pivot_root
root (hd0,0)
kernel /boot/vmlinuz-2.4.19-mdk root=/dev/ram0 rw init=/linuxrc vga=4
initrd /boot/r2initrd.img
As far as I know, GRUB doesn't have a config file like Lilo ( which I know little of )
When I removed the command line entries
root=/dev/ram0 rw init=/linuxrc
linuxrc gets PID != 1 ( it gets 8, after kswapper etc,etc ).
Then /sbin/init would not behave....
You can use a copy of init ( such as /sbin/init2 ) as has been previously suggested by others and then kernel ? doesn't care if it does not run with PID==1.
Thanks for your advice regarding abiity to edit the post - very handy indeed..
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771
Rep:
You kick a**, buddy. Here's to a hero.
GRUB does have a bootloader conf file and it is usually /boot/grub/menu.lst Some distros symlink this file to /etc/grub.conf. The advantage with GRUB is that you dont have to _remember_ to run the map installer to 'apply' your changes.. not to mention the fact that it is filesystem aware and lets you choose your kernel at runtime.
Quote:
You can use a copy of init ( such as /sbin/init2 ) as has been previously suggested by others and then kernel ? doesn't care if it does not run with PID==1.
Would you elaborate on what you've said there? Are you saying that the copy of init doesn't care if it is PID 1?
if you use /sbin/init , the PID ( of linuxrc) must be 1, and since it is going to be 'exec'ed , the PID will be passed to the chroot process.
But if you named /sbin/init as /sbin/ini2 < or whatever> , then ( for reasons unkown to me ) , it ( linuxrc) doesn't have be PID == 1 , the only proviso is that you have to pass /sbin/init2 < orr whatever > the "Q" or "q" paramater.
the kernel command line root=/dev/ram0 rw init=/linuxrc has the effect of setting the PID linuxrc to 1., according to the forum posts.
Distribution: Red Hat 8.0, Slackware 8.1, Knoppix 3.7, Lunar 1.3, Sorcerer
Posts: 771
Rep:
AHA. That clears it up a bit. I still have questions, but I'll have to dig in to the sources of sysvinit to clear them up, I guess.
/sbin/telinit is a symlink to /sbin/init . They are calling the same binary which behaves one way or the other depending on
1) the command line ( argv[0])
2) $pid of the process
When you name the binary a third name other than 'init' or 'telinit' ( init2 or similar ), it disregards the condition 2 above is my blind conclusion. As I said, the source should answer it for sure.
I took a break from this and have fiddled with it for the last week.
Actually, the latest kernel (2.4.22) has support for Linux software RAID for the highpoint cards. So I just included it in the kernel and I didn't have to deal with pivot_root. Unfortunately, it doesn't support RAID 5, which is what I wanted it to do. So I was back to where I started... Grrr...
I didn't want to use GRUB because I'm old and fear change. I found a link that completely skips the pivot_root call and it worked 100% for me!
I'm surprised it worked, actually. You specify initrd=/path/to/initrd.gz but you specify root=/dev/sda1 (your actual root drive) rather than /dev/ram0. LILO is smart enough to mount your initrd and then pivot(?) to the real drive. Problem solved.
This was nice and easy and rather anti-climactic.
This thread worked out rather well. Anyone with pivot_root problems can pretty much come here and their problems will be fixed. If not, we're all a lot more experienced now and can help them out!
I'm using LILO 22.5.7.2. I recommend upgrading if you use this solution.
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.
Errr, wow, this is an old thread. I've had three kids since my last post in '03!
Honestly, I can't remember much about the initrd. I typed initrd into google and got a bazillion hits. If nothing there suits you, post again and we'll take a look at your specific problem.
Errr, wow, this is an old thread. I've had three kids since my last post in '03!
Honestly, I can't remember much about the initrd. I typed initrd into google and got a bazillion hits. If nothing there suits you, post again and we'll take a look at your specific problem.
Hans
Actually I do not want to waste time of a lot of people in reading a new thread which had already been answered as per my requirements and what I asked is similar to this one now coming the point
I was trying to modify the init script inside the initrd that is present on ISO of linux distros which invokes the linuxrc to mount the CDROM and does a pivot_root for installation since I am trying to learn from my experiments so I needed some link where I can get a sample init which invokes linuxrc that I actually wanted as reference material to study I had done a good amount of googling this is the reason why I posted on such an old thread and searched on forums might be I went in some wrong direction. http://www.mjmwired.net/kernel/Docum...tramfs.txt#252
I read this link and want to proceed accordingly so a sample linuxrc or init would help.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.