# install createrepo, genisoimage, isomd5sum
yum -y install rsync yum-utils createrepo genisoimage isomd5sum
# mounting CD
mount /dev/cdrom /mnt
#(if you need to mount the ISO inside of the filesystem itself, use the next command instead)
mount -o loop CentOS-6.4-x86_64-minimal.iso /mnt
#Create directoty for package
mkdir /root/buil
# copy file in CD to directory package
cd /root/build
rsync -av /mnt/
# remove file
find .
-name TRANS.TBL -exec rm -f {} \; -print
./repodata/TRANS.TBL
./images/TRANS.TBL
./isolinux/TRANS.TBL
./Packages/TRANS.TBL
./EFI/TRANS.TBL
./EFI/BOOT/TRANS.TBL
./TRANS.TBL
./repodata/TRANS.TBL
./images/TRANS.TBL
./isolinux/TRANS.TBL
./Packages/TRANS.TBL
./EFI/TRANS.TBL
./EFI/BOOT/TRANS.TBL
./TRANS.TBL
# Testing and download package
cd Packages
yumdownloader httpd
rpm --initdb --dbpath /root/build/Packages/
rpm -ivh --test --dbpath /root/build/Packages/ /root/build/Packages/*.rpm
warning: /root/build/Packages/acl-2.2.49-6.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
error: Failed dependencies:
/etc/mime.types is needed by httpd-2.2.15-26.el6.centos.x86_64
apr-util-ldap is needed by httpd-2.2.15-26.el6.centos.x86_64
httpd-tools = 2.2.15-26.el6.centos is needed by httpd-2.2.15-26.el6.centos.x86_64
libapr-1.so.0()(64bit) is needed by httpd-2.2.15-26.el6.centos.x86_64
libaprutil-1.so.0()(64bit) is needed by httpd-2.2.15-26.el6.centos.x86_64
Dependecy error fix with this.
yum provides "*/etc/mime.types*"
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirror.cs.vt.edu
* extras: centos.mirror.constant.com
* updates: mirror.ubiquityservers.com
mailcap-2.1.31-2.el6.noarch : Helper application and MIME type associations for file types
Repo : base
Matched from:
Filename : /etc/mime.types
Test again with completed package:
rpm -ivh --test --dbpath /root/build/Packages/ /root/build/Packages/*.rpm
warning: /root/build/Packages/acl-2.2.49-6.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing... ########################################### [100%]
# create kickstart like my prior post.
cd /root/build/
mkdir ks
# prepare installed package
cd repodata
rm -rf *x86_64
mv 34bae2d3c9c78e04ed2429923bc095005af1b166d1a354422c4c04274bae0f59-c6-minimal-x86_64.xml comps.xml
ls | grep -v comps.xml | xargs rm -rf
ls
comps.xml
edit comp.xml and add your package
insert your package before "mdadm"
# create new repo
cd /root/build
export discinfo=$(head -1 .discinfo)
createrepo -u "media://$discinfo" -g repodata/comps.xml /root/build
# create new iso
mkisofs -o /tmp/newdistro.iso -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -R -J -v -T /root/build
Good luck ..
No comments:
Post a Comment