Specially for BioScience and Home using
当然,不使用上面的这几个软件,也可以单独使用文本
命令来进行光盘制作。
splash.rle 是光盘引导最初启动时的背景图片(非动画图片),通常称为Live CD spalsh,文件通常位于安装光盘的isolinux这个目录下(Isolinux这个目录如何产生的?见下文), 定制这个启动画面,就是替换这个文件(实际 上,这个目录包含了安装 光盘中的提示信息,还有就是isolinux.bin是光盘的引导文件)。如果您需要定制光盘,那么这个步骤就少不了。通常的步骤是:
首先,用图片处理程序编辑一个新的splash.png文件;
其次,使用pngtopnm进行pnm转换:
sudo pngtopnm splash.png>splash.pnm
最后,用ppntoss16转变成16位图:
sudo ppmtolss16 "#000000=0" "#ffffff=7"<splash.pnm>splash.rle
制 作完成后,修改isolinux这个文件夹中的 isolinux.txt,首行加入
splash.rle
即 可
Bootlogo对Grub
splash和Live CD menu splash的改造
这个Boologo与splash.rle有区别,splash.rle是Live CD最初加载的背景图片,而bootlogo是Live CD或者Grub
splash最初启动时的动画图片,可以让画面更加生动(与suse安装光盘具有同样效果)。这个文件制作比较复杂:
典型的bootlogo包含以下文件:
init,光盘启动加载的文件配置
lang,语言文件
languages,语言文件
zh_CN.tr,汉语文件
translations.en
translations.zh_CN
zh_CN.hlp 汉文帮助文件
en.hlp 英文帮助文件
en.tr
16x16.fnt,字体文件
首
先,编辑一张640x480或者800X600的图片(不超过
256KB),,并将其索引为256色或者16色:
此步骤可如下操作:
pngtobogl graphic.png > graphic.c
sudo pngtobogl splash.png > splash.c
sudo pngtopnm splash.png>splash.pnm #转化png为pnm
sudo ppmtolss16 "#000000=0" "#ffffff=7"<splash.pnm>splash.rle #将转化的pnm文件,转化为rle文件。
jpegtopnm splash.jpg | ppmtojpeg > splash16.jpg #转化为16色。
建
立bioinfoserv目录,将上面的文件拷贝到里面,然后修改
修改后,索引为256色或者16色,然后打包,进入bioinfoserv目录,利用ls和管道命令打包。
ls | cpio -ov > /home/bioinfoserv/home/bootlogo
用bootlogo修改 Live CD menu splash:
将bioinfoserv.mess拷贝到isolinux下,然后修改isolinux.cfg,加入:
DEFAULT /casper/vmlinuz
GFXBOOT bioinfoserv1
GFXBOOT-ACCESS-OPTIONS v2 v3 m2
Grub splash修改(这里是
指用gfxboot加载bootlogo在修改Grub splash):
首先下载gfxboot:http://kanotix.com/debian/pool/main/g/grub-
gfxboot/
卸载系统原有的grub:apt-get remove grub
再安装grub-gfxboot:
sudo dpkg -i grub-gfxboot_0.97-11_i386.deb
进
而重新安装grub:
grub-install /dev/hda0 #安装到系统当前分区上,如果您是scsi硬盘,就应该为sda0,至于是否为0,根据您当前的系统进行判断
grub #安装grub到MBR
grub --no-floppy #如果您的计算机没有软驱
grub 命令提示符下:
grub> root (hd0,4)
grub> setup (hd0)
grub> quit
sudo pngtopnm bioinfoserv.png | pnmtopng >bioinfoserv16.png #将24色jpeg图片转化为16色或 者,您也可以采用gimp或者phtoshop来进行色深的修改,以gimp为例,采用gimp打开图片后,从菜单“图; ——>“模式 ——& gt;“索引”,此时, 会跳出对话框:在颜色表选项中,选择“生成最大颜色数量”,将其调为16即可,随后,保存图片,这样16色的 PNG格式就完成 了。
sudo jpegtopnm bioinfoserv.jpg | ppmtojpeg > bioinfoserv16.jpg #将24色png图片转化为16色
sudo mv -f bioinfoserv16.jpg usplash-artwork.png #修改文件名
sudo pngtobogl usplash-artwork.png > usplash-artwork.c
sudo gcc -Os -g -I/usr/include/bogl -fPIC -c usplash-artwork.c -o usplash-artwork.o
sudo gcc -shared -Wl,-soname,usplash-artwork.so usplash-artwork.o -o yourimage-splash.so

