转载至http://luyafei.blog.51cto.com/1092421/1131532

测试环境:

VMware Workstation 8.0

CentOS 6.7 x86_64

1.安装所需的软件包:
[root@localhost ~]# yum -y install createrepo mkisofs isomd5sum

2.根据当前系统已安装的软件包生成安装系统所需要的rpm列表
[root@localhost ~]# awk '/Installing/{print $2}' install.log |sed 's/^[0-9]*://g' >/root/packages.list

3.建立定制所需要的目录并把除Packages目录以外的文件复制到新的系统目录

[root@localhost ~]# mkdir  /mnt/cdrom
[root@localhost ~]# mkdir -p /data/OS
[root@localhost ~]# mount /dev/cdrom /mnt/cdrom/
[root@localhost ~]# rsync -a --exclude=Packages /mnt/cdrom/ /data/OS/ 
[root@localhost ~]# mkdir /data/OS/Packages

4.使用脚本自动复制所需要的RPM包到新建立的光盘目录中Packages

[root@localhost ~]# vim cprpms.sh

    #!/bin/bash
SRC_RPMS=/mnt/cdrom/Packages
DST_RPMS=/data/OS/Packages
packages_list=/root/packages.list
number_of_packages=`cat $packages_list | wc -l`
i=1
while [ $i -le $number_of_packages ] ;
do
name=`head -n $i $packages_list | tail -n -1`
echo "cp $SRC_RPMS/$name* $DST_RPMS/"
cp $SRC_RPMS/$name* $DST_RPMS/
i=`expr $i + 1`
done

[root@localhost ~]# sh cprpms.sh

5.配置kickstart脚本
[root@localhost ~]# vim /data/OS/isolinux/ks.cfg

#platform=x86, AMD64, or Intel EM64T
# Firewall configuration
firewall --disabled
# Install OS instead of upgrade
install
# Use CDROM installation media
cdrom
# Root password default is "redhat"
rootpw --iscrypted $1$JJuQiyTA$fbBF2fBqHB1P5PpFNy5f.1
# System authorization information
auth --useshadow --passalgo=md5
# Use text mode install
text
firstboot --disable
# System keyboard
keyboard us
# System language
lang en_US
# SELinux configuration
selinux --disabled
# Do not configure the X Window System
skipx
# Installation logging level
logging --level=info
# Reboot after installation
reboot
# System timezone
timezone Asia/Shanghai
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on –noipv6
# System bootloader configuration
bootloader --location=mbr
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
ignoredisk --only-use=sda
part /boot --fstype="ext4" --size=1024
part swap --recommended
part / --fstype="ext4" --grow --size=1
%packages
@additional-devel
@base
@core
@debugging
@basic-desktop
@desktop-debugging
@desktop-platform
@desktop-platform-devel
@development
@directory-client
@eclipse
@emacs
@fonts
@general-desktop
@graphical-admin-tools
@graphics
@input-methods
@internet-browser
@java-platform
@legacy-x
@network-file-system-client
@performance
@perl-runtime
@print-client
@remote-desktop-clients
@server-platform
@server-platform-devel
@server-policy
@tex
@technical-writing
@virtualization
@virtualization-client
@virtualization-platform
@workstation-policy
@x11
libgcrypt-devel
libXinerama-devel
openmotif-devel
libXmu-devel
xorg-x11-proto-devel
startup-notification-devel
libgnomeui-devel
libbonobo-devel
junit
libXau-devel
libXrandr-devel
popt-devel
gnome-python2-desktop
libdrm-devel
libxslt-devel
libglade2-devel
gnutls-devel
mtools
pax
python-dmidecode
oddjob
wodim
sgpio
genisoimage
device-mapper-persistent-data
systemtap-client
abrt-gui
desktop-file-utils
ant
rpmdevtools
jpackage-utils
rpmlint
samba-winbind
certmonger
pam_krb5
krb5-workstation
netpbm-progs
openmotif
libXmu
libXp
perl-DBD-SQLite
libvirt-java
%end

6.让系统从kickstart配置启动安装
[root@localhost OS]# vim /data/OS/isolinux/isolinux.cfg   #备注这里需要给执行权限,才可以编辑,默认只读;

default ks
prompt 1
timeout 60
display boot.msg
F1 boot.msg
F2 options.msg
F3 general.msg
F4 param.msg
F5 rescue.msg
label linux
kernel vmlinuz
append initrd=initrd.img
label text
kernel vmlinuz
append initrd=initrd.img text
label ks
kernel vmlinuz
append ks=cdrom:/isolinux/ks.cfg initrd=initrd.img
label local
localboot 1
label memtest86
kernel memtest
append -

7.生成rpm包的依赖关系
[root@localhost ~]# cd /data/OS/
[root@localhost OS]# createrepo -g repodata/*-comps.xml /data/OS/
[root@localhost OS]# declare -x discinfo=`head -1 .discinfo`
[root@localhost OS]# createrepo -u "media://$discinfo" -g repodata/*-comps.xml /data/OS/

