一、安装工具
Apt-get Install Squashfs-tools
Apt-get Install Mkisofs
Second, Mount and unzip the system ISO file
- Operate in opt directory
cd/opt/
mkdir mnt LiveCD Tool
- Upload the system to be customized ISO to/opt/tool/
- Mount ISO image to/opt/mnt/
mount/opt/tool/ubuntu-16.04.2-server-amd64.iso/opt/mnt/
- Copy all the image files to/opt/livecd/
cp-rp/opt/mnt/. /opt/livecd/
- Cancel Mirroring Mount
umount/opt/mnt/
Iii. Custom Systems
- Unzip the FILESYSTEM.SQUASHFS file to the current directory and extract the directory as Squashfs-root
cd/opt/livecd/install/
UNSQUASHFS FILESYSTEM.SQUASHFS
- Switching into a new system
Chroot Squashfs-root
MOUNT-T proc None/proc
Mount-t Sysfs None/sys
Mount-t devpts none/dev/pts
- Modify DNS, install source files, replicate the DNS and installation sources that have been configured for the machine to be customized
Exit the Squashfs-root system first
Exit
Cp/etc/apt/sources.list/opt/livecd/install/squashfs-root/etc/apt/sources.list
Cp/etc/resolv.conf/opt/livecd/install/squashfs-root/etc/resolv.conf
Switch to the new system, install the required software, and so on to the system to make customized changes
Chroot Squashfs-root
APT Update
Apt Install Software-properties-common
APT Update
Aptitude hold Linux-generic
- Purge system
Apt-get Clean
Apt-get Autoremove
rm-fr/tmp/*
- Back to the original system
Umount/proc
Umount/sys
Umount/dev/pts
Exit
- Reconfigure and compress the root file system
Cd/opt/livecd/install
RM FILESYSTEM.SQUASHFS
MKSQUASHFS Squashfs-root FILESYSTEM.SQUASHFS
printf $ (du-sx--block-size 1 squashfs-root |cut-f1) >filesystem.size
Rm-r Squashfs-root
cd/opt/livecd/
RM md5sum.txt
Find-type f-print0 | xargs-0 md5sum|grep-v isolinux/boot.cat |tee md5sum.txt
8. Creating an ISO image
cd/opt/livecd/
mkisofs-d-r-v "Ubuntu-16.04.2-server-amd64.iso"-cache-inodes-j-l-b isolinux/isolinux.bin-c isolinux/boot.cat-no-e Mul-boot-boot-load-size 4-boot-info-table-o ". /rdcloudinstallos.iso ".
Ubuntu Customization System ISO Production