sudo mkdir -p /usr/local/lib/usplash/
cp yourimage-splash.so /usr/local/lib/usplash/yourimage-splash.s
sudo ln -sf /usr/lib/usplash/yourimage-splash.so /usr/lib/usplash/usplash-default.so
sudo update-alternatives -install /usr/lib/usplash-artwork.so usplash-artwork.so /usr/local/lib/usplash/yourimage-splash.so 55
sudo dpkg-reconfigure linux-image-`uname -r`
sudo dpkg-reconfigure linux-image-$(uname -r)
或
d-i base-installer/kernel/linux/extra-packages-2.6 string usplash xubuntu-artwork-usplash
sudo dpkg-reconfigure -phigh usplash
title Ubuntu, kernel 2.6.15-27-386
root (hd0,1)
kernel /boot/vmlinuz-2.6.15-27-386 root=/dev/hda2 ro quiet splash elevator=cfq
initrd /boot/initrd.img-2.6.15-27-386
savedefault
boot
title Ubuntu, kernel 2.6.15-27-386Login Splash(飞 溅瀑布)
root (hd0,1)
kernel /boot/vmlinuz-2.6.15-27-386 root=/dev/hda2 ro quiet vga=792 elevator=cfq
initrd /boot/initrd.img-2.6.15-27-386
savedefault
boot
3.
Themes定制
在theme定制过程中,主要采用gnome-art进行theme和
Icons的定制。最简单的方法是采用gnome-art来进行配置。这个工具需要安装:
sudo apt-get install gnome-art
安装后,打开程序:在终端下输入:
gnome-art
打开程序,安装您所喜欢的theme和Icons (注意:安装theme和Icons过程中,如果网络状态不好gnome-art会因为不能下载文件而自 动退出,这时您需要反复启动它然后反复进行相应theme和Icons的下载), 下载安装完成后,您还需要进入“用户界面设置”,然后选择相应的主题和图标:“开始菜单 ”——>“配置设置”& amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; mdash;—>“用户界面 设置”——>选择您所喜欢的“主题& rdquo;、“图标主题”。
GDM
登录界面定制
GDM用来管理用户登录
系统的界面,其主要配置的文
件位置位于:
/etc/default/gdm
/etc/default/locale
/etc/gdm/
/etc/init.d/gdm
/etc/xdg/xubuntu/gdm
/etc/profile
/etc/rc.d/S*gdm
/usr/share/locale-langpack/zh_CN/LC_MESSAGES/gdm.mo #这个是界面的汉化包
语言设置:GDM是在Xsession中设置 语言环境变量,属于Login Class的设置,可以通过以下以下几种方式来设置:
A. 在/etc/default/gdm中添加:
LANG="zh_CN.UTF-8"
LANGUAGE="zh_CN:zh"
B. 直接修改gdm启动文件
/etc/rc.d/S*gdm (*为一数字),把第一行加上 "LANG=zh_CN"
C.使用profile:
在/etc/profile文件加入以下内容:
export LANG=zh_CN.UTF-8
export LC_ALL=zh_CN.UTF-8
D. 使用/home/$username/.xinitrc:
创建~/.xinitrc文件,加入一下内容:
export LANG=zh_CN.UTF-8
export LC_ALL=zh_CN.UTF-8
E.登录界面的汉化包:
登录界面的汉化主要涉及到/usr/share/locale-langpack/zh_CN/LC_MESSAGES/gdm.mo
的制作,如何制作这个文件,可参照下文的“软件汉化定制办法。
gdm 的配置文件存在于:
/etc/default/gdm
/etc/gdm/
/etc/xdg/xubuntu/gdm
/usr/share/gdm/applications #gdm的设置程序
可对这些文件夹存在的配
置文件进行修改:/etc/gdm下的配置文件:
gdm.conf #GDM默认配置文件
gdm.conf-custom #gdm个性化配置文件
locale.conf #语言类别选择
failsafeDexconf #登录界面状态下的驱动等
AllowRemoteRoot=false #配置允许root用户登录
GtkTheme=Human #配置GDM的gtk风格文件
GlobalFaceDir=/usr/share/pixmaps/faces/ #配置用户头像
LocaleFile=/etc/gdm/locale.conf #配置GDM语言类别选项
BackgroundColor=#dab082 #配置GDM的背景颜色
GraphicalThemedColor=#dab082 #配置GDM风格文件颜色基调
GraphicalTheme=bioinfoserv #位于gdm.conf-custom中的配置参数指定登录界面的风格文件,其路径由gdm.conf来配置
GraphicalThemeDir=/usr/share/gdm/themes/ #指定GDM风格文件路径
SoundProgram=/usr/lib/gdmplay #配置GDM登录时播放音乐的播放器
SoundOnLogin=true #登录时,播放音乐
SoundOnLoginFile=/usr/share/sounds/dl.wav #登录时,播放音乐/usr/share/sounds/下的dl.wav音乐文件
SoundOnLoginSuccess=true #登录进行中,播放音乐
SoundOnLoginSuccessFile=/usr/share/sounds/startup.wav #登录进行中,播放音乐/usr/share/sounds/下的startup.wav音乐文件
SoundOnLoginFailure=true #登录失败时,播放音乐
SoundOnLoginFailureFile=/usr/share/sounds/mrxs.wav #登录失败时,播放音乐/usr/share/sounds/下的mrxs.wav音乐文件
AutomaticLoginEnable=false #不允许用户自动登录。如果允许值为true,并在“AutomaticLogin=”配置用户名
AutomaticLogin=
对 于GDM风格文件,可以参考/usr/share/gdm/themes下的文件进行编写或修改。另外,音乐文件,可修改 /usr/share/sounds中的文件进行个性定制。
/usr/share/icons #系统文件夹图标默认位置
/usr/share/app-install/icons
/usr/share/pixmaps #系统自带的图标文件,主要用于程序菜单中的图标指定。
/home/$username/.icons/ #用户目录下的个人图标文件夹,与/usr/share/icons的用途相同。
/usr/share/backgrounds #桌面背景图片
/home/$username/.themes/ #用户目录下的个人图标文件夹,与/usr/share/themes的用途相同。至于安装新的theme和.文件,可以拷贝至这两个目 录下,然后采用xfce4桌面的配置工具进行设定。
/usr/share/themes #系统风格文件默认存放的位置。可参照里面的文件进行修改
/usr/share/icons/default #这个通常为鼠标的风格安装路径
/etc/X11/cursors #系统默认安装的鼠标风格
4. 系
统
菜单定制
BioInfoServOS的桌面管理器为xfce4,其系统菜单涉
及到以下文档和目录:
/etc/menu-methods/ #这个目录包含了lang.h、menu.config、translate_menus和xfdesktop4,主要是为各种不同桌面管理器提供统一的程序菜单产生。
/etc/menu/ #程序菜单文件目录,这种保存程序菜单的目录几乎没怎么使用。
/usr/share/menu/ #这个目录包含了采用“?package...."”命令格式的菜单.这个目录几乎包括所有的程序菜单。
/etc/xdg/menus/applications-merged/ #
/etc/xdg/xfce4/desktop/ #
/home/$username/.config/xfce4/desktop/ #这是用户目录下的个人菜单目录文件
/usr/share/applications/ #
/usr/share/app-install/desktop/ #
/usr/share/application-registry #
/usr/share/apps #
/usr/share/applnk
/var/lib/menu-xdg/applications/menu-xdg
/usr/share/desktop-directories #程序类别
程
序
菜单分类定制,需要修改以下几个文件:
A.
系统菜单文件配置在:
/etc/xdg/xfce4/desktop/之下(可以影响所有系统用户的程序菜单).
BioInfoServOS 1.1在定制过程中修改和注册了新的程序分类,并对其中的错误进行了修订,特别是对中文程序分类,修改后的菜单文件,请见
/etc/xgd/xfce4/desktop/menu.xml和xfce4-registered-categories-xml.zh_CN:
B.
~/.config/xfce4/desktop/menu.xml (这个是每个用户自定义的菜单文件)。
当然要让相应的软件在安装
后能自动加载到所指定的程序菜单目录中,建议在安装之间对安装包进行重新打包,当然,我们完全可以在安装后修改菜单文件中的category项。程序安装
后,一般菜单文件都在/usr/share/applications下。不过有些程序会有自己的程序菜单文件夹,例如有些安装程序
会在
/var/lib/menu-xdg/applications/menu-xdg/下建立菜单文件。
程 序安装后,如果它没有出现在程序菜单中,可以根据下面的格式建立,然后将其保存为*.desktop文件,存放到 /usr/share/applications/下即可:
[Desktop Entry] #参数声明
Version=2.0 #软件的版本
Encoding=UTF-8 #菜单的语言编码
Name=CPG Island Exploler #程序的名称
Name[zh_CN]=CPG岛搜索 #程序的中文名称
GenericName=CPG Island Exploler #
Comment=CPG Island Explolerr #这是程序的说明,可以在鼠标移动到菜单上时,显示其说明。
Type=Application #表明程序的类型,为Application
Exec=/usr/lib/jvm/java-1.5.0-sun-1.5.0.06/bin/java -jar /usr/local/bioinf/CPG/CpGIE.jar #程序运行指令,这里加入了其java运行路径。
Terminal=false #程序是否需要终端支持
Icon=/usr/share/pixmaps/dna.png #程序菜单的图标
Categories=Application;BioInfo; #程序的类别指定
/etc/fonts/fonts.conf
/etc/fonts/language-selector.conf
系统
字体的定制主要涉及到字体安装和字体配置:
安 装必要的字体和分辨率较高的字体:ghostscript gsfonts ttf系列字体 wqy-bitmapfont xfonts系列字体 msttcorefonts等
sudo apt-get install ghostscript gsfonts wqy-bitmapfont msttcorefonts #字体安装
sudo apt-get install xfontsel fontforge dfontmgr defoma qt3-qtconfig #字体工具
字
体注册采用:dfongmgr; 字体浏览:xfontsel fontforge; QT3程序配置工具:qt3-qtconfig
Openoffice字体在/usr/lib/openoffice/share/fonts/truetype,
/opt/openoffice.org2.4/share/fonts/truetype或/usr/share/fonts/truetype/openoffice下,
因此Openoffice的字体安装就是将其他字体安装到openoffice的字体路径即可。对于Openoffice界面字体大小,需要用它菜单里的
“选项”里的视图来调整。
安 装字体和注册字体后,可采用以下命令来刷新系统字体:
sudo nano /etc/fonts/language-selector.conf #加入新安装的字体
sudo fontconfig-voodoo -f -s zh_CN
sudo fc-cache -f -v
进
行上面的动作后,现在就可以采用xfce4的设置管理器来配置用户界面的字体显示了。至于
至 于更详细的字体的定制,可查看http://forum.ubuntu.org.cn/viewtopic.php?t=18638
其 他一些程序,如采用qt引擎的程序界面,可采用/home/$username/.qt/或者/etc/qt3/来配置字体(相应的配置程序就是qt3- qtconfig)。而/home/$username/.config/中的一些配置文件也包含了字体配置文件(如/home/$ username/.config/xfce4/Xft.xrdb可以配置系统界面字体的分辨率,加入代码"Xft.dpi: 96"), /etc/xdg/xfce4是系统通用配置文件保存目录。
wine 和crossOver 的字体注册很简单,跟上面方法一样。wine的字体在/usr/share/wine/fonts/或者 ~/.wine/drive_c/windows/fonts下,crossoveroffice字体在 ~/.cxoffice/winxp/drive_c/windows/fonts或,需要配置文件有~/.wine/system.reg (~/.cxoffice/winxp/system.reg):
[System\\CurrentControlSet\\Hardware Profiles\\Current\\Software\\Fonts] 1203923140
"FIXEDFON.FON"="svgafix.fon"
"FONTS.FON"="svgasys.fon"
"LogPixels"=dword:00000060 #逻辑图素,即「以每英寸的图素数为单位的非实际分辨率」,如可修改为dword:00000070
"OEMFONT.FON"="vga936.fon"
[Software\\Microsoft\\Windows NT\\CurrentVersion\\FontSubstitutes] 1203923140和~/.wine/drive_c/windows/win.ini(~/cxoffice/winxp/drive_c/windows/win.ini), 可加入以下字行以增大字体:
"Arial CE,238"="Arial,238"
"Arial CYR,204"="Arial,204"
"Arial Greek,161"="Arial,161"
"Arial TUR,162"="Arial,162"
"Courier New CE,238"="Courier New,238"
"Courier New CYR,204"="Courier New,204"
"Courier New Greek,161"="Courier New,161"
"Courier New TUR,162"="Courier New,162"
"Helv"="MS Sans Serif"
"Helvetica"="Arial"
"MS Shell Dlg"="Tahoma" #定义程序或文本的字体,可修改为SimSun
"MS Shell Dlg 2"="Tahoma"
"Times"="Times New Roman"
"Times New Roman CE,238"="Times New Roman,238"
"Times New Roman CYR,204"="Times New Roman,204"
"Times New Roman Greek,161"="Times New Roman,161"
"Times New Roman TUR,162"="Times New Roman,162"
"Tms Rmn"="Times New Roman"
[Desktop]
menufontsize=13
messagefontsize=13
statusfontsize=13
IconTitleSize=13
系 统软件定制需要相应的软件仓库来支持,现编辑加入/etc/apt/sources.list:
#系统软件光盘加入
deb cdrom:[Ubuntu-Server 6.06 _Dapper Drake_ - Release i386 (20060531)]/ dapper main restricted
#cn99软件仓库
deb http://ubuntu.cn99.com/ubuntu/ dapper main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ dapper-updates main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ dapper-security main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu/ dapper-backports main restricted universe multiverse
deb http://ubuntu.cn99.com/ubuntu-cn/ dapper main restricted universe multiverse
#ubuntu-cn软件仓库
deb http://archive.ubuntu.org.cn/ubuntu/ dapper main restricted universe multiverse
deb http://archive.ubuntu.org.cn/ubuntu/ dapper-updates main restricted universe multiverse
deb http://archive.ubuntu.org.cn/ubuntu/ dapper-security main restricted universe multiverse
deb http://archive.ubuntu.org.cn/ubuntu/ dapper-backports main restricted universe multiverse
#hiweed软件仓库
deb http://archive.ubuntu.org.cn/ubuntu-cn/ dapper main universe multiverse restricted
deb-src http://cn.archive.ubuntu.com/ubuntu dapper main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu dapper main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu dapper-security main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu dapper-updates main restricted universe multiverse
deb http://cn.archive.ubuntu.com/ubuntu dapper-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu dapper-security main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu dapper main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu dapper-security main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu dapper-updates main restricted universe multiverse
deb-src http://cn.archive.ubuntu.com/ubuntu dapper-backports main restricted universe multiverse
deb-src http://security.ubuntu.com/ubuntu dapper-security main restricted universe multiverse
#ubuntu官方软件仓库
deb http://archive.ubuntu.com/ubuntu/ dapper main restricted universe multiverse
deb-src http://archive.ubuntu.com/ubuntu/ dapper main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ dapper-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ dapper-security main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu/ dapper-proposed main restricted universe multiverse
#Xfce4-4-0桌面仓库
deb http://ubuntu.tolero.org/ dapper xfce-4-4-0
deb-src http://ubuntu.tolero.org/ dapper xfce-4-4-0
#XGL and alglx 3D桌面仓库
deb http://www.beerorkid.com/compiz dapper main
#wine虚拟仓库
deb http://wine.budgetdedicated.com/apt dapper main
#ntfs-3g NTFS磁盘读写软件仓库
deb http://flomertens.keo.in/ubuntu/ dapper main
#媒体播放解码器仓库源(dir2ogg xmms-wmv divx4linux googleearth skype w32codecs)
deb http://packages.freecontrib.org/ubuntu/plf/ dapper free non-free
###########################生物软件仓库#######################################################
#BioInfoServDeb生物软件仓库
deb http://www.bioinfoserv.org/BioinfoServDeb/Version1.1-Xubuntu6.06/ /
#Bio-Linux生物软件仓库
deb http://envgen.nox.ac.uk/bio-linux/ unstable bio-linux
deb http://envgen.nox.ac.uk/bio-linux-commercial/ commercial bio-linux
#Debian bioinformatics生信息软件仓库
deb http://debian.bioinformatics.unsw.edu.au/ stable main
deb http://debian.bioinformatics.unsw.edu.au/ unstable main
#Moeller的个人生物软件仓库
deb http://bioinformatics.pzr.uni-rostock.de/~moeller/debian/ ./
#BioLinux-BR
deb http://biolinux.df.ibilce.unesp.br/pacotes/deb ./
#debian-Med,适用于ubuntu的med-bio在http: //ftp.riken.go.jp/pub/Linux/ubuntu/pool/universe/d/debian-med/
deb http://www.debian.org/devel/debian-med/ ./
#SciCraft, Gene annotation, Microarray analysis, Running of R programs, Running Matlab/Octave m-files were avalible
deb http://www.scicraft.org/files/debian/ dapper/
deb-src http://www.scicraft.org/files/debian/ dapper/


