Creating a kernel that boots STRAIGHT to command prompt?
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.
Creating a kernel that boots STRAIGHT to command prompt?
I'm running Fedora Core 2-Final and GRUB. I want a "failsafe" kernel that does not start X or any of the other fluff, just one that goes straight to a command prompt. How would I go about doing this?
Originally posted by Chinaman Edit the run level in your /etc/inittab file and the kernel doesn't matter. You can for sure
use run level 1 with most any distro.
Thanks but that file applies to all of my kernels, doesn't it? I'd like to have something like old Mandrake 10 had, a failsafe kernel that boots into a command prompt but the others auto-started X. Note that if this isn't possible, I'll live with it
Can you check the Feodra CDs for a directory named kernels, and see if there's
one in there? Otherwise, if you still have the Mandrake CDs, perhaps you could
use the failsafe kernel from there - or at least look at the configuration and make
your own for Fedora. I think you can edit grub and pass an option to the kernel
to boot linux single (user) or something like that. I don't know grub, never could
figure it out, so I use LiLO.
Distribution: LFS 5.0, building 6.3, win98se, multiboot
Posts: 288
Rep:
It isn't the kernel, it's the arguments passed to the kernel on the append line for lilo or on the kernel line for grub. Iirc it's either "single" or "runlevel=1", something along those lines. Actually, I always kept a rh8 cd #1 around for that purpose. Just booted into rescue. Now I use a customized RIP (Rescue Is Possible) boot cd.
As you are using GRUB as your boot manager it's quite easy to do what you want:
Edit the grob config file generally /boot/grub/menu.lst
WARNING THIS COULD BE DANGEROUS
Copy the lines for your standard kernel eg:
Code:
title linux
kernel (hd0,5)/boot/vmlinuz root=/dev/hda6 vga=0x317 hdd=ise-scsi hddlun=0 splash=silent showopts
initrd (hd0,5)/boot/initrd
Create a new entry for your special Run Level (add the option init 3) eg:
Code:
title test
kernel (hd0,5)/boot/vmlinuz root=/dev/hda6 vga=0x317 hdd=ise-scsi hddlun=0 splash=silent showopts init 3
initrd (hd0,5)/boot/initrd
WARNING THIS COULD BE DANGEROUS
If you have an administrative tool for editing the Boot Configuration I strongly suggest you use it instead of hacking the text file.
Having made the changes above you can choose Testing as the image to load at boot time and it will stop at a login prompt at run level 3 (There are more run levels that 1 - Single User and 5 - Graphical Mode!)
If this all works out you can even make it your default image.
The easy option (assuming you don't want this as your default image, would be to type:
init 3 when given the option of which kernel to load.
According to the Grub Manual, grub allows one to create a text configuration file which can be referenced in the kernel line of grub.conf (or /grub/menu.lst if that's what you use), specifying any boot options you need. The only requirement is that the text file is referenced AFTER the kernel: something like kernel=/boot/vmlinuz <filename>.
However, the manual does not give any examples of the text file, or how to refer to it in the kernel line.
Using such an option may be just what you need.
After doing a little google research, I find that the command is 'configfile file', where configfile is the command, and file is the name of the file.
Last edited by bigrigdriver; 08-08-2004 at 12:55 PM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.