gfxboot-theme的源码编译

来源:互联网 发布:怎么举报淘宝客服骂人 编辑:程序博客网 时间:2024/05/25 20:00

    要想个性化gfx的话,可以修改gfx的源码后进行编译,3.3的话可以在bean大侠修改版的基础上编译,该版本可以在windows下的msys环境中进行编译,而要编译最新的版本则要在linux下编译,经过摸索发现,在slax下编译挺方便的,下面记录一下方法及过程用以备忘和各位同仁共享:
一、准备工作
1、安装slax到硬盘

http://www.slax.org/get_slax.php
添加相关的模块
peazip-3.0   QEMU  VirtualBox 3.1.4 32bits

leafpad-0.8.17    ISO Master

2、下载gfxboot-devel包

源码:http://fr2.rpmfind.net/linux/rpm2html/search.php?query=gfxboot-devel&submit=Search+...

主题:http://fr2.rpmfind.net/linux/rpm2html/search.php?query=gfxboot-theme&submit=Search+...


3、反复研读bean的文章,他的贴子从头到尾看N遍

grub4dos 的 gfxmenu 支持 (更新v3)

gfxmenu定制高级教程(新增可定制菜单)

 

===================================================================
二、开始DIY
1、解压gfxboot-drv的rpm包,slax下用PeaZip解压,并且把gfxboot-compile、gfxboot-font等文件复制到/uer/bin/下。

===================================================================

2、开始修改inc和PO文件
A、进入gfxboot-devel的openSUSE目录,按F4调出终端,在终端中输入make,先进行测试一下,看看能否make,提示缺什么,就添加什么。。。
B、最好备份一下po和src这俩个目录,然后再修改。
C、修改inc文件
(1)、修改xmenu.inc,取消当前语言的显示
把这两行注释掉
xmenu .xm_list get xmenu .xm_current get get
dup .undef ne { exec show.rtl } { pop } ifelse
注释后
% xmenu .xm_list get xmenu .xm_current get get
% dup .undef ne { exec show.rtl } { pop } ifelse
(2)、修改dia_lang.inc,去掉语言选择时“繁体中文”(台湾)中的台湾这两个字
(3)、修改menu.inc,增加F11为重启快捷键。
在这段下
dup keyF10 eq {
power_off
pop 0
} if
添加
dup keyF11 eq {
re_boot
pop 0
} if

(4)修改common.inc,添加重启的对话框
在这段下

% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
% Show "power off" popup.
%
% ( ) ==> ( )
%
/power_off {
window.dialog

dup .title txt_power_off_title put
dup .text txt_power_off put
dup .buttons [
button.ok     button.notdefault    actPowerOff actNoClose or button.setaction
button.cancel button.default       actNothing                button.setaction
config.rtl { exch } if
] put
dup window.init
window.show

} def
添加
/re_boot {
window.dialog

dup .title txt_re_boot_title put
dup .text txt_re_boot put
dup .buttons [
button.ok     button.notdefault    actReboot actNoClose or button.setaction
button.cancel button.default       actNothing                button.setaction
config.rtl { exch } if
] put
dup window.init
window.show

} def
(4)修改panel.inc,取消F1的显示,增加F11,F12重启和关闭的显示

A、取消F1的显示

3.3系列的这样注释

 %     about.msg {

% panel.entry.about
% } {
% panel.entry.help
% } ifelse
4.39版以后的这样注释
% dup "help"       eq { pop [ /panel.help /panel.help.width /panel.help.update .undef ] return } if
% dup "about"      eq { pop [ /panel.about /panel.about.width /panel.about.update .undef ] return } if

B、增加
F11,F12重启和关闭的显示(4.1.41-2.1版的)

/panel.reboot {
re_boot
} def

/panel.reboot.width {
txt_reboot strsize pop
} def

/panel.reboot.update {
panel.text.moveto
txt_reboot show.rtl
} def

/panel.poweroff {
power_off
} def

/panel.poweroff.width {
txt_poweroff strsize pop
} def

/panel.poweroff.update {
panel.text.moveto
txt_poweroff show.rtl
} def

