如何重新封装linux系统成iso文件
1个回答
展开全部
#安装所需软件包
1
yum -y install createrepo mkisofs anaconda-runtime
根据root下的install.log文件,得到安装的软件包
1
awk '/Installing/{print $2}' install.log |sed 's/^[0-9]*://g' >/root/packages.list
1
2
3
4
5
[root@localhost www]# mkdir centOS6.32bit
[root@localhost html]# rsync -a --exclude=Packages centOS6 centOS6.32bit/
[root@localhost html]# pwd
/var/www/html
[root@localhost html]# mkdir centOS6.32bit/Packages
复制软件包
1
for fileRpm in `cat packages.list`; do cp -r /var/www/html/centOS6/Packages/$fileRpm* /var/www/html/centOS6.32bit/centOS6/Packages ; done
按照执行就可以
1
2
3
4
5
6
7
8
9
10
11
12
13
[root@localhost centOS6]# cd /var/www/html/centOS6.32bit/centOS6
[root@localhost centOS6]# createrepo -g repodata/*-comps.xml /var/www/html/centOS6.32bit/centOS6
491/491 - Packages/abrt-addon-ccpp-2.0.8-6.el6.centos.i686.rpm
Saving Primary metadata
Saving file lists metadata
Saving other metadata
[root@localhost centOS6]# declare -x discinfo=`head -1 .discinfo`
[root@localhost centOS6]# createrepo -u "media://$discinfo" -g repodata/*-comps.xml /var/www/html/centOS6.32bit/centOS6/
488/488 - Packages/glibc-2.12-1.80.el6.i686.rpm
Saving Primary metadata
Saving file lists metadata
Saving other metadata
[root@localhost centOS6]#
1
2
3
4
5
6
[root@localhost centOS6]# createrepo -g repodata/*-comps.xml /var/www/html/centOS6.32bit/centOS6/
488/488 - Packages/glibc-2.12-1.80.el6.i686.rpm
Saving Primary metadata
Saving file lists metadata
Saving other metadata
[root@localhost centOS6]# echo $? #测试上条命令是否运行成功
按照执行就可以
1
mkisofs -R -J -T -r -l -d -joliet-long -allow-multidot -allow-leading-dots -no-bak -o/home/CentOS-6.3-i386-bin-DVD1.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table /var/www/html/centOS6.32bit/centOS6
-o 输出iso文件位置
1
2
3
4
5
6
7
8
[root@localhost home]# /usr/bin/implantisomd5 CentOS-6.3-i386-bin-DVD1.iso
Inserting md5sum into iso image...
md5 = 219c7e289d01cdb84cf99de8b3e04503
Inserting fragment md5sums into iso image...
fragmd5 = a9265bee4498b5e93a2e84a58235458cad3651caa37f41da397155e6abe1
frags = 20
Setting supported flag to 0
[root@localhost home]#
1
yum -y install createrepo mkisofs anaconda-runtime
根据root下的install.log文件,得到安装的软件包
1
awk '/Installing/{print $2}' install.log |sed 's/^[0-9]*://g' >/root/packages.list
1
2
3
4
5
[root@localhost www]# mkdir centOS6.32bit
[root@localhost html]# rsync -a --exclude=Packages centOS6 centOS6.32bit/
[root@localhost html]# pwd
/var/www/html
[root@localhost html]# mkdir centOS6.32bit/Packages
复制软件包
1
for fileRpm in `cat packages.list`; do cp -r /var/www/html/centOS6/Packages/$fileRpm* /var/www/html/centOS6.32bit/centOS6/Packages ; done
按照执行就可以
1
2
3
4
5
6
7
8
9
10
11
12
13
[root@localhost centOS6]# cd /var/www/html/centOS6.32bit/centOS6
[root@localhost centOS6]# createrepo -g repodata/*-comps.xml /var/www/html/centOS6.32bit/centOS6
491/491 - Packages/abrt-addon-ccpp-2.0.8-6.el6.centos.i686.rpm
Saving Primary metadata
Saving file lists metadata
Saving other metadata
[root@localhost centOS6]# declare -x discinfo=`head -1 .discinfo`
[root@localhost centOS6]# createrepo -u "media://$discinfo" -g repodata/*-comps.xml /var/www/html/centOS6.32bit/centOS6/
488/488 - Packages/glibc-2.12-1.80.el6.i686.rpm
Saving Primary metadata
Saving file lists metadata
Saving other metadata
[root@localhost centOS6]#
1
2
3
4
5
6
[root@localhost centOS6]# createrepo -g repodata/*-comps.xml /var/www/html/centOS6.32bit/centOS6/
488/488 - Packages/glibc-2.12-1.80.el6.i686.rpm
Saving Primary metadata
Saving file lists metadata
Saving other metadata
[root@localhost centOS6]# echo $? #测试上条命令是否运行成功
按照执行就可以
1
mkisofs -R -J -T -r -l -d -joliet-long -allow-multidot -allow-leading-dots -no-bak -o/home/CentOS-6.3-i386-bin-DVD1.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table /var/www/html/centOS6.32bit/centOS6
-o 输出iso文件位置
1
2
3
4
5
6
7
8
[root@localhost home]# /usr/bin/implantisomd5 CentOS-6.3-i386-bin-DVD1.iso
Inserting md5sum into iso image...
md5 = 219c7e289d01cdb84cf99de8b3e04503
Inserting fragment md5sums into iso image...
fragmd5 = a9265bee4498b5e93a2e84a58235458cad3651caa37f41da397155e6abe1
frags = 20
Setting supported flag to 0
[root@localhost home]#
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询