http://www.smorgasbork.com/2012/01/04/building-a-custom-centos-6-kickstart-disc-part-1/
Create a directory to mount your source.
# mkdir /tmp/bootiso
Loop mount the source ISO you are modifying. (Download from Red Hat / CentOS.)
# mount -o loop /path/to/some.iso /tmp/bootiso
Create a working directory for your customized media.
# mkdir /tmp/bootisoks
Copy the source media to the working directory.
# cp -r /tmp/bootiso/* /tmp/bootisoks/
Unmount the source ISO and remove the directory.
# umount /tmp/bootiso && rmdir /tmp/bootiso.
Change permissions on the working directory.
# chmod -R u+w /tmp/bootisoks
Copy your Kickstart script which has been modified for the packages and %post to the working directory.
# cp /path/to/someks.cfg /tmp/bootisoks/isolinux/ks.cfg
Copy any additional RPMs to the directory structure and update the metadata.
# cp /path/to/*.rpm /tmp/bootisoks/Packages/.
# cd /tmp/bootisoks/Packages && createrepo -dpo .. .
Add kickstart to boot options.
# sed -i 's/append\ initrd\=initrd.img$/append initrd=initrd.img\ ks\=cdrom:\/ks.cfg/' /tmp/bootisoks/isolinux/isolinux.cfg
Create the new ISO file.
# cd /tmp/bootisoks && mkisofs -o /tmp/boot.iso -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -v -T isolinux/. .
mkfsiso
A mkisofs run needs one or more input directories or files and a name for the emerging filesystem image file. There are options for standards compliance, for filesystem attributes, and -most important here- for setting up boot entry points.
-o DISKPATH sets the result file name. E.g. "bootable.iso".
-R enables normal Unix filenames and attributes by Rock Ridge extension. -r does the same but also changes access permissions to make all files readable by everybody.
-J enables MS-Windows UCS-2 names via Joliet extension.
-iso-level NUMBER sets the ISO 9660 Level of Interchange. Level 1 allows only 8.3 filenames. Level 2 allows up to 30 characters in filenames. Level 3 allows data files larger than 4 GiB - 1.
-U violates ISO 9660 specs by allowing long case-sensitive filenames outside of said extensions. If you know that the reader can stand it, then this is a cheap way to get decent file names. But expect standard readers to become confused.
-V TEXT sets the ISO 9660 Volume ID. It can be up to 32 characters long and is often used by automounters as name of the mount directory for the filesystem.
-hide ISOPATH and -hide-joliet ISOPATH may be used to exclude a data file from the directory trees while still having its content in data blocks of the filesystem.
-c ISOPATH sets the filename for the El Torito Boot Catalog. The file is created automatically if boot images are announced. If option -c is missing, then the file will not show up in the directory trees of the ISO filesystem.
-b ISOPATH announces a data file as El Torito boot image for PC-BIOS.
-e ISOPATH announces a data file as El Torito boot image for EFI. This is not an option of original mkisofs, but is understood by some variants of genisoimage and by xorriso -as mkisofs.
-no-emul-boot and -hard-disk-boot choose emulation modes other than the default of floppy emulation. Especially -no-emul-boot is needed for boot images of ISOLINUX and GRUB2.
-boot-load-size NUMBER sets how many blocks of the boot image are to be loaded by the BIOS. A usual number with -no-emul-boot is 4.
-boot-info-table causes a Boot Info Table to be written into the boot image. Needed for boot images of ISOLINUX and GRUB2.
-eltorito-alt-boot ends the range of -b or -e. All further El Torito boot options will apply to the next boot image given by -b or -e.
-G DISKPATH copies the content of a data file into the System Area of the ISO filesystem. This is used to bring MBR or other boot blocks into the filesystem to enable booting from hard-disk-like devices or booting on exotic hardware.
-isohybrid-mbr DISKPATH copies a SYSLINUX/ISOLINUX MBR template into the System Area and makes it execute the El Torito boot image for BIOS. This is a speciality of xorriso -as mkisofs.
-isohybrid-gpt-basdat announces the boot image as GPT partition for booting via EFI and as MBR partition. This is a speciality of xorriso -as mkisofs.
-graft-points enables the interpretation of pathspecs which give a target path in the ISO filesystem together with the path of an input directory or file.
A program argument, which is not recognized as option (e.g. because it does not begin by a dash "-") and is not parameter of an option, is taken as path to an input directory or file. If it is a directory, then its content gets merged with the content of the root directory of the emerging ISO filesystem. If it is a file of other type, then it gets copied into the root directory.
If enabled, then pathspecs get recognized by an equal sign which separates target path from source path. E.g.
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· AI与.NET技术实操系列(六):基于图像分类模型对图像进行分类