<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>dipplum.com &#187; debian-live</title>
	<atom:link href="http://dipplum.com/tag/debian-live/feed/" rel="self" type="application/rss+xml" />
	<link>http://dipplum.com</link>
	<description>Be  the change you wanna see in the world</description>
	<lastBuildDate>Sat, 12 Nov 2011 07:38:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>定制 Debian Live</title>
		<link>http://dipplum.com/2009/06/20/customizing-debian-live/</link>
		<comments>http://dipplum.com/2009/06/20/customizing-debian-live/#comments</comments>
		<pubDate>Sat, 20 Jun 2009 08:47:38 +0000</pubDate>
		<dc:creator>li</dc:creator>
				<category><![CDATA[开源软件]]></category>
		<category><![CDATA[Debian]]></category>
		<category><![CDATA[debian-live]]></category>

		<guid isPermaLink="false">http://dipplum.com/2009/06/20/customizing-debian-live/</guid>
		<description><![CDATA[Debian Live 是一款制作可从移动介质直接启动的 Linux 系统的工具，支持生成 iso 镜像，USB 磁盘镜像和 NFS 镜像。 Debian Live 定制性很强，下面简单介绍几项定制内容： 1. 定制 Debian Mirror 地址 如果你的工作机无法访问官方 mirror，一定要通过下面 lh_config 的 5 个参数，配置可以访问的 mirror： lh_config &#91;-m&#124;--mirror-bootstrap URL&#93; &#91;--mirror-binary URL&#93; &#91;--mirror-binary-security URL&#93; &#91;--mirror-chroot URL&#93; &#91;--mirror-chroot-security URL&#93; 2. 定制 syslinux splash 图像 syslinux 使用一种特殊的图像格式（RLE 或 LSS），需要用下面的方法准备： 用 GIMP 编辑图像，不要超过 640&#215;400。 设置为 14 Indexed Color。如果图像已经为 Indexed Color，但超过 [...]]]></description>
			<content:encoded><![CDATA[<p>Debian Live 是一款制作可从移动介质直接启动的 Linux 系统的工具，支持生成 iso 镜像，USB 磁盘镜像和 NFS 镜像。</p>
<p>Debian Live 定制性很强，下面简单介绍几项定制内容：</p>
<p><strong>1. 定制 Debian Mirror 地址</strong></p>
<p>如果你的工作机无法访问官方 mirror，一定要通过下面 lh_config 的 5 个参数，配置可以访问的 mirror：</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">lh_config
            <span style="color: #7a0874; font-weight: bold;">&#91;</span>-m<span style="color: #000000; font-weight: bold;">|</span>--mirror-bootstrap URL<span style="color: #7a0874; font-weight: bold;">&#93;</span>
            <span style="color: #7a0874; font-weight: bold;">&#91;</span>--mirror-binary URL<span style="color: #7a0874; font-weight: bold;">&#93;</span>
            <span style="color: #7a0874; font-weight: bold;">&#91;</span>--mirror-binary-security URL<span style="color: #7a0874; font-weight: bold;">&#93;</span>
            <span style="color: #7a0874; font-weight: bold;">&#91;</span>--mirror-chroot URL<span style="color: #7a0874; font-weight: bold;">&#93;</span>
            <span style="color: #7a0874; font-weight: bold;">&#91;</span>--mirror-chroot-security URL<span style="color: #7a0874; font-weight: bold;">&#93;</span></pre></div></div>

<p><strong>2. 定制 syslinux splash 图像</strong></p>
<p>syslinux 使用一种特殊的图像格式（RLE 或 LSS），需要用下面的方法准备：</p>
<ul>
<li>用 GIMP 编辑图像，不要超过 640&#215;400。</li>
<li>设置为 14 Indexed Color。如果图像已经为 Indexed Color，但超过 14 种，应该先转换成 RGB 格式，再转换回 14 Indexed Color</li>
<li>另存为 PPM 格式</li>
<li>使用 syslinux 包中的 ppmtolss16，将 PPM 图像转换成 LSS</li>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ppmtolss16 <span style="color: #ff0000;">'#d0d0d0=7'</span> <span style="color: #000000; font-weight: bold;">&lt;</span> splash.ppm <span style="color: #000000; font-weight: bold;">&gt;</span> splash.rle</pre></div></div>

</ul>
<p>得到 LSS 格式的图像之后，需要：</p>
<ul>
<li>放入 config/binary_syslinux/ 下，假设文件名为 splash.rle</li>
<li>同时修改 config/binary，设置：</li>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #007800;">LH_SYSLINUX_SPLASH</span>=<span style="color: #ff0000;">&quot;config/binary_syslinux/splash.rle&quot;</span></pre></div></div>

</ul>
<p>然后 lh_clean &amp;&amp; lh_build 生成新的镜像。</p>
<p><strong>3. 定制默认用户配置</strong></p>
<p>Debian 以及其他 Linux 发行版在创建新用户时，会将 /etc/skel 目录下的所有文件复制到新用户 HOME 目录下。借助这一特色，可以通过将配置文件放在 /etc/skel 目录下，起到默认配置的作用。</p>
<p>Debian Live 系统每次启动时会生成全新用户 HOME 目录，同样会拷贝 /etc/skel 目录下的所有文件。因此需要将配置文件放入 Debian Live 系统的 /etc/skel 目录下。</p>
<p>在 config/chroot_local-includes/ 目录下，创建 etc/skel 子目录，在生成 binary 时，这些文件会自动拷贝到文件系统上。</p>
<p>lh_clean &amp;&amp; lh_build 生成新的镜像。</p>
<p><strong>4. 定制 splashy</strong></p>
<p>splashy 可以在系统启动时，显示图形化的进度栏。splashy 的定制过程如下：</p>
<ul>
<li>创建 config/chroot_local-hooks/01-splash.sh：</li>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
splashy_config <span style="color: #660033;">-s</span> debian-moreblue <span style="color: #000000; font-weight: bold;">||</span> <span style="color: #c20cb9; font-weight: bold;">true</span>
update-initramfs <span style="color: #660033;">-u</span> <span style="color: #660033;">-k</span> all</pre></div></div>

<li>chmod +x config/chroot_local-hooks/01-splash.sh</li>
<li>修改 config/chroot 文件，LH_PACKAGES 后增加两个包：splashy splashy-themes</li>
</ul>
<p>最后，lh_clean &amp;&amp; lh_build 生成新的镜像。</p>
<p><strong>5. 定制 usplash</strong></p>
<p>usplash 与 splash 类似，同样可以显示图形化启动进度。由于 splashy 不支持 initramfs，有一部分启动过程无法图形化，而 usplash 能弥补这一缺陷。</p>
<ul>
<li>参照 splashy 前两步，生成同样的 01-splash.sh 可执行脚本</li>
<li>修改config/chroot 文件，LH_PACKAGES 后增加两个包：usplashy usplash-theme-debian</li>
</ul>
<ul>最后，lh_clean &amp;&amp; lh_build 生成新的镜像。</ul>
<p><strong>6. 最小化生成 image</strong></p>
<p>通常减少 Debian/Linux 系统空间的方法无外乎：1 删除不用的 locale 信息，2 删除 APT 缓存。可以参照上面定制过程，在 config/chroot_local-hooks/ 目录下，创建 hooks 脚本实现。</p>
<ul>
<li>首先，修改config/chroot 文件，LH_PACKAGES 后添加 localepurge</li>
<li>创建 config/chroot_local-hooks/99-clean.sh 文件：</li>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/sh</span>
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-r</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>apt<span style="color: #000000; font-weight: bold;">/</span>lists<span style="color: #000000; font-weight: bold;">/</span>mirror.ivic.org.cn<span style="color: #000000; font-weight: bold;">*</span>
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #660033;">-r</span> <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>cache<span style="color: #000000; font-weight: bold;">/</span>apt<span style="color: #000000; font-weight: bold;">/*</span>.bin
&nbsp;
debconf-set-selections <span style="color: #cc0000; font-style: italic;">&lt;&lt;EOF
debconf localepurge/nopurge select en, en_US.UTF-8
debconf localepurge/nopurge seen true
&nbsp;
debconf localepurge/mandelete select true
debconf localepurge/mandelete seen true
&nbsp;
debconf localepurge/dontbothernew select false
debconf localepurge/dontbothernew seen true
&nbsp;
debconf localepurge/showfreedspace select true
debconf localepurge/showfreedspace seen true
&nbsp;
debconf localepurge/verbose select false
debconf localepurge/verbose seen true
&nbsp;
debconf localepurge/quickndirtycalc select true
debconf localepurge/quickndirtycalc seen true
EOF</span>
&nbsp;
dpkg-reconfigure <span style="color: #660033;">-u</span> <span style="color: #660033;">-phigh</span> localepurge</pre></div></div>

<li>chmod +x config/chroot_local-hooks/99-clean.sh</li>
</ul>
<p>最后 lh_clean &amp;&amp; lh_build 生成新的镜像。</p>
<p><strong>7. 使用 fluxbox</strong></p>
<p>fluxbox 是一款小巧的 X Window Manager。生成使用 fluxbox 的 Debian Live 系统的过程如下：</p>
<ul>
<li>修改config/chroot 文件，LH_PACKAGES_LISTS 后添加 fluxbox（替换 xfce/gnome/kde 等）</li>
<li>创建 chroot_local-packageslists/fluxbox，内容如下：</li>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">## LH: Fluxbox</span>
<span style="color: #666666; font-style: italic;">#include &lt;standard-x11&gt;</span>
&nbsp;
fluxbox gdm
<span style="color: #666666; font-style: italic;">##desktop-base</span></pre></div></div>

</ul>
<p>最后 lh_clean &amp;&amp; lh_build 生成新的镜像。</p>
]]></content:encoded>
			<wfw:commentRss>http://dipplum.com/2009/06/20/customizing-debian-live/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
	</channel>
</rss>