dpkg -x clustalw_1.83_1.2.deb clustalw #解开clustalw_1.83_1.2.deb包的目录结构,可以看见control、postrm等包含脚本的文件,如果要修如何从源码打包deb?
改软件的信息、 安装行为、增加运行菜单,那么进行修改和建立。
dpkg -e clustalw_1.83_1.2.deb clustalw/DEBIAN #解开clustalw_1.83_1.2.deb包的依赖性配置文件,可具体配置依赖性和包的安装行为。如有时
其依赖性包过 高,可以修改Depends字段的版本号。
dpkg -b clustalw clustalw_1.83_1.2.deb #重新将修改后的软件包打包。
##说明:开发一个新的软件安装包,可以据上进行相应的软件包编译打包。
一
个简单的deb仓库可以采用apt-get install
*的方式来进行快速软件安装。制作软件包仓库其实很简单:
首先,
将制作好的deb包放在一个目录下,当然您也可以依据软件名称建立子目录,再存放deb包,如您建立一个Version1.1-Xubuntu6.06的
目录存放已经建立的软件包
随后,建立仓库索引文件:
sudo dpkg-scanpackages Version1.1-Xubuntu6.06 /dev/null | gzip -9c >Packages.gz
然 后,解开Packages.gz以便编辑:
gzip -d Packages.gz
此 时得到Packages文件以编辑:
nano Packages
采 用替换功能去掉Packages里面的Version1.1- Xubuntu6.06/字段,然后保存重新打包:
gzip Packages Packages.gz
并
放到目录Version1.1-Xubuntu6.06中。
现在设定/etc/apt/sources.list中的仓库源,如果Version1.1-Xubuntu6.06目录在你系统中的
/var/www/Version1.1-Xubuntu6.06下的话,可在/etc/apt/sources.list加入:
deb file:////var/www/Version1.1-Xubuntu6.06/ /
保
存后sources.list,采用apt-get
update更新,此时就可以采用apt-get install clustalw_1.83_1.2.deb安装你创建好的deb软件了。
当然如果您将这个软件仓库发布到互联网上,假定您的网络地址为http://www.bioinfoserv.org,其互联网访问的路径为http://www.bioinfoserv.org/BioinfoServDeb/Version1.1
-Xubuntu6.06,那么在/etc/apt/spurce.list中添加:
deb http://www.bioinfoserv.org/BioinfoServDeb/Version1.1-Xubuntu6.06/ /
此 时,其他人就可以采用互联网使用您的deb软件仓库了。
这里是指添加或者删除特定的一些语言支持包,以最大限度地保证系统的 干净和良好语言支持。
j2re1.4
的中文支持配置:
j2re1.4一直有问题,现在可如下操作:
LANG=zh_CN.UTF-8如果系统缺少相应的汉语语言包,可新安装:
LC_ALL=zh_CN.UTF-8
bioinfoserv@BioInfoServOS:/$ sudo apt-get install language-pack-gnome-zh language-pack-gnome-zh-base language-pack-zh当然,如果你觉得不需要其他没有必要的语言包,可以删 除。如删除俄罗斯语ru
language-pack-zh-base language-support-zh
bioinfoserv@BioInfoServOS:/$ sudo apt-get remove language-pack-ru*
汉字输入法:
汉字输入法需要安装scim和fcitx:
sudo apt-get install scim scim-chinese scim-pinyin scim-tables-zh skim-scim-pinyin fcitx
安装完毕,需要进行设置才能让输入法自动加载到桌面右
下角面板:export LANG=zh_CN.UTF-8采用scim输入法:
export LC_ALL=zh_CN.UTF-8
export XIM_PROGRAM=fcitx
export XIM=fcitx
export XMODIFIERS="@im=fcitx"
fcitx&
export LANG=zh_CN.UTF-8适合xfce4桌 面: 建立/etc/X11/Xsession.d/95xinput:
export LC_ALL=zh_CN.UTF-8
export XMODIFIERS=@im=SCIM ;
export GTK_IM_MODULE="scim" ;
scim -d
export LANG=zh_CN.UTF-8采用scim输入法:
export LC_ALL=zh_CN.UTF-8
export XIM_PROGRAM=fcitx
export XIM=fcitx
export XMODIFIERS="@im=fcitx"
fcitx&
export LANG=zh_CN.UTF-8
export LC_ALL=zh_CN.UTF-8
export XMODIFIERS=@im=SCIM ;
export GTK_IM_MODULE="scim" ;
scim -d
文件关联,可以让您默认打开某些文件和程序采用哪些软件,它可极大地方便系统的使用。但是,有时候,不正确的文件关联,也会带来麻烦。因此,您需要进行一定程度地定制,这里需要涉及到以下几个目录和文件
用户自定义文件关联
~/.local/share/applications/defaults.list
~/.local/share/applications/mimeinfo.cache
系统全局性文件关联设置
/usr/share/applications
/usr/share/applications/mimeinfo.cache
/usr/share/applications/defaults.list
/etc/gnome/defaults.list
/etc/gnome/mimeinfo.cache
/etc/xdg/xubuntu/applications/defaults.list
/etc/xdg/xubuntu/applications/mimeinfo.cache
defaults.list(mimeinfo.cache 由defaults.list自动生成)注意的结构如下,它包含了
程序类型/文件类型=打开这个文件的项[;项2]...[;项n]
,如果需要候选的打开方式,采用;隔开
[Default Applications]
application/csv=gnumeric.desktop
application/excel=ooo-calc.desktop
application/msexcel=ooo-calc.desktop
application/msword=ooo-writer.desktop
application/ogg=mplayer.desktop
application/pdf=evince.desktop
application/postscript=evince.desktop
.................
text/plain=mousrpad.desktop;firefox.desktop
text/x-chdr=vim.desktop
text/x-csrc=vim.desktop
text/x-dtd=vim.desktop
text/x-java=vim.desktop
text/mathml=vim.desktop
text/x-python=vim.desktop
text/x-sql=vim.desktop
text/xml=firefox.desktop
video/dv=mplayer.desktop
video/mp4=mplayer.desktop
video/mpeg=mplayer.desktop
video/msvideo=mplayer.desktop
video/quicktime=mplayer.desktop
video/vnd.rn-realvideo=mplayer.desktop
video/x-anim=mplayer.desktop
video/x-avi=mplayer.desktop
video/x-flc=mplayer.desktop
......................
注意/usr/share/applications下的desktop文件与~/.local/share/applications/下的desktop有一定差别:
一般来说~/.local/share/applications/下的desktop下的文件不需要显示在系统菜单中,而只显示在鼠标右键菜单中。同时,她会额外定义MimeType,而/usr/share/applications下的desktop文件则不如此。
~/.local/share/applications/下nvu的desktop文件内容:
[Desktop Entry]
Encoding=UTF-8
Type=Application
NoDisplay=true
Name=nvu
Exec=nvu
MimeType=text/html
/usr/share/applications/下nvu的desktop文件内容:
[Desktop Entry]
Name=Nvu
Name[ja]=Nvu
Name[de]=Nvu
Comment=Create Web Pages
Categories=GNOME;Application;Development;
Encoding=UTF-8
Exec=nvu
Icon=nvu
Terminal=false
Type=Application
当然,如果您觉得修改这些个配置文件很麻烦,您可以采用命令,如:
update-alternatives --config x-www-browser
此外,您还可以采用galternatives这个图形前端来进行,如下:

