分类: LINUX
2011-10-04 07:46:18
Summary |
---|
Preventing the boot sequence printout from disappearing. |
Related |
After the boot process, the screen is cleared and the login prompt appears, leaving users unable to read init output and error messages. This default behavior may be modified using methods outlined in this article.
Note that regardless of the chosen option, kernel messages can be displayed for inspection after booting by using dmesg.
Contents []
|
This is basic management that applies to most terminal emulators, including virtual consoles (vc):
For a more permanent change, the following can be used to add a pause or wait for keypress while boot messages are still on the screen:
Add one of these to either the bottom of /etc/rc.local to pause when booting is finished, or the stat_fail() function in /etc/rc.d/functions to pause when a boot script in /etc/rc.d fails with an explicit error code. Note that the latter is a system script and may be overwritten when that file is updated. If you are unsure what this means, use /etc/rc.local.
Have boot messages stay on tty1Normal behaviour: Boot messages shoot past, screen is cleared, contents of /etc/issue are displayed, login (either CLI or login manager) is displayed.
Desired behaviour: Boot messages shoot past, login (either CLI or login manager) is displayed without clearing of tty1.
First you should know that screen may be cleared:
I.e. to force desired behavior you should eliminate one/all of the above factors.
Disable clearing by gettyIn /etc/inittab, you will find a list of numbered consoles which look something like the following; just scroll down in the file to find it. If you are using agetty or mingetty as getty, add the --noclear option for the first virtual console (the c1 line) only:
c1:2345:respawn:/sbin/agetty --noclear -8 38400 tty1 linux c2:2345:respawn:/sbin/agetty -8 38400 tty2 linux . . . Disable clearing in /etc/issue Disable displaying of /etc/issueAdd the --noissue option in /etc/inittab:
c1:2345:respawn:/sbin/agetty --noissue -8 38400 tty1 linuxAlternatively simply comment out the above line.
Give tty1 a custom /etc/issueCopy the existing /etc/issue file to /etc/issue.tty1 (without the first line):
sed 1d /etc/issue > /etc/issue.tty1Find this in /etc/inittab:
c1:2345:respawn:/sbin/agetty -8 38400 tty1 linuxReplace it with:
c1:2345:respawn:/sbin/agetty -8 38400 tty1 linux -f /etc/issue.tty1 Edit /etc/issue directlySimply cut the contents of the first line in /etc/issue so it looks like this:
Arch Linux \r (\n) (\l) Restoring /etc/issueThe characters cannot be just typed again into the file because they are special characters not available on your keyboard!
After you cut the contents from line 1 in /etc/issue, paste it into a temporary file somewhere on you computer so you can copy and paste it back into /etc/issue later when you wish to restore original functionality. You can also backup the whole /etc/issue somewhere safe and restore it when needed.
Optionally, if you are more advanced, you can follow special procedures for typing in these special characters:
Methods of placing literal escape characters are editor dependent. In :
ESC (exit insert mode) :r !clear :x (Save and Exit)This will insert the literal characters equivalent to the shell clear command. Optionally you can also insert the characters manually:
i (insert) ctrl-v (insert literal character) ESC (insert escape character) c ESC (exit insert mode) ZZ (Save and Exit)In :
C-q ESC (to insert literal escape)Or you could just extract it from core/filesystem.
See Also