Last active
August 29, 2015 14:06
-
-
Save jcpowermac/816eafb2acd214439287 to your computer and use it in GitHub Desktop.
Create Custom RHEL 6.5 Minimal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| mkdir /mnt/cdrom | |
| mkdir /rhel | |
| mount -o loop rhel-server-6.5-x86_64-dvd.iso /mnt/cdrom | |
| cat > /etc/yum.repos.d/rhel-dvd.repo <<EOF | |
| [dvd] | |
| name=Red Hat Enterprise Linux Installation DVD | |
| baseurl=file:///mnt/cdrom/Server | |
| enabled=0 | |
| EOF | |
| yum install mkisofs yum-utils rsync openssh-clients -y | |
| rsync -av --progress /mnt/cdrom/ /rhel --exclude Packages | |
| #!/bin/bash | |
| shopt -s dotglob | |
| regex="(.*)(-[0-9]+)(:)" | |
| list=`yum groupinfo --enablerepo=dvd core base 2>&1 | egrep '^.*[^:|\.]$' | awk 'NR>3 {print $1}'` | |
| #deplist=`repoquery --enablerepo=dvd --nevr deplist $list` | |
| deplist=`repoquery --enablerepo=dvd --nevr --archlist=x86_64,noarch --requires --recursive --resolve $list` | |
| for dep in $deplist ; do | |
| if [[ $dep =~ $regex ]] | |
| then | |
| echo "dep: $dep" | |
| #echo "^${BASH_REMATCH[1]}" | |
| path=`find /mnt/cdrom/Packages -printf "%f,%p\n" | egrep "^${BASH_REMATCH[1]}.*" | awk -F, '{print $2}'` | |
| echo "cp -v $path /rhel/Packages" | |
| cp -v $path /rhel/Packages | |
| else | |
| echo ">>> didn't find: $dep" | |
| fi | |
| done | |
| cat > missing_files.txt <<EOF | |
| shared-mime-info-0.70-4.el6.x86_64.rpm | |
| gamin-0.1.10-9.el6.x86_64.rpm | |
| tzdata-2013g-1.el6.noarch.rpm | |
| ustr-1.0.4-9.1.el6.x86_64.rpm | |
| binutils-2.20.51.0.2-5.36.el6.x86_64.rpm | |
| ca-certificates-2013.1.94-65.0.el6.noarch.rpm | |
| cracklib-dicts-2.8.16-4.el6.x86_64.rpm | |
| cracklib-2.8.16-4.el6.x86_64.rpm | |
| libxslt-1.1.26-2.el6_3.1.x86_64.rpm | |
| m4-1.4.13-5.el6.x86_64.rpm | |
| MAKEDEV-3.24-6.el6.x86_64.rpm | |
| libusb-0.1.12-23.el6.x86_64.rpm | |
| libnih-1.0.1-7.el6.x86_64.rpm | |
| sqlite-3.6.20-1.el6.x86_64.rpm | |
| p11-kit-trust-0.18.5-2.el6.x86_64.rpm | |
| p11-kit-0.18.5-2.el6.x86_64.rpm | |
| dash-0.5.5.1-4.el6.x86_64.rpm | |
| slang-2.2.1-1.el6.x86_64.rpm | |
| libgudev1-147-2.51.el6.x86_64.rpm | |
| gdbm-1.8.0-36.el6.x86_64.rpm | |
| libffi-3.0.5-3.2.el6.x86_64.rpm | |
| pyOpenSSL-0.10-2.el6.x86_64.rpm | |
| libtasn1-2.3-3.el6_2.1.x86_64.rpm | |
| libpciaccess-0.13.1-2.el6.x86_64.rpm | |
| EOF | |
| #!/bin/bash | |
| while read file <&3; do | |
| cp /mnt/cdrom/Packages/$file /rhel/Packages | |
| done 3</root/missing_files.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment