环境说明
Debian 8(Jessie)
更改国内源,加快打包速度
配置
注意:执行lb config命令会重置auto/config文件的配置,一定要先备份配置文件再执行此命令。
安装标准软件
# echo '! Packages Priority standard' > config/package-lists/standard.list.chroot
安装软件
# echo "ntpdate python python-pip openvpn easy-rsa supervisor ssh python2.7-dev shellinabox" > config/package-lists/vpn.list.chroot
安装debian-installer
# echo debian-installer-launcher > config/package-lists/installer.list.chroot
添加系统源:
echo "deb http://ftp.debian.org/debian/ jessie main" > config/archives/live.list.chroot
echo "deb http://ftp.debian.org/debian/ jessie main" > config/archives/live.list.binary
自定义内容
例如:内容放置目录为config/includes.chroot
# mkdir -p config/includes.chroot/var/www
# cp /path/to/my/index.html config/includes.chroot/var/www
Hooks
脚本放置目录:config/hooks/
*.hook.chroot
*.hook.binary
脚本:
echo "HOOK: Load ip forward"
echo 1 > /proc/sys/net/ipv4/ip_forward
sed -i 's/#net.ipv4.ip_forward=1/net.ipv4.ip_forward=1/g' /etc/sysctl.conf
sysctl -p
echo "HOOK: Config openvpn"
cd /etc/openvpn/
cp /usr/share/doc/openvpn/examples/sample-config-files/server.conf.gz ./
cp /usr/share/doc/openvpn/examples/sample-config-files/client.conf ./
cp /usr/share/easy-rsa/* ./
gunzip server.conf.gz
echo "HOOK: Config supervisor"
sed -i '$i\/usr/bin/supervisord' /etc/rc.local
Customizing the binary image
label install
menu label ^Test Install
linux /install/vmlinuz
initrd /install/initrd.gz
append vga=788 @APPEND_INSTALL@ -- quiet
menu hshift 0
menu width 82
menu title Boot Menu
include install.cfg
menu clear
splash.svg --> splash.png
Customizing Debian Installer by preseeding
# echo "d-i debian-installer/locale string en_US" >> config/includes.installer/preseed.cfg
# vim config/includes.installer/preseed.cfg
创建镜像
(责任编辑:IT) |