update the build with yum script, with inline with docker kickstart

This commit is contained in:
Arif Ali 2014-06-19 01:25:50 +01:00
parent 6bf8697c65
commit 55408f5510

View File

@ -6,6 +6,9 @@ installroot="/ostemplate"
mount="$(mktemp -d --tmpdir)"
tmpyumconf=$mount/yum.conf
rm -rf $installroot
mkdir -p $installroot
cat > $tmpyumconf << __YUMCONF__
[centos7]
name=centos 7 x86_64
@ -26,77 +29,68 @@ yum \
--installroot $installroot \
-c $tmpyumconf \
-y install \
openssh-clients \
openssh-server \
yum \
yum-utils \
man \
wget \
sudo \
tar \
passwd
wget
# Remove firmware files if installed
yum \
--installroot $installroot \
-c $tmpyumconf \
-y remove \
aic94xx-firmware \
alsa-firmware \
alsa-tools-firmware \
ModemManager-glib \
NetworkManager* \
alsa-lib \
centos-logos \
dracut-network \
efibootmgr \
ethtool \
ivtv-firmware \
iwl100-firmware \
iwl105-firmware \
iwl135-firmware \
iwl1000-firmware \
iwl2000-firmware \
iwl2030-firmware \
iwl3160-firmware \
iwl3945-firmware \
iwl4965-firmware \
iwl5000-firmware \
iwl5150-firmware \
iwl6000-firmware \
iwl6000g2a-firmware \
iwl6000g2b-firmware \
iwl6050-firmware \
iwl7260-firmware \
kbd \
libertas-sd8686-firmware \
libertas-sd8787-firmware \
libertas-usb8388-firmware \
libertas-usb8388-olpc-firmware \
linux-firmware \
gsettings-desktop-schemas \
grub2 \
grub2-tools \
grubby \
kbd* \
kernel* \
libteam \
mozjs17 \
parted \
pciutils-libs \
plymouth \
plymouth-scripts \
postfix \
policycoreutils \
ppp \
selinux-policy \
selinux-policy-targeted \
sudo \
teamd \
upstart \
xorg-x11-drv-ati-firmware \
zd1211-firmware
wpa_supplicant \
*-firmware
# Clean the yum configuration
yum --installroot $installroot -c $tmpyumconf clean all
# Remove unnessary files from the build, that are not required on a VZ container
yum \
--installroot $installroot \
-c $tmpyumconf \
-y remove \
grub2 \
grub2-tools \
grubby \
centos-logos \
plymouth \
plymouth-scripts \
kernel
# Remove /boot, as that is not required
chroot $installroot rm -rf /boot
# Remove files that are known to take up lots of space but leave
# directories intact since those may be required by new rpms.
# locales
find $installroot/usr/{{lib,share}/{i18n,locale},{lib,lib64}/gconv,bin/localedef,sbin/build-locale-archive} \
-type f \( ! -iname "*utf*" ! -name "en_US" \) | xargs /bin/rm
# cracklib
find $installroot/usr/share/cracklib \
-type f | xargs /bin/rm
# sln
rm -f $installroot/sbin/sln
# ldconfig
rm -rf $installroot/etc/ld.so.cache
rm -rf $installroot/var/cache/ldconfig/*
# Create fstab file, which is required for VZ installtions
cat > $installroot/etc/fstab << __FSTAB__
none /dev/pts devpts rw,gid=5,mode=620 0 0
@ -115,5 +109,4 @@ mknod -m 600 $installroot/dev/console c 5 1
cp $tmpyumconf $installroot/etc/yum.repos.d/centos.repo
# Now compress the image
cd $installroot; tar -cpzf /root/centos-7-x86_64-viayum.tar.gz . ; cd
ls -lh /root/centos-7-x86_64-viayum.tar.gz
cd $installroot; tar -cpzf /root/centos-7-x86_64-viayum-`date '+%Y%m%d'`.tar.gz . ; cd