自制Debian自動安裝光盤

定製光盤

  1. 將原生第1張DVD系統安裝盤掛載到 /mnt/dvd1 目錄
mount -t iso9660 -o ro,loop debian-8.2.0-amd64-DVD-1.iso /mnt/dvd1
  1. 建立基礎目錄,安裝光盤刻錄軟件。
apt-get -y install genisoimage
mkdir -pv ~/jessie-iso/isolinux
cp -fv /mnt/dvd1/isolinux/{ldlinux.c32,isolinux.bin,vesamenu.c32} ~/jessie-iso/isolinux
cp -fv /mnt/dvd1/install.amd/gtk/{vmlinuz,initrd.gz} ~/jessie-iso/isolinux
  1. 編輯光盤啓動的引導文件 ~/jessie-iso/isolinux/isolinux.cfg :
default vesamenu.c32
prompt 1
timeout 300
menu hshift 8
menu width 66
# 30 秒超時
menu title BiliBili OS Installer Menu
default installgui
#
label installgui
	menu default
	menu label ^GTK install
	kernel vmlinuz
	append vga=788 initrd=initrd.gz ---

定製系統

  1. 使用 debootstrap 來生成 base 系統
apt-get -y --force-yes install debootstrap
mkdir ~/jessie-root
debootstrap --arch amd64 jessie ~/jessie-root http://mirrors.bilibili.co/debian/
mount -o bind /dev ~/jessie-root/dev  
mount -o bind /proc ~/jessie-root/proc
mount -o bind /sys ~/jessie-root/sys 
mount -o bind /dev/pts ~/jessie-root/dev/pts
  1. 用 chroot 切入後定製系統
LANG=C.UTF-8 chroot ~/jessie-root /bin/bash
apt-get -y install locales vim bash-completion openssh-server
dpkg-reconfigure locales
dpkg-reconfigure tzdata
apt-cache search linux-image
apt-get -y install linux-image-3.16.0-4-amd64
tasksel install standard
apt-get clean
  1. 製做安裝鏡像
genisoimage -o ~/jessie.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -J -V 'Bilibili' ~/jessie-iso
相關文章
相關標籤/搜索