逆时针的回忆 發表於 2020-11-7 09:57:00

Debian live-build官方教程学习笔记

<h1 id="环境说明">环境说明:</h1>
<pre><code>debian 8(jessie)
</code></pre>
<h1 id="更改下载源">更改下载源:</h1>
<pre><code># vim /etc/live/build.conf
LB_MIRROR_BOOTSTRAP="http://ftp.cn.debian.org/debian/"
LB_MIRROR_CHROOT_SECURITY="http://ftp.cn.debian.org/debian-security/"
LB_MIRROR_CHROOT_BACKPORTS="http://ftp.cn.debian.org/debian-backports/"
</code></pre>
<h1 id="教程-1-a-default-image">教程 1: A default image</h1>
<pre><code>$ mkdir tutorial1 ; cd tutorial1 ; lb config
# lb build 2&gt;&amp;1 | tee build.log
</code></pre>
<h1 id="教程-2-a-web-browser-utility">教程 2: A web browser utility</h1>
<pre><code>$ mkdir tutorial2
$ cd tutorial2
$ lb config
$ echo "task-lxde-desktop iceweasel" &gt;&gt; config/package-lists/my.list.chroot
# lb build 2&gt;&amp;1 | tee build.log
</code></pre>
<h1 id="教程-3-a-personalized-image">教程 3: A personalized image</h1>
<p><strong>第一版:</strong></p>
<pre><code>$ mkdir -p tutorial3/auto
$ cp /usr/share/doc/live-build/examples/auto/* tutorial3/auto/
$ cd tutorial3
$ vim auto/config
#!/bin/sh

lb config noauto \
   --architectures i386 \
   --linux-flavours 686-pae \
   "${@}"
$ lb config
$ echo "task-lxde-desktop iceweasel xchat" &gt;&gt; config/package-lists/my.list.chroot
First, --architectures i386 ensures that on our amd64 build system, we build a 32-bit version suitable for use on most machines.
Second, we use --linux-flavours 686-pae because we don't anticipate using this image on much older systems.
Third, we have chosen the lxde task metapackage to give us a minimal desktop.
And finally, we have added two initial favourite packages: iceweasel and xchat.
# lb build

$ git init
$ cp /usr/share/doc/live-build/examples/gitignore .gitignore
$ git add .
$ git commit -m "Initial import."
</code></pre>
<p><strong>第二版:</strong></p>
<pre><code># lb clean
$ echo vlc &gt;&gt; config/package-lists/my.list.chroot
# lb build

$ git commit -a -m "Adding vlc media player."
</code></pre>
<h1 id="教程-4a-vnc-kiosk-client-构建的镜像启动不成功">教程 4:A VNC Kiosk Client (构建的镜像启动不成功)</h1>
<pre><code>$ mkdir vnc-kiosk-client
$ cd vnc-kiosk-client
$ lb config -a i386 -k 686-pae --apt-recommends false
$ echo '! Packages Priority standard' &gt; config/package-lists/standard.list.chroot
$ echo "xorg gdm3 metacity xvnc4viewer" &gt; config/package-lists/my.list.chroot
$ apt-cache depends live-config live-boot
$ echo "live-tools user-setup sudo eject" &gt; config/package-lists/recommends.list.chroot
$ mkdir -p config/includes.chroot/etc/skel
$ cat &gt; config/includes.chroot/etc/skel/.xsession &lt;&lt; EOF
#!/bin/sh

/usr/bin/metacity &amp;
/usr/bin/xvncviewer 192.168.1.2:1

exit
EOF
# lb build
</code></pre>
<h1 id="教程-5a-base-image-for-a-128mb-usb-key-构建的镜像启动不成功">教程 5:A base image for a 128MB USB key (构建的镜像启动不成功)</h1>
<pre><code>$ mkdir base-image &amp;&amp; cd base-image
$ lb config --apt-indices false --apt-recommends false --debootstrap-options "--variant=minbase" --firmware-chroot false --memtest none
$ echo "user-setup sudo" &gt; config/package-lists/recommends.list.chroot
# lb build 2&gt;&amp;1 | tee build.log
</code></pre>
<h1 id="教程-6a-localized-gnome-desktop-and-installer">教程 6:A localized GNOME desktop and installer</h1>
<pre><code># apt-get install dctrl-tools tasksel-data
$ grep-dctrl -FTest-lang zh /usr/share/tasksel/descs/debian-tasks.desc -sTask
Task: chinese-s
Task: chinese-t
$ grep-dctrl -FEnhances chinese-s /usr/share/tasksel/descs/debian-tasks.desc -sTask
Task: chinese-s-desktop
Task: chinese-s-kde-desktop
$ mkdir live-gnome-ch &amp;&amp; cd live-gnome-ch
$ lb config \
-a i386 \
--bootappend-live "boot=live components locales=zh_CN.UTF-8 keyboard-layouts=us" \
--debian-installer live
$ echo '! Packages Priority standard' &gt; config/package-lists/standard.list.chroot
$ echo task-gnome-desktop task-chinese-s task-chinese-s-desktop &gt;&gt; config/package-lists/desktop.list.chroot
$ echo debian-installer-launcher &gt;&gt; config/package-lists/installer.list.chroot
# lb build
</code></pre>


</div>
<div id="MySignature" role="contentinfo">
    <div id="AllanboltSignature">
    <div>作者:Varden</div>
    <div>出处:http://www.cnblogs.com/varden/</div>
    <div>本文内容如有雷同,请联系作者!</div>
    <div>本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。</div>
</div><br><br>
来源:https://www.cnblogs.com/varden/p/13939898.html
頁: [1]
查看完整版本: Debian live-build官方教程学习笔记