8.生成ISO镜像文件
[root@localhost ~]# cd /data/OS/
[root@localhost OS]# mkisofs -R -J -T -r -l -d -joliet-long -allow-multidot \
 -allow-leading-dots -no-bak -o /data/CentOS-6.7-x86_64.iso \
 -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot \
 -boot-load-size 4 -boot-info-table /data/OS

9.生成MD5校验码
[root@localhost ~]# implantisomd5 /data/CentOS-6.3-x86_64.iso

10.测试

如果安装提示“unable to read group information from repositories。This is problem with the generation of your install tree.” 是没生产MD5效验码,也就是忘记执行博文的第9步操作;

linux 定制的更多相关文章

  1. Linux 定制X86平台操作系统

    /********************************************************************************* * Linux 定制X86平台操作 ...

  2. Linux定制化RPM包

    定制化RPM包 1.Linux安装软件方法 1- rpm/yum安装 简单.速度快,但是不能定制安装 RPM RedHat Package Manager(RPM软件包管理器) 2- 二进制安装 解压 ...

  3. linux定制

    http://cc.bingj.com/cache.aspx?q=OpenEmbedded+clfs&d=4706495287069596&mkt=zh-CN&setlang= ...

  4. linux定制的补充

    上一篇博文:http://www.cnblogs.com/hjc4025/p/6918323.html 这篇文章是对之前博文的一点扩展和补充: 这里主要是在之前的基础上添加了一些自己制作好的程序,还有 ...

  5. Loongnix 系统(MIPS Linux)

    电脑上的x86,手机上的ARM,在各自领域都是很成熟的CPU架构了,龙芯也参与进去竞争是很难的,就算是Intel,挤破头皮疯狂补贴自家的Atom x86还是在手机领域无法立足. 所以说,个人觉得龙芯可 ...

  6. 嵌入式设备上的 Linux 系统开发

    转载:http://www.ibm.com/developerworks/cn/linux/embed/embdev/index.html   如果您刚接触嵌入式开发,那么大量可用的引导装载程序(bo ...

  7. 【Linux探索之旅】开宗明义+第一部分第一课:什么是Linux?

    内容简介 1.课程大纲 2.第一部分第一课:什么是Linux? 3.第一部分第二课预告:下载Linux,免费的噢!   开宗明义 我们总听到别人说:Linux挺复杂的,是给那些追求逼格的程序员用的.咱 ...

  8. Linux定时任务工具crontab详解及系统时间同步

    Linux配置自动时间同步 linux下时间同步的两种方法分享 tail -f /var/log/cron linux下定时执行任务的方法  在LINUX中你应该先输入crontab -e,然后就会有 ...

  9. 最全互联网Linux工作规划!

    首先祝贺你选择学习Linux,你可能即将踏上Linux的工作之旅,出发之前,让我带你来看一看关于Linux和Linux运维的一切. Linux因其高效率.易于裁剪.应用广等优势,成为了当今中高端服务器 ...

随机推荐

  1. Azure上Linux VM误配防火墙的恢复方法

    在实际运维中,防火墙把自己挡在机器外面的情况会时有发生.如何快速的恢复对运维人员是很重要的. 本文将介绍如何用Azure Extension实现不通过ssh对VM进行操作的方法. 之前写过一遍Blog ...

  2. Java栈,队列,优先队列的使用

    1. 栈的使用: import java.util.*; public class Main{ public static void main(String[] args){ Deque<Str ...

  3. 2018年长沙理工大学第十三届程序设计竞赛 H数学考试

    链接:https://www.nowcoder.com/acm/contest/96/H来源:牛客网 数学考试 时间限制:C/C++ 1秒,其他语言2秒 空间限制:C/C++ 32768K,其他语言6 ...

  4. idea debug的时候 启动起来超级慢

  5. Cassandra 学习三 安装

    1: 下载Cassandra 2  解压 3   设置环境变量  4 修改cassandra里的conf目录下配置文件            配置文件地址是   D:\cassandra\apache ...

  6. MySQL 学习五 SQL实用函数

    0 select now() 显示当前时间. 1 select char_length('andyqan')   显示字符长度. 2 日期格式化         select date_format( ...

  7. 2016.1.1 VS中宏的使用技巧点滴

    Dim selection As TextSelection = DTE.ActiveDocument.Selection'定义 TextSelection 对象 selection.StartOfL ...

  8. oracle 密码默认180天过期

    alter profile default limit password_life_time unlimited; alter user username identified by 'pwd';

  9. 问题:C#将base64转换成二进制图片;结果:c# Base64编码和图片的互相转换代码

    c# Base64编码和图片的互相转换代码 Base64编码在Web方面有很多应用,譬如在URL.电子邮件方面.网上有很多相关的资源用于提供Base64编码和其他编码的转换,.Net Framewor ...

  10. vb和dos批处理创建或生成快捷方式

    https://www.cnblogs.com/gszhl/archive/2009/04/23/1441753.html vb和dos批处理创建或生成快捷方式   首先说我现在用的一种,最有效的也是 ...