當前位置:編程學習大全網 - 源碼下載 - 如何制作定制的ubuntu鏡像

如何制作定制的ubuntu鏡像

具體操作如下:

壹、從零開始構建Ubuntu-Server系統安裝鏡像

1)、Debian-installer--initrd.gz、vmlinuz和isolinux/的制作

Debian-installer是Debian的系統安裝程序,ubuntu的server和alternate版都是使用Debian-installer作為系統安裝程序。Debian-installer是壹種字符界面的安裝程序,可以對系統安裝的軟件包進行定制。

1、使用Debian-installer的ubuntu分支的源碼

2、安裝構建Debian-installer的依賴包:sudoapt-get build-dep debian-installer

3、創建debian-installer所需的源列表sources.list.udeb.local,構建debian-installer時會根據本機的sources.list生成所需的sources.list.udeb,可根據需要創建合適的sources.list.udeb.local來代替sources.list.udeb。

例,在debian-installer源碼/build/下建立sources.list.udeb.local,其內容如下:

debcopy:/home/xin/work/version/debian-installer/build/ localudebs/

deb/ubuntu raring main/debian-installer

deb/ubuntu raring-securitymain/debian-installer

deb/ubuntu raring-updates main/debian-installer

deb/ubuntu raring-proposedmain/debian-installer

4、根據需要(光盤啟動、硬盤啟動和網絡啟動等)構建帶有debian-installer的內核文件,例如:makebuild_cdrom_isolinux

結果將在dest/目錄下生成如下文件:

├── cdrom

├──debian-cd_info.tar.gz

├── initrd.gz

└── vmlinuz

其中debian-cd_info.tar.gz內容為光盤啟動所需的syslinux相關文件,也可供debian-cd使用自動生成光盤鏡像。

5、定制:

config目錄下修改給之文件可具體對內核等功能進行配置,具體有待根據實際需求進行分析。

2)、debootstrap&mksquashfs--filesystem.{manifest,size,squashfs}的制作

filesystem.squashfs是由debootstrap生成的ubuntu基礎系統經過mksquashfs打包而成。

1、生成標準ubuntu基礎系統:sudodebootstrap raring ./testfs

2、為安裝系統時增加自定義的包集合菜單

3)、光盤引導--isolinux/的制作

isolinux/下為光盤引導的相關文件,可使用debian-installer生成的debian-cd_info.tar.gz提供的文件,也可使用自定義引導程序。

4)、自動化安裝系統--preseed/的制作

preseed/下放置的是各種自動化安裝系統的seed文件,可根據需要按照相關規則編寫seed文件,ubuntuserver所使用的為ubuntu-server.seed。在引導參數中需指定seed文件。

5)、光盤中源的軟件包--pool/的制作

pool/下是光盤中本地源的所有軟件包,軟件包按照源的標準文件結構放置。使用apt-move工具可將指定文件夾下的所有軟件包按照源的標準文件結構放置,即可生成所需的pool目錄。Apt-move是壹個專為已下載到/var/cache/apt/archives的軟件包生成debian軟件包倉庫文件結構的工具。光盤中所攜帶的所有軟件包之間必須沒有沖突並有完整的依賴關系,同時不能和debootstrap生成的基礎系統中已安裝的軟件包有沖突。

6)、光盤中源的包列表--dists/的制作

dists/下是光盤中本地源的包列表,其中至少應包含兩個包列表:1)光盤中所有供系統安裝的.deb包的包列表(Packages),2)Debian-installer所需的.udeb包的包列表。

7)、光盤信息–.disk/目錄

.disk/目錄下為記錄壹些光盤屬性的文件,此目錄是制作鏡像所必須的。debian-installer會讀取其中信息以判斷是否為ubuntu的系統安裝盤。

8)、 simple-cdd--自動化構建ubuntu-server系統安裝鏡像

simple-cdd可以根據配置文件,利用Debian-installer和Debian-cd等工具自動構建ubuntu-server系統安裝鏡像。(由於這些軟件默認配置都是針對Debian的,具體配置和使用還有待分析)

  • 上一篇:為什麽學了vue之後感覺編程能力下降了?
  • 下一篇:怎樣區分webform和mvc
  • copyright 2024編程學習大全網