9.
其他综合定制
其他配置,可以综合
修改以下文档,达到对系统的定制和配置。
/etc/xdg/ #系统通用的XDG菜单,适合于各种桌面管理器的配置,如这里包含了xfce4桌面。
/etc/xdg/autostart #系统自动加载程序配置
/etc/xdg/menus #系统程序菜单配置
/etc/xdg/Thunar #系统文件系统管理器行为和外观配置
/etc/xdg/xfce4 #xfce4管理器配置
/etc/xdg/xfce4/desktop #xfce4桌面配置菜单
/etc/xdg/xfce4/helpers.rc #默认的xfce4关联程序配置,配置默认的浏览器、邮件、终端程序
/etc/xdg/xfce4/mcs_settings #xfce4桌面外观配置
/etc/xdg/xfce4/panel #xfce4桌面面板配置
/etc/xdg/xfce4/Xft.xrdb
/etc/xdg/xfce4/xinitrc #这个配置文件用于设定xfce4桌面用户的环境配置,如输入法,用户的配置文件路径等,与/etc/skel/.xinitrc有同样功效。
/etc/xdg/xfce4-session
/etc/xdg/xubuntu #xubuntu桌面配置
/etc/xdg/xfce4/kiosk/kioskrc #这个可以限定用户调整菜单的权限,其内容如下,限定只有root用户才能调整系统菜单:
[xfce4-panel]
CustomizePanel=%root
/etc/skel #这个目录用来保存新用户的配置文件,即新用户建立时,会自动将这里的配置文件拷贝到/home/$username/下。这里可以
将用户的环境变量、输入法、桌面外观、面板特性等进行预置。因此,它能实现的功能与其他/etc/下的系统配置相同,不过
它需要拷贝至用户主目录中,而不像/etc/下的配置文件是全局性的,无须复制才能实现其功能。
/etc/skel/.bashrc #用户环境变量设置,与/etc/profile可以达到同样的效果。不过,它需要拷贝到新用户的目录下。
/etc/profile #系统环境变量设置。
/etc/X11 #系统X11服务的配置文件
/etc/X11/xinit/xinput.d #X11系统输入法配置
/etc/X11/fonts #X11系统字体配置
/etc/X11/Xsession.d
/etc/X11/xorg.conf #X11系统驱动配置
/etc/fonts #系统字体配置
/etc/security #系统安全配置
/etc/scim #系统scim输入法配置
/etc/apache2 #apache2配置
/etc/php5 #php5配置
/etc/mysql #网路数据库mysql配置
/etc/samba #网络共享配置
/etc/default #系统默认配置,如驱动、语言环境,GDM,系统内核模块功能等配置。
/etc/firefox #浏览器firefox配置
/etc/init.d #系统启动脚本配置
/etc/alternatives #这是系统关联程序调用配置,相当于windows系统下的“以....默认程序打开”的配置一样。如何配置,见8.文件关联
软件的汉化需要软件包编写时注意多语言问题,常见的汉 化方式采用gettext函数取得字符串实现。如果不是采用这种方式,那 么软件菜单的字符串就会在源程序里。
bioinfoserv@BioInfoServOS:/$ cp /usr/share/locale/en/LC_MESSAGES/InfoServFaster.mo /home/temp/InfoServFaster.mo现在找到要翻译的菜单字符串,格式如下:
bioinfoserv@BioInfoServOS:/$ cd /home/temp
bioinfoserv@BioInfoServOS:/$ msgunfmt InfoServFaster.mo > InfoServFaster.po
bioinfoserv@BioInfoServOS:/$ nano InfoServFaster.po
bioinfoserv@BioInfoServOS:/$ msgfmt InfoServFaster.po -o /InfoServFaster.mo现在就完成了一个i10汉化程序。
bioinfoserv@BioInfoServOS:/$ sudo cp -f InfoServFaster.mo /usr/share/locale/zh_CN/LC_MESSAGES/
$ cat InfoServFaster.poInfoServFaster.po文件内容如下:
export LANG=zh_CN.UTF-8
#!/bin/bash
export TEXTDOMAINDIR=/usr/share/locale
export TEXTDOMAIN=InfoServFaster.po
echo "$(gettext -s File)"
echo "$(gettext -s Edit)"
echo "$(gettext -s View)"
$ cat InfoServFaster.po现在将InfoServFaster.po编译为InfoServFaster.mo, 然后拷贝至/usr/share/locale/zh_CN/LC_MESSAGES/:
msgid "File"
msgstr "文件"
msgid "Edit"
msgstr "编辑"
msgid "View"
msgstr "查看"
bioinfoserv@BioInfoServOS:/$ msgfmt -o InfoServFaster.po InfoServFaster.mo现在运行InfoServFaster.bin试试, 是不是汉化了:
bioinfoserv@BioInfoServOS:/$ sudo cp -f InfoServFaster.mo /usr/share/locale/zh_CN/LC_MESSAGES/
bioinfoserv@BioInfoServOS:/$ ./InfoServFaster.bin
文件
编辑
查看
11. 系统定制镜像备份
系
统定制后,建议您最好建立系统的硬盘分区映像,这样一旦系统出现问题,我们就可以快速地恢复系统。建立系统硬盘分区映像有多
种方式,如果 您同时安装有windows分区,您还可以在windows下对BioInfoServ Desktop
1.0分区进行映像。当然如果没有,建立映像的方式最好采用具有映像软件的光盘来进行。
通
常,我们采用Norton
Ghost来进行。此外,我们还可以利用TrueImage工具光盘中硬盘映像工具来进行。Ghost for Linux是一个
linux启动环境来进行的硬盘分区克隆光盘,操作也是很方便的。此外,采用live cd
光盘制作的方法也可以打包系统,主要采用的工具是mkisofs,这个工具的情况可以参
看下面的内容。
利
用Norton Ghost映像的文件,可以在windows下采用Ghost
Explorer开打开查看、编辑和提取。而在linux下,这样的映像文件,只需要mount命令就可以做到。具体细节,您还可以参看http://bioinfoserv.vicp.net中
的相应文档,下面的镜像操作是在windows下进行的.
6.1. 系统的备份/镜像:
应该来说叫系统镜像,很多人在windows下采用ghost来 作 windows的镜像,其实它完全也可以用来来作linux的镜像。当然这个操作在windows下来做.具体方法如下:
先下载ghost for windows
然后打开 GHOST32.EXE,如下图:
操作从local开始,disk菜单包含两个功能:把磁盘镜像和 恢复到磁 盘,其下级菜单三个选项:
to disk:磁盘到磁盘的镜像/拷贝
to image:磁盘到映像文件的拷贝
from image:从映像文件拷贝到磁盘(系统恢复)
而partion菜单,只是分区上的镜像操作,非整个磁盘的操 作,这个选项 通常对我们备份系统最有用.
to partion:分区到分区的镜像/备份
to image:把分区镜像到映像文件
from image:从映像文件恢复到分区
有个上面的基本知识,那么我们开始来镜像我们的linux分区 吧:
这里选择:partion—to image be分区镜像到一个映像文件:
由于此处linux分区在第一个磁盘的第二分区,点击第一个磁盘,按”OK”进入,如下图:
点击linux分区,然后按”OK’,进入下一步,选择映像文件存放的地方(当然要保证这个地方有足够的磁盘空
间),并给映像文件取个名字:
如果没有足够的空间,程序会提示您的是否压缩,当然选择压缩了(选择high吧,这样影响文件不会占用较大的磁盘空间):
如果采用压缩空间都还不够,会再次提示是否”spanning”(真的生成?),选择”
yes”:
接下来是问是否进行文件的创建了,”yes”吧,看见对话框背后的那个图像没,那就是镜像进行的界面,离文件创
建就只差这个对话框了:
镜像文件完成,还可以采用Ghostexp.exe来打开查看和编辑:
采用local–> partion–>from image选择刚才已经做好的镜像文件,然后选择需要还原到分区位置,这是就会开始系统镜像还原 安装系统:
采用系统还原安 装 BioInfoServOS 1.1,默认推荐采用的分区结构示意图如下,即linux分区位于磁盘(master)的第二分区(大小至少10G),交换分区位于第3分区(大小为您的 内存2倍),这种镜像恢复安装的方式,会让您最大限度地减少恢复镜像安装后的配置而可立即体验系统.请您按照上面所提及的默认分区方式采用 PartionMagic工具,对您的硬盘分区做调整,尽管PartionMagic支持无损数据磁盘调整,但还是建议您最好对您的重要数据做备份.或 者,您使用一个没有重要数据的磁盘按照上面的分区方式进行分区.

