LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This 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


Reply
  Search this Thread
Old 08-07-2004, 07:58 PM   #1
black hole sun
Member
 
Registered: Jul 2004
Distribution: Slackware Current
Posts: 127

Rep: Reputation: 15
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?
 
Old 08-07-2004, 08:12 PM   #2
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
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.
 
Old 08-07-2004, 08:23 PM   #3
black hole sun
Member
 
Registered: Jul 2004
Distribution: Slackware Current
Posts: 127

Original Poster
Rep: Reputation: 15
Quote:
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
 
Old 08-07-2004, 08:52 PM   #4
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
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.
 
Old 08-07-2004, 09:18 PM   #5
kevinalm
Member
 
Registered: Oct 2003
Location: Iowa
Distribution: LFS 5.0, building 6.3, win98se, multiboot
Posts: 288

Rep: Reputation: 30
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.
 
Old 08-07-2004, 09:43 PM   #6
Bruce Hill
HCL Maintainer
 
Registered: Jun 2003
Location: McCalla, AL, USA
Distribution: Arch, Gentoo
Posts: 6,940

Rep: Reputation: 129Reputation: 129
This is the entry in Mandrake's LiLO for the failsafe kernel:
Code:
image=/boot/vmlinuz
	label="failsafe"
	root=/dev/hdc8
	initrd=/boot/initrd.img
	append="failsafe acpi=ht resume=/dev/hda9 devfs=nomount"
	read-only
 
Old 08-07-2004, 10:13 PM   #7
kevinalm
Member
 
Registered: Oct 2003
Location: Iowa
Distribution: LFS 5.0, building 6.3, win98se, multiboot
Posts: 288

Rep: Reputation: 30
Ok, looks like mandrake uses "failsafe" as the keyword. Be warned that this is distro specific and highly variable.

Last edited by kevinalm; 08-07-2004 at 10:14 PM.
 
Old 08-08-2004, 12:33 PM   #8
Disillusionist
Senior Member
 
Registered: Aug 2004
Location: England
Distribution: Ubuntu
Posts: 1,039

Rep: Reputation: 98
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.
 
Old 08-08-2004, 12:51 PM   #9
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 356Reputation: 356Reputation: 356Reputation: 356
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.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
FDC3 only boots to grub prompt klnasveschuk Fedora - Installation 4 04-21-2005 09:57 AM
only boots in command prompt JoeUser11 Red Hat 3 01-10-2005 10:51 PM
Mandrake boots into command prompt instead of GUI DiscoBiscuit Linux - Newbie 12 05-30-2004 04:45 PM
Another boots into command prompt question Jhorra Mandriva 5 04-03-2004 01:53 AM
rh9 boots to grub> prompt only pvl Linux - Newbie 3 06-27-2003 11:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:13 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration