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

环境说明:

debian 8(jessie)

更改下载源:

# 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/"

教程 1: A default image

$ mkdir tutorial1 ; cd tutorial1 ; lb config
# lb build 2>&1 | tee build.log

教程 2: A web browser utility

$ mkdir tutorial2
$ cd tutorial2
$ lb config
$ echo "task-lxde-desktop iceweasel" >> config/package-lists/my.list.chroot
# lb build 2>&1 | tee build.log

教程 3: A personalized image

第一版:

$ 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" >> 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."

第二版:

# lb clean
$ echo vlc >> config/package-lists/my.list.chroot
# lb build

$ git commit -a -m "Adding vlc media player."

教程 4:A VNC Kiosk Client (构建的镜像启动不成功)

$ mkdir vnc-kiosk-client
$ cd vnc-kiosk-client
$ lb config -a i386 -k 686-pae --apt-recommends false
$ echo '! Packages Priority standard' > config/package-lists/standard.list.chroot
$ echo "xorg gdm3 metacity xvnc4viewer" > config/package-lists/my.list.chroot
$ apt-cache depends live-config live-boot
$ echo "live-tools user-setup sudo eject" > config/package-lists/recommends.list.chroot
$ mkdir -p config/includes.chroot/etc/skel
$ cat > config/includes.chroot/etc/skel/.xsession << EOF
#!/bin/sh

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

exit
EOF
# lb build

教程 5:A base image for a 128MB USB key (构建的镜像启动不成功)

$ mkdir base-image && cd base-image
$ lb config --apt-indices false --apt-recommends false --debootstrap-options "--variant=minbase" --firmware-chroot false --memtest none
$ echo "user-setup sudo" > config/package-lists/recommends.list.chroot
# lb build 2>&1 | tee build.log

教程 6:A localized GNOME desktop and installer

# 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 && 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' > config/package-lists/standard.list.chroot
$ echo task-gnome-desktop task-chinese-s task-chinese-s-desktop >> config/package-lists/desktop.list.chroot
$ echo debian-installer-launcher >> config/package-lists/installer.list.chroot
# lb build
posted @   Varden  阅读(2826)  评论(1编辑  收藏  举报
(评论功能已被禁用)
编辑推荐:
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· 开发者必知的日志记录最佳实践
· SQL Server 2025 AI相关能力初探
· Linux系列:如何用 C#调用 C方法造成内存泄露
· AI与.NET技术实操系列(二):开始使用ML.NET
阅读排行:
· 无需6万激活码!GitHub神秘组织3小时极速复刻Manus,手把手教你使用OpenManus搭建本
· C#/.NET/.NET Core优秀项目和框架2025年2月简报
· Manus爆火,是硬核还是营销?
· 一文读懂知识蒸馏
· 终于写完轮子一部分:tcp代理 了,记录一下
点击右上角即可分享
微信分享提示