个人工具

UbuntuHelp:BootText

来自Ubuntu中文

Oneleaf讨论 | 贡献2007年5月13日 (日) 11:33的版本 (New page: {{From|https://help.ubuntu.com/community/BootText}} {{Languages|php5}} This will not give you a splash image or hide the boot text. It will only make it look better. == Increase resoluti...)

(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳转至: 导航, 搜索


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
</code>

Add <code>vga=792</code> to your default boot option.

Example:
<pre>
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
</code>

==  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)

We make the "[ ok ]" during bootup green

* Edit /lib/lsb/init-functions
<pre>
gksudo gedit /lib/lsb/init-functions
</code>

* Find the log_end_msg () function, all the way at the bottom of the file and add <code>GREEN=`$TPUT setaf 2`</code> below <code>RED=`$TPUT setaf 1`</code>
* Change <code>echo "$UP$END[ ok ]"</code> to <code>echo "$UP$END[ ${GREEN}ok${NORMAL} ]"</code>

The function should look like this:
<pre>
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
}
</code>

== Finalize ==
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]
----
CategoryDocumentation

[[category:UbuntuHelp]]