在这行

config.key.F6  panel.entry dup { [ keyF6  0 "F6"  5 -1 roll { } forall ] } { pop } ifelse
config.key.F7  panel.entry dup { [ keyF7  0 "F7"  5 -1 roll { } forall ] } { pop } ifelse
config.key.F8  panel.entry dup { [ keyF8  0 "F8"  5 -1 roll { } forall ] } { pop } ifelse

下添加

config.key.F10  panel.entry dup { [ keyF10  0 "F10"  5 -1 roll { } forall ] } { pop } ifelse

在这行下
dup "dud"        eq { pop [ /panel.dud /panel.dud.width /panel.dud.update /dud.init ] return } if
dup "keymap"     eq { pop [ /panel.keymap /panel.keymap.width /panel.keymap.update /keymap.init ] return } if
添加

dup "reboot"     eq { pop [ /panel.reboot /panel.reboot.width /panel.reboot.update /reboot.init ] return } if
dup "poweroff"   eq { pop [ /panel.poweroff /panel.poweroff.width /panel.poweroff.update /poweroff.init ] return } if

 

(5)修改PO,添加相关的翻译

A、进入po目录按F4,调出终端,分别输入以下命令

bin/add_text txt_re_boot_title "Reboot"

bin/add_text txt_re_boot "Reboot the system now ?"

bin/add_text txt_poweroff  "poweroff "

(6)make,先在po中make,然后在make src

 

(7)修改gfxboot.cfg

 

(8)要去掉“引导选项”,有几个地方要改的。

1,common.inc里的boot.show设为false
2,main.inc里的boot.input.setup定义里。这个函数是用来画框的,第一句是判断boot.show的,不过代码里用%注释掉了,应该把%去掉。
boot.show not { return } if

3,关于F1出错的问题,在dia_help.inc里:
复制内容到剪贴板
代码:
/panel.help {
help.context "opt" eq {
findbootoption
help.mapcontext
dup help.findpage
"" eq { pop } { help.setcontext } ifelse
} if
show_help
} def
原来的代码会寻找options框的内容并显示帮助,其实是很人性化的,不过我们把options框去掉了,那就不要调用这段代码了,把if语句注释掉:
复制内容到剪贴板
代码:
/panel.help {
%   help.context "opt" eq {
%     findbootoption
%     help.mapcontext
%     dup help.findpage
%     "" eq { pop } { help.setcontext } ifelse
%   } if
show_help
} def
4,另外,转换语言后“引导选项”的字样又会出现,解决方法是修改main.inc里的main.show函数。里面有一句:
复制内容到剪贴板
代码:
boot.ed.list 0 get .inp_label /txt_bootoptions put
改为:
复制内容到剪贴板
代码:
% boot.ed.list 0 get .inp_label /txt_bootoptions put
boot.ed.list 0 get .inp_label "" put

(9)修改对话框颜色按钮

 

按钮的颜色在button.inc里

rmoveto后面2组颜色

例:rmoveto white black
标题栏颜色theme_colors.inc
/title.bg            0x4B4B4B          newcolor

帮助对话框颜色help.inc

/help.light 0x4B4B4B          newcolor
/help.dark 0x4B4B4B          newcolor
/help.font font.normal def  <--这个不能改
/help.normal.bg black def
/help.normal.fg white def
/help.highlight.fg red def
/help.link.fg 0x03DCF6          newcolor
/help.link.selected.fg 0x03DCF6          newcolor
/help.link.selected.bg 0x4B4B4B          newcolor

确认框颜色xmenu.inc
/xmenu.hspace                12 def
/xmenu.light                0x4B4B4B newcolor
/xmenu.dark                0x4B4B4B newcolor
/xmenu.font                font.normal def
/xmenu.normal.bg        lightgray def
/xmenu.normal.fg        black def
/xmenu.selected.fg        white def
/xmenu.selected.bg        0x4B4B4B newcolor

貌似window.inc也有,但是不记得了...

 

引自: http://hi.baidu.com/%B8%CA%B5%CF/blog/item/e465440187147a0a1c958342.html

原创粉丝点击