“UbuntuHelp:BootText”的版本间的差异
来自Ubuntu中文
小 |
小 |
||
(未显示2个用户的9个中间版本) | |||
第2行: | 第2行: | ||
{{Languages|UbuntuHelp:BootText}} | {{Languages|UbuntuHelp:BootText}} | ||
This will not give you a splash image or hide the boot text. It will only make it look better. | This will not give you a splash image or hide the boot text. It will only make it look better. | ||
− | |||
== Increase resolution == | == Increase resolution == | ||
Edit /boot/grub/menu.lst | Edit /boot/grub/menu.lst | ||
第8行: | 第7行: | ||
gksudo gedit /boot/grub/menu.lst | gksudo gedit /boot/grub/menu.lst | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
Add <code><nowiki>vga=792</nowiki></code> to your default boot option. | Add <code><nowiki>vga=792</nowiki></code> to your default boot option. | ||
− | |||
Example: | Example: | ||
<pre><nowiki> | <pre><nowiki> | ||
第20行: | 第17行: | ||
boot | boot | ||
</nowiki></pre> | </nowiki></pre> | ||
− | + | Usual VESA video modes is (VGA codes): | |
+ | <pre><nowiki> | ||
+ | # 640×480 800×600 1024×768 1280×1024 1600×1200 | ||
+ | # 8 bits vga=769 vga=771 vga=773 vga=775 vga=796 | ||
+ | #16 bits vga=785 vga=788 vga=791 vga=794 vga=798 | ||
+ | #32 bits vga=786 vga=789 vga=792 vga=795 vga=799 | ||
+ | </nowiki></pre> | ||
== Colorize "[ ok ]" == | == Colorize "[ ok ]" == | ||
− | |||
'''NOTE : does not work with 5.10 Breezy. Use solution given [http://www.ubuntuforums.org/showpost.php?p=395004&postcount=37 there].''' (ed. 28/12/2005) | '''NOTE : does not work with 5.10 Breezy. Use solution given [http://www.ubuntuforums.org/showpost.php?p=395004&postcount=37 there].''' (ed. 28/12/2005) | ||
− | + | '''EDIT : This does NOT work with the default Feisty install, it will break your boot and you will need a rescue CD to fix it, until further revised, do NOT use this on Feisty. | |
+ | '''(omegabeta 01,aug,07. | ||
+ | '''NOTE : This does not work in Dapper either, so I am not sure what version this how-to is written for. For Dapper see below.''' | ||
We make the "[ ok ]" during bootup green | We make the "[ ok ]" during bootup green | ||
− | |||
* Edit /lib/lsb/init-functions | * Edit /lib/lsb/init-functions | ||
<pre><nowiki> | <pre><nowiki> | ||
gksudo gedit /lib/lsb/init-functions | gksudo gedit /lib/lsb/init-functions | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
* Find the log_end_msg () function, all the way at the bottom of the file and add <code><nowiki>GREEN=`$TPUT setaf 2`</nowiki></code> below <code><nowiki>RED=`$TPUT setaf 1`</nowiki></code> | * Find the log_end_msg () function, all the way at the bottom of the file and add <code><nowiki>GREEN=`$TPUT setaf 2`</nowiki></code> below <code><nowiki>RED=`$TPUT setaf 1`</nowiki></code> | ||
* Change <code><nowiki>echo "$UP$END[ ok ]"</nowiki></code> to <code><nowiki>echo "$UP$END[ ${GREEN}ok${NORMAL} ]"</nowiki></code> | * Change <code><nowiki>echo "$UP$END[ ok ]"</nowiki></code> to <code><nowiki>echo "$UP$END[ ${GREEN}ok${NORMAL} ]"</nowiki></code> | ||
− | |||
The function should look like this: | The function should look like this: | ||
<pre><nowiki> | <pre><nowiki> | ||
log_end_msg () { | log_end_msg () { | ||
+ | # If no arguments were passed, return | ||
[ -z "$1" ] && return 1 | [ -z "$1" ] && return 1 | ||
+ | # Only do the fancy stuff if we have an appropriate terminal | ||
+ | # and if /usr is already mounted | ||
TPUT=/usr/bin/tput | TPUT=/usr/bin/tput | ||
EXPR=/usr/bin/expr | EXPR=/usr/bin/expr | ||
第72行: | 第76行: | ||
} | } | ||
</nowiki></pre> | </nowiki></pre> | ||
− | + | ==Colorize Dapper [ ok ]== (Also works for Feisty) | |
+ | You need to edit '''/etc/lsb-base-logging.sh''' | ||
+ | <pre><nowiki> | ||
+ | $TPUT setaf 4 # blue | ||
+ | printf '[ ' | ||
+ | $TPUT setaf 2 # green | ||
+ | printf ok | ||
+ | $TPUT setaf 4 # blue | ||
+ | echo ' ]' | ||
+ | $TPUT op # normal | ||
+ | </nowiki></pre> | ||
== Finalize == | == Finalize == | ||
Reboot, and your resolution should be increased. Your [ ok ] messages should now be green. | Reboot, and your resolution should be increased. Your [ ok ] messages should now be green. | ||
− | |||
Credits: [http://www.ubuntuforums.org/showthread.php?t=50054&highlight=spice dudinatrix] | Credits: [http://www.ubuntuforums.org/showthread.php?t=50054&highlight=spice dudinatrix] | ||
---- | ---- | ||
− | |||
[[category:UbuntuHelp]] | [[category:UbuntuHelp]] |
2010年5月19日 (三) 21:46的最新版本
This will not give you a splash image or hide the boot text. It will only make it look better.
Increase resolution
Edit /boot/grub/menu.lst
gksudo gedit /boot/grub/menu.lst
Add vga=792
to your default boot option.
Example:
titleUbuntu, kernel 2.6.10-5-k7 Default root(hd0,0) kernel/vmlinuz root=/dev/hde6 ro quiet splash vga=792 initrd/initrd.img savedefault boot
Usual VESA video modes is (VGA codes):
# 640×480 800×600 1024×768 1280×1024 1600×1200 # 8 bits vga=769 vga=771 vga=773 vga=775 vga=796 #16 bits vga=785 vga=788 vga=791 vga=794 vga=798 #32 bits vga=786 vga=789 vga=792 vga=795 vga=799
Colorize "[ ok ]"
NOTE : does not work with 5.10 Breezy. Use solution given there. (ed. 28/12/2005) EDIT : This does NOT work with the default Feisty install, it will break your boot and you will need a rescue CD to fix it, until further revised, do NOT use this on Feisty. (omegabeta 01,aug,07. NOTE : This does not work in Dapper either, so I am not sure what version this how-to is written for. For Dapper see below. We make the "[ ok ]" during bootup green
- Edit /lib/lsb/init-functions
gksudo gedit /lib/lsb/init-functions
- Find the log_end_msg () function, all the way at the bottom of the file and add
GREEN=`$TPUT setaf 2`
belowRED=`$TPUT setaf 1`
- Change
echo "$UP$END[ ok ]"
toecho "$UP$END[ ${GREEN}ok${NORMAL} ]"
The function should look like this:
log_end_msg () { # If no arguments were passed, return [ -z "$1" ] && return 1 # Only do the fancy stuff if we have an appropriate terminal # and if /usr is already mounted TPUT=/usr/bin/tput EXPR=/usr/bin/expr if [ -x $TPUT ] && [ -x $EXPR ] && $TPUT hpa 60 >/dev/null 2>&1; then COLS=`$TPUT cols` if [ -n "$COLS" ]; then COL=`$EXPR $COLS - 7` else COL=73 fi UP=`$TPUT cuu1` END=`$TPUT hpa $COL` START=`$TPUT hpa 0` RED=`$TPUT setaf 1` GREEN=`$TPUT setaf 2` NORMAL=`$TPUT op` if [ $1 -eq 0 ]; then echo "$UP$END[ ${GREEN}ok${NORMAL} ]" else echo -e "$UP$START $RED*$NORMAL$END[${RED}fail${NORMAL}]" fi else if [ $1 -eq 0 ]; then echo " ...done." else echo " ...fail!" fi fi return $1 }
==Colorize Dapper [ ok ]== (Also works for Feisty) You need to edit /etc/lsb-base-logging.sh
$TPUT setaf 4 # blue printf '[ ' $TPUT setaf 2 # green printf ok $TPUT setaf 4 # blue echo ' ]' $TPUT op # normal
Finalize
Reboot, and your resolution should be increased. Your [ ok ] messages should now be green. Credits: dudinatrix