diff --git a/openvz/create-yum-openvz-7.sh b/openvz/create-yum-openvz-7.sh index 707faaa..2a3d7d6 100644 --- a/openvz/create-yum-openvz-7.sh +++ b/openvz/create-yum-openvz-7.sh @@ -1,14 +1,15 @@ -# To get a package list without version numbers from a target system -# rpm -qa --qf "%{n} " > packages.txt -# Put contents of packages.txt after "-y install \" line below +#!/bin/bash +# Variables installroot="/ostemplate" mount="$(mktemp -d --tmpdir)" tmpyumconf=$mount/yum.conf +# Re-create the installroot rm -rf $installroot mkdir -p $installroot +# Yum conf to use for the installation cat > $tmpyumconf << __YUMCONF__ [centos7] name=centos 7 x86_64 diff --git a/openvz/openvz-7.ks b/openvz/openvz-7.ks index f9f49dd..65df0fe 100644 --- a/openvz/openvz-7.ks +++ b/openvz/openvz-7.ks @@ -1,5 +1,4 @@ install -#url --url=http://mirror.centos.org/centos/7/os/x86_64/ url --url=http://buildlogs.centos.org/centos/7/os/x86_64-latest/ lang en_GB.UTF-8 keyboard uk @@ -9,72 +8,70 @@ authconfig --enableshadow --passalgo=sha512 --enablefingerprint selinux --enforcing timezone --utc Europe/London skipx -#repo --name="CentOS" --baseurl=http://mirror.centos.org/centos/7/os/x86_64/ --cost=100 -#repo --name="Updates" --baseurl=http://mirror.centos.org/centos-7/7/updates/x86_64/ --cost=100 -# CentOSPlus is here ONLY for a libselinux patch. -# Once 6.6 is released, this should be removed -# http://lists.centos.org/pipermail/centos-devel/2014-May/010345.html -#repo --name="CentOSPlus" --baseurl=http://mirror.centos.org/centos-7/7/centosplus/x86_64/ --cost=1000 clearpart --all --initlabel part / --fstype ext4 --size=1024 --grow reboot -%packages --excludedocs --nobase +%packages --excludedocs --nobase @Core -openssh-clients -openssh-server -yum yum-utils -man wget -sudo -tar -passwd --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 %end %post -# cleanup unwanted stuff -yum -y remove grub2 grub2-tools grubby centos-logos plymouth plymouth-scripts kernel +# cleanup unwanted stuff, that might still get installed +yum -y remove grub* centos-logos plymouth* kernel* # Remove /boot, as that is not required 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 > /etc/fstab << __FSTAB__ none /dev/pts devpts rw,gid=5,mode=620 0 0 @@ -84,12 +81,6 @@ __FSTAB__ # GMT to be default, but change for requirement ln -sf /usr/share/zoneinfo/GMT /etc/localtime -# Copy the yum config to the system -cp $tmpyumconf $installroot/etc/yum.repos.d/centos.repo - -# GMT to be default, but change for requirement -cp -f /usr/share/zoneinfo/GMT /etc/localtime - # Misc post stuff for VZ ln -s /proc/mounts /etc/mtab rm -f /dev/null