这样就完成系统的镜像还原安装,如果系 统启动后不能运行图形登陆界面,那么 采用ctrl+alt+F2切换到终端,输入sudo dpkg-reconfigurexserver-xorg对您的硬件驱动进行重新配置,多数情况下,这个配置程序会自动地探测适合您的驱动程序,您所做 的就是只需要按其默认值进行确认就可以了.如果您启动后不能正常通过菜单启动系统,那么请您按照"添加Grub菜单项" 所提及的方法进行.进入到正常启动后,如果不能启动图 形界面,请按照上面刚刚采用的方法进行.
系 统备份其实还有更多方式,很多情况下,我们只需要备份安装设置就可以了:
系统软件安装备份:
/etc/apt/sources.list备份
/home/$yourname备份
/var/cache/apt/archives备份
/var/cache/lib/list备份}
/usr/share/themes,主要是自己特色的themes备份
/usr/share/icons 主要是自己特色的icons备份
/usr/share/applications程序运行菜单
/usr/lib/usplash系统启动splash动态画面
/usr/share/fonts系统字体备份
/usr/share/doc系统帮助文件,主要备份经过重新编写的文档,如系统使用说明文档。
/var/lib/mysql数据库mysql数据备份
/var/www定制的网站管理或者网页备份
以上恢复只需要将文件拷贝回原来的目录就可以了。
dpkg –get-selections > installed-software.log软件安装目录备份(恢复时,只需要dpkg –set-selections < installed-software.log,然后dselect安装就可以了。不过值得注意的是dselect本身不能正确保证哪些软件该先安装,哪 些后安装,这样安装的结果可能会导致某些软件运行不正常),当然您可以使用以下的命 令来安装本系统所定制的软件:
apt-get -f install acroread acroread7-fonts-zh alien anacron apache2 apache2-common apache2-mpm-prefork apache2-utils azureus baobab basket beagle beryl beryl-core beryl-dbus beryl-dev beryl-manager beryl-plugins beryl-plugins-data beryl-settings bioinfoserv-arb bioinfoserv-artemis bioinfoserv-base-directories bioinfoserv-blast bioinfoserv-clcworkbench bioinfoserv-documentation bioinfoserv-dotter bioinfoserv-emboss bioinfoserv-msatfinder bioinfoserv-seaview bioinfoserv-staden bioinfoserv-stars bioinfoserv-themes bioperl bitmap bum chmsee clustalw clustalx deborphan dfontmgr dia dia-common dia-libs dialog dict dict-jargon dictd dictionaries-common dictzip diff discover1 discover1-data easychem easywine education-chemistry education-graphics education-mathematics education-tasks emerald eva evince-gtk evms evms-ncurses evolution-data-server f-spot firestarter flashplugin-nonfree freemind freemind-plugins-time garlic gcolor2 gedit gedit-common ghemical gnome-art gnome-bin gnome-icon-theme gnome-keyring gnome-libs-data gnome-media gnome-mime-data gnome-splashscreen-manager gnome-system-monitor gproftpd gqview grsync grub-splashimages gstreamer0.10-alsa gstreamer0.10-plugins-base gstreamer0.10-plugins-farsight gstreamer0.10-plugins-good gstreamer0.8-misc gstreamer0.8-theora gstreamer0.8-x gthumb gtkorphan hardinfo imagemagick isomaster istanbul j2re1.4 j2re1.4-mozilla-plugin j2sdk1.4 java-common k3b kleansweep kontact kopete kubuntu-grub-splashimages linux-386 linux-image-2.6.15-28-386 linux-image-386 linux-kernel-headers lvm-common lvm2 lynx meld menu-xdg mondo mono-classlib-1.0 mono-common mono-jit moodle moodle-book mysql-admin mysql-admin-common mysql-client-5.0 mysql-common mysql-server mysql-server-5.0 nvidia-kernel-common nvu opera orage partimage partimage-server perl perl-base perl-byacc perl-modules perl-tk perlprimer php4-common php5-cgi php5-cli php5-common php5-gd php5-mysql php5-mysqli phpmyadmin prelink proftpd pymol python python-apt python-bibtex python-celementtree python-crypto python-editobj python-glade2 python-gnome2 python-gnome2-desktop python-gnome2-extras python-gnupginterface python-gst python-gtk2 python-imaging python-imaging-tk python-matplotlib python-matplotlib-data python-minimal python-numeric python-opengl python-pmw python-rpy python-scipy python-sqlite python-support python-tk python-tz python-uno python-vte python-wxgtk2.6 python-wxversion python-xml python2.3 python2.3-imaging python2.4 python2.4-apt python2.4-cairo python2.4-celementtree python2.4-crypto python2.4-dev python2.4-egenix-mxtexttools python2.4-egenix-mxtools python2.4-elementtree python2.4-glade2 python2.4-gnome2 python2.4-gnome2-desktop python2.4-gnome2-extras python2.4-gobject python2.4-gtk2 python2.4-imaging python2.4-imaging-tk python2.4-irclib python2.4-matplotlib python2.4-minimal python2.4-mysqldb python2.4-numeric python2.4-numeric-ext python2.4-opengl python2.4-pyorbit python2.4-reportlab python2.4-rpy python2.4-scipy python2.4-scipy-core python2.4-sqlite python2.4-tk python2.4-tz python2.4-xml readseq rpm scilab scilab-bin scribus sed sim4 squashfs-tools stardict stardict-common stardict-dic-21shijishuangxiangcidian stardict-dic-21shijishuangyukejicidian stardict-dic-hanyuchengyucidian stardict-dic-langdao-ce-gb stardict-dic-langdao-ec-gb stardict-dic-longman-contemporary stardict-dic-merrianwebster stardict-dic-ncce-ce stardict-dic-ncce-ec stardict-dic-xdict-ce-gb stardict-dic-xiangya-medical stardict-dictd-www.mova.org- stardict-hanzim stardict-jedict stardict-oxford-gb sun-java5-bin sun-java5-demo sun-java5-fonts sun-java5-jdk sun-java5-jre sun-java5-plugin sysv-rc sysv-rc-conf unison-gtk vboxsharedfolder virtualbox vlc vlc-plugin-alsa vmware-player vmware-player-kernel-modules vmware-player-kernel-modules-2.6.15-27 wine xbs xfburn xfig xserver-xgl xserver-xorg xserver-xorg-core xserver-xorg-driver-all xserver-xorg-driver-vmware zim revelation unison dvr gbib testdisk gddrescue mac med-bio med-common cdd-common octave gxfboot
对于有些软件未在在sources.list的列表中,那么需要 下载相应的 deb来安装,下面是采用dpkg来安装已经下载的软件(这些软件在/home/bioinfoserv/bak/deb/下):
dpkg -i -f install avast4workstation_1.0.7-2_i386.deb beepmp-wma_1.0.5-1_i386.deb bmp-mac_0.1.1-1_i386.deb bmp-xlyrics_0.4.6-2_i386.deb eioffice_4.1.1816.101zh.sv1-3_all.deb filezilla_3.0.0beta2-getdeb1~dapper_i386.deb libfltk1.1c102_1.1.4+1.1.5rc1-1_i386.deb med-bio_0.10.1_all.deb multiget_1.1.2-0getdeb1_i386.deb nerolinux-2.1.0.3-x86.deb picasa_2.2.2820-5_i386.deb prozgui_2.0.5betaa-1_i386.deb referencer_1.0.0-0getdeb1_i386.deb scicraft-ng_0.52.0_all.deb searchmonkey_0.8.0-0getdeb1_i386.deb uck_1.3_all.deb wengophone-0.958m-1.i386.deb xorg-edit_07.01.28-0ubuntu1_i386.deb
如果您发现上面的命令不能拷贝到终端中直接执行,那么新建一个文 档,并把命 令存入文档中,然后保存为*.bin文 件,这样就可以在终端下采用sudo ./*.bin来执行安装。例如,前面第一个apt-get -f install命令,可以保存为aptinstall.bin,后面的一个可以保存为dpkginstall.bin,现在在终端中执行sudo ./aptinstall.bin和sudo ./dpkginstall.bin 就可以完成安装。本系统下载的软件在/home/bioinfoserv/bak/deb下,只要在终端下进入这个目录,然后执行sudo ./dpkginstall.bin 即可。
光盘制作是个比较复杂
的过程,不过现在在Ubuntu中,利用Resconstruction和UCK可以很好的完成这些工作,至于更多的制作教程,可以去http://www.livecdlist.com/wiki/index.php/LiveCD_Creation_Resources查
看更多的制作教程,这个网页提供从windows到Linux各种发行版本的制作连接教程,实在不可多得。
在实际制作过程中,您可以使用UCK、Reconstructor和remastersys这三个
工具,利用它们可以很简单
的完成所有定制工作。以下这几个软件的使用界面:
Reconstructor:
图中的working Directory是工作目录,Live
CD ISO FileName所指定的光盘文件文件(ISO)。

点 击下一步会将将光盘文件进行抽 提,得到下图的三个文件夹:

其
中,initrd包含的文件夹有
如下:
bin:包含系统光盘启动是的一些必须命令,如磁盘分区挂载、启动顺序、文件系统识别、压缩文件包的解压读取等。
conf:光盘系统启动的配置文件,如系统的架构类型(i386)、加载的基本模块(capability, vesafb, fbcon, unix)等。
etc:包括EVMS配置、kernel加载配置、光盘系统登录名设定(etc/casper.conf)(您可对export USERNAME="bioinfoserv"
export USERFULLNAME="BioInfoServ Live CD User"
export HOST="BioInfoServOS"
export BUILD_SYSTEM="Ubuntu"等进行重新设定。
init:光盘启动过程中所需要建立的文件系统目录配置等。
lib:光盘系统需要加载的库文件(如libc,libevms,内核的版本类型)。
modules:
sbin:
scripts:启动脚本(就是系统启动过程中所显示的那些过程,如用户添加、硬件识别、驱动加载等)。
usr:光盘的Usplash配置。
remaster
则包含了一个正常
光盘所见到的文件系统,如下图:

其中,isolinux
就是包含了光盘启动时的画面、菜单和帮助文件配置。
而root目录则为光盘安装到硬盘上的文件目录系统,即通常表现在硬盘上的BioInfoServOS Linux文件目录系统,如下图:

得 到以上3个文件目录 initrd, root, remaster后,现在就利用它们可以进行定制了,如下图:

可 以点击图中的Terminal,然后得到一个虚拟终端,在这里我们可以对虚拟系统进行软件的安装、删除、系统文件的配置和修改,然后完成之后,将它们重新 进行打包,从而得到一个可以刻录到空白光盘上的启动光盘文件。
UCK 其原理与Reconstructor一样,需要将原始光盘进行解压,然后对解压后的光盘目录进行修订、配置和重新打包。而remastersys则是将真实运行在硬盘的系统进行光盘打包。它不 需要额外的原始光盘,其来得更加直接,这与前文所提及的镜像备份差不多,不过采用它打包后的光盘文件刻录到空白光盘上后,是可以用来启动、安装(而不仅仅 是备份系统和恢复而已),如下图:

如 上图,将鼠标移至"Modify Modify the remastersys config file to customize..."双点击,可得到下图:

可 修改相应的参数,如设置默认的登录用户名(bioinfoserv),光盘的名称(BioInfoServOS)和工作目录等。只有剩下的工作就很简单 了,你可以在真实的系统下进行系统的配置、修改、定制等工作,然后再采用它进行光盘的制作。
下 面的文字节选编译自http://www.ubuntuforums.org/showthread.php?t=89491, 它可以帮助您理解采用上面这三个工具进行制作的过程:
系
统要求
大约3-5G的磁盘空间
为了快速制作CD,最好具有512M内存和G交换分区.
工具squashfs-tools
工具mkisofs
支持squashfs的内核
(DapperDrake
已经具备好了)
虚拟机vmware或者qEMU(推荐使用vmware-player)
步骤
首先保证 您已经安装了必要的工具(vmaware-player用来测试制作成功的光盘ISO)
sudo apt-get install squashfs-tools mkisofs vmware-player
加 载squashfs模块
sudo modprobe squashfs
下 载BioIndoServOSLiveCD1.1.iso光盘 ISO,将ISO光盘文件拷贝到一个空目录中
mkdir ~/live
mv BioIndoServOSLiveCD1.1.iso ~/live
cd ~/live
加 载ISO光盘文件
mkdir mnt
sudo mount -o loop BioIndoServOSLiveCD1.1.iso mnt
解 压ISO文件到目录 extract-cd中
mkdir extract-cd
rsync --exclude=/casper/filesystem.squashfs -a mnt/ extract-cd #extract-cd这个相当于在reconstructor程序下构建remaster目录,
其文件目录结构接近安装光盘文件结构(下图)。实际上光盘定制就是重建filesystem.squashfs,而filesystem.squashfs就是把安装在硬盘的ubuntu系
统文件目录进行打包的一个大文件。live cd就是依据这个文件来重建系统文件结构,使其不需要硬盘就能正常运行ubuntu系统。因此,一张live cd光盘的大小
就是由这个文件大小来决定的。

加 载squashfs文件系统
mkdir squashfs
sudo mount -t squashfs -o loop mnt/casper/filesystem.squashfs squashfs
抽 提squashfs文件内容到编 辑目录edit
mkdir edit
sudo cp -a squashfs/* edit/ #这个命令就是解压filesystem.squashfs,使其还原ubuntu系统文件目录和文件(下图),系统光盘定制就是先利用这
个系统文件目录进行个性化的设置和软件选择安装,然后将这个系统文件目录和文件重新打包成光盘文件中的filesystem.squashfs。在这个过程中将会虚拟加载
成正常的ubuntu运行系统,在这个虚拟的系统中可以进行正常的软件安装、卸载和配置(不过不可以进行带有图形界面的软件安装和配置)以及系统清理、设置和管
理。

如 果您需要网络连接,那么使用chroot
sudo cp /etc/resolv.conf edit/etc/
为 了配置,同时,您可能还需要拷贝业 已个性化在本地硬盘的host文件
sudo cp /etc/hosts edit/etc/
sudo chroot edit
mount -t proc none /proc
mount -t sysfs none /sys
为 了避免本地化问题和为了导入GPG钥匙,需要如下操作
export HOME=/root
export LC_ALL=C
按 大小查看已经安装的软件包
dpkg-query -W --showformat='${Installed-Size} ${Package}\n' | sort -nr | less
卸 载您所不需要的软件包和删除孤立 软件包
apt-get remove --purge package name
孤立软件采用deborphan来清理:
deborphan #可以列出当前要定制系统中的孤立软件;
deborphan |xargs apt-get -s -y remove #可以在删除孤立软件前作对话提示;
deborphan |xargs apt-get -y remove #可以立即执行孤立软件的执行工作。
通 常背景图片放置在 /usr/share/backgrounds, 您可以编辑/var/lib/gconf/debian.defaults/ %gconf-tree.xml和改变/usr/share/backgrounds/warty-final-ubuntu.png 的文字以指到您的文件夹;
修 改extract-cd中README.diskdefines的描述和isolinux文件夹下的 splash.rle(这个如何进行,参看前文)、 图片及相应的 f1.txt-f10.txt中的描述;
修 改/usr/lib/usplash下的usplash-arwork.so,至于这个 usplash.so如何制作和更换,请参看前文; 而/usr/share/xdg -session/xfce4-session.rc中可以设置splash engine,而通常的可直接替换的balou位于/usr/share/themes/default中,
修 改或者添加您的theme文件和icons文件到/usr/share/themes/您所采用的桌面风 格theme文档名称; /usr/share/icons/default/您所采用的图标文件名称,同时鼠标风格文件一般也位于这个目录,利用本系统使用的mac鼠标风格 pathex就位于此处(/etc/alternatives/中也有涉及到鼠标风格);/usr/share/gdm/themes/您的gdm登录 theme文件名称;它们的配置文件在/var/lib/gconf/debian.defaults/%gconf -tree.xml中;
修 改或者编写系统帮助文档:/usr/doc/ (这个需要在系统菜单中指定把帮助文档的路径指定到这个目录下您所编写的系统帮助文档),本系统的帮助文件备份在 /home/bioinfoserv/bak/usr/doc/bioinfoserv 下,只需要复制覆盖到/usr/share/doc/bioinfoserv下就可以了;
修 改和编写系统程序菜单文件:路径在/usr/share/applications/下,本系统已经在 /home/bioinfoserv/bak中有备份,您只需要在执 行相应的软件安装后, 拷贝这些文件到这个目录中进行覆盖就可以了。而这个系统程序文件菜单的分类,需要编辑/etc/xdg/xfce4/desktop/menu.xml和 xfce-registered-categories.xml.zh_CN.xml(注意/etc/xdg/, /etc/gdm/, /usr/share/gdm和/etc/ske/下隐藏文件,它们可以影响到整个系统,乃至live cd制作的桌面背景、theme、鼠标和菜单)。 本系统同样已经有它们的备份,同样复制到相应的路径下覆盖就可以 了;
至 于系统随机启动服务定制,可以采用sysv-rc-conf来进行,对系统服务的描述,参看从头开始优化ubuntu;
个 性化的操作必须在chroot权限之外来进行
sudo -s
apt-get source gfxboot-theme-ubuntu gfxboot dpkg-dev
cd gfxboot-theme-ubuntu*/
make DEFAULT_LANG=zh_CN #实际是修改isolinux下的langlist中的配置
sudo cp -af boot/* ../extract-cd/isolinux/
exit
如 果DEFAULT_LANG为zh_CN(中文),那么修改成 您所愿意的,如en(英文)。注意这个不会改变F2菜单中的语言设置(如果要修改,那么就直接配置lang这个文件,将其至于zh_CN就可以将F2至于 中文了),更多的信息,可以参看Ubuntu Customization Kit.
如 果您想定制启动进程,您可以修改live cd的内核,这个操作只需要拷贝extract-cd/casper下的vmlinuz 和 initrd即可。注意不要忘记采用apt-get 取得正确的内核以符合livecd one,具体操作如下:
sudo cp /boot/vmlinuz-2.6.15-26-k7 extract-cd/casper/vmlinuz
sudo cp /boot/initrd.img-2.6.15-26-k7 extract-cd/casper/initrd.gz
您 可以编辑/usr/share/initramfs-tools/scripts/casper- bottom/* ,例如,您可以改变hostname 或者ivecd user.,如下:
sudo nano edit/usr/share/initramfs-tools/scripts/casper
编 辑username或者 hostname
sudo nano edit/usr/share/initramfs-tools/scripts/casper-bottom/10adduser
甚 至编辑livecd user的使用密码。为了能保存加密的密码,您需要使用mkpasswd程序。
对 于要升级内核版本,主要将新的内核版本拷贝至initrd/lib/modules/下即可:如
initrd/lib/modules/2.6.15-23-386
或initrd/lib/modules/2.6.15-51-386
修 改内核、 init脚本,或者添加新的内核模组后,您需要重建initrd.gz文件以及将其替代至casper目录。
mkinitramfs -o /initrd.gz 2.6.15-26-k7
用live cd的启动内核取代成新的版本。
退 出chroot监听,并将此文件移动至extract-cd/casper:
exit
mv edit/initrd.gz extract-cd/casper/
如 果是制作live cd,请一定要删除不需要的临时文件,因为一张CD的空间目前最多也就700M,当然如果您制作live dvd的话,您可以依据情况来清理:
apt-get clean
或 者删除临时文件目录
rm -rf /tmp/*
或 者重新命名DNS服务器:nameserver
rm /etc/resolv.conf
现 在卸挂载以下文件系统,并退出chroot
umount /proc
umount /sys
exit
重建清单
chmod +w extract-cd/casper/filesystem.manifest
sudo chroot edit dpkg-query -W --showformat='${Package} ${Version}\n' > extract-cd/casper/filesystem.manifest
sudo cp extract-cd/casper/filesystem.manifest extract-cd/casper/filesystem.manifest-desktop
sudo sed -ie '/ubiquity/d' extract-cd/casper/filesystem.manifest-desktop
压 缩文件系统
sudo rm extract-cd/casper/filesystem.squashfs
sudo mksquashfs edit extract-cd/casper/filesystem.squashfs
设 定extract-cd/README.disk中的映 像名称
sudo vim extract-cd/README.diskdefines
删除旧的 md5sum.txt文件,产生新的md5 sums
sudo -s
rm extract-cd/md5sum.txt
(cd extract-cd && find . -type f -print0 | xargs -0 md5sum > md5sum.txt)
exit
刻录ISO光盘文件
cd extract-cd
sudo mkisofs -r -V "$IMAGE_NAME" -cache-inodes -J -l -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot
-boot-load-size 4 -boot-info-table -o ../BioIndoServOSLiveCD1.1.iso .
使 用vmware-player进行测试(注意vmware-player的使用前提,必须先启动它的相关 服务,否则会报错,其服务启动命令为/etc/init.d/vmware-player start),至于创建虚拟机 ,采用www.easyvmx.com
如果在虚拟机中测试正常,那么 您就大功告成了,恭喜您,可以进行光盘刻录了。cdrecord dev=/dev/cdrom ubuntu-6.06.1-desktop-i386-custom.iso