links for 2009-07-03
-
计算机解开有关美国开国元勋的密码
-
小花牛的新博客
Debian Live 是一款制作可从移动介质直接启动的 Linux 系统的工具,支持生成 iso 镜像,USB 磁盘镜像和 NFS 镜像。
Debian Live 定制性很强,下面简单介绍几项定制内容:
1. 定制 Debian Mirror 地址
如果你的工作机无法访问官方 mirror,一定要通过下面 lh_config 的 5 个参数,配置可以访问的 mirror:
lh_config
[-m|--mirror-bootstrap URL]
[--mirror-binary URL]
[--mirror-binary-security URL]
[--mirror-chroot URL]
[--mirror-chroot-security URL]2. 定制 syslinux splash 图像
syslinux 使用一种特殊的图像格式(RLE 或 LSS),需要用下面的方法准备:
ppmtolss16 '#d0d0d0=7' < splash.ppm > splash.rle
得到 LSS 格式的图像之后,需要:
LH_SYSLINUX_SPLASH="config/binary_syslinux/splash.rle"
然后 lh_clean && lh_build 生成新的镜像。
3. 定制默认用户配置
Debian 以及其他 Linux 发行版在创建新用户时,会将 /etc/skel 目录下的所有文件复制到新用户 HOME 目录下。借助这一特色,可以通过将配置文件放在 /etc/skel 目录下,起到默认配置的作用。
Debian Live 系统每次启动时会生成全新用户 HOME 目录,同样会拷贝 /etc/skel 目录下的所有文件。因此需要将配置文件放入 Debian Live 系统的 /etc/skel 目录下。
在 config/chroot_local-includes/ 目录下,创建 etc/skel 子目录,在生成 binary 时,这些文件会自动拷贝到文件系统上。
lh_clean && lh_build 生成新的镜像。
4. 定制 splashy
splashy 可以在系统启动时,显示图形化的进度栏。splashy 的定制过程如下:
#!/bin/sh splashy_config -s debian-moreblue || true update-initramfs -u -k all
最后,lh_clean && lh_build 生成新的镜像。
5. 定制 usplash
usplash 与 splash 类似,同样可以显示图形化启动进度。由于 splashy 不支持 initramfs,有一部分启动过程无法图形化,而 usplash 能弥补这一缺陷。
6. 最小化生成 image
通常减少 Debian/Linux 系统空间的方法无外乎:1 删除不用的 locale 信息,2 删除 APT 缓存。可以参照上面定制过程,在 config/chroot_local-hooks/ 目录下,创建 hooks 脚本实现。
#!/bin/sh rm -r /var/lib/apt/lists/mirror.ivic.org.cn* rm -r /var/cache/apt/*.bin debconf-set-selections <<EOF debconf localepurge/nopurge select en, en_US.UTF-8 debconf localepurge/nopurge seen true debconf localepurge/mandelete select true debconf localepurge/mandelete seen true debconf localepurge/dontbothernew select false debconf localepurge/dontbothernew seen true debconf localepurge/showfreedspace select true debconf localepurge/showfreedspace seen true debconf localepurge/verbose select false debconf localepurge/verbose seen true debconf localepurge/quickndirtycalc select true debconf localepurge/quickndirtycalc seen true EOF dpkg-reconfigure -u -phigh localepurge
最后 lh_clean && lh_build 生成新的镜像。
7. 使用 fluxbox
fluxbox 是一款小巧的 X Window Manager。生成使用 fluxbox 的 Debian Live 系统的过程如下:
## LH: Fluxbox #include <standard-x11> fluxbox gdm ##desktop-base
最后 lh_clean && lh_build 生成新的镜像。
debconf 是 Debian 使用的一种软件包配置方法。支持 debconf 的软件在安装时,会弹出对话框,要求用户输入一定配置参数。
在非交互式环境下安装这类软件,用户无法在线提供软件的配置项。因此用户需要通过 dpkg-preconfigure 预先指定软件配置。
目前 dpkg-preconfigure 的用法比较奇怪。没有非常完美的用法,总觉得怪怪的。下面这个方案应该是我从网上可以找到,综合比较靠谱的。
1. 导入 debconf 模板
debconf 模板包含软件的配置项的名称、说明、默认值等内容。一般来说 debconf 模板是包含在 deb 包中。由于需要在安装 deb 时自动提供软件配置,所以需要在安装 deb 包之前,提前导入 debconf 模板。过程如下。
不完美的地方就在这里:导入一个软件的配置项,竟然要用三个命令。总觉得应该一个命令搞定。。。
2. 指定 debconf 配置
模板导入之后,可以使用 debconf-set-selections 设置软件配置。用下面的命令:
# debconf-set-selections debconf mysql-server-5.0/start_on_boot select true debconf mysql-server-5.0/start_on_boot seen true (ctrl+d)
上面命令将 mysql-server-5.0/start_on_boot 设置为 true,并且设置配置项已经显示(区分配置项的值是默认值,还是用户输入值)。一般来说,软件安装时,只会显示 seen 为 false 的那些配置参数。
如果不知道软件有哪些配置选项,可以用 debconf-show 看到:
# debconf-show mysql-server-5.0 mysql-server/root_password_again: (password omitted) * mysql-server/root_password: (password omitted) mysql-server-5.0/really_downgrade: false mysql-server-5.0/need_sarge_compat: false mysql-server-5.0/start_on_boot: true mysql-server/error_setting_password: mysql-server-5.0/nis_warning: mysql-server-5.0/postrm_remove_databases: false mysql-server-5.0/need_sarge_compat_done: true mysql-server/password_mismatch:
上面每行输出中第一个 * 表示 seen 为 true,没有星号表示 seen 为 false;每行输出中,冒号前面配置项,冒号后是值。
3. 安装软件
如果所有的 debconf 选项都通过上面的方法设置完毕。用下面的方法安装
apt-get install mysql-server-5.0
此时应该不会显示 debconf 的对话框。
设置 Thunderbird 的参数,适合显示 Plaintext 邮件。
Account Settings
Menu View
Tools –> Options –> Display -> Formatting
Tools –> Options –> Compositions -> General
Tools –> Options –> Advanced
最近评论