[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Ovirt-devel] [PATCH] some cleanup of ovirt-host kickstart to make images smaller

This patch adds --excludedocs to the kickstart for the x86_64 and i386 ovirt host kickstarts. For the most part we're removing docs manually right now anyhow, but this may catch some other things.

Also cleaned up the section that removes docs and localization. Recreate the cracklib dicts (frees up about 8MB) and remove unneeded kernel modules. Most of this stuff will just end up in the whitelist/blacklist module, but the cracklib stuff is a different issue. They can't be removed, they need to be recreated. This will probably need to continue to happen in %post.

The end result of this cleanup is that the image boots and it is 58MB compressed/162MB uncompressed (filesystem is 450MB total)

One of the things we need to fix is the filesystem total size. The filesystem doesn't need to be 450MB. It could be initially created as 450MB and then resized to 200MB or less.

Signed-off-by: Perry Myers <pmyers redhat com>

diff --git a/ovirt-host-creator/common-install.ks b/ovirt-host-creator/common-install.ks
index 4924ada..828d265 100644
--- a/ovirt-host-creator/common-install.ks
+++ b/ovirt-host-creator/common-install.ks
@@ -4,7 +4,7 @@ timezone US/Eastern
 auth --useshadow --enablemd5
 selinux --disabled
 firewall --disabled
-part / --size 950
+part / --size 450
 services --enabled=ntpd,collectd,iptables
 bootloader --timeout=1
diff --git a/ovirt-host-creator/common-post.ks b/ovirt-host-creator/common-post.ks
index 8c9f090..308aaac 100644
--- a/ovirt-host-creator/common-post.ks
+++ b/ovirt-host-creator/common-post.ks
@@ -162,6 +162,7 @@ fi
 g=$(printf '\33[1m\33[32m')    # similar to g=$(tput bold; tput setaf 2)
 n=$(printf '\33[m')            # similar to n=$(tput sgr0)
+mkdir -p /t
 cat <<EOF > /t/i2
            888     888 ${g}d8b$n         888
@@ -206,6 +207,12 @@ EOF
+# cracklib-dicts is 8MB.  We probably don't need to have strict password
+# checking on the ovirt host
+# unfortunately we can't create an empty cracklib dict, so we create it
+# with a single entry "1"
+echo 1 | /usr/sbin/packer
 # here, remove a bunch of files we don't need that are just eating up space.
 # it breaks rpm slightly, but it's not too bad
@@ -220,16 +227,50 @@ rpm -e --nodeps perl perl-libs
 # remove it here
 rpm -e --nodeps dejavu-lgc-fonts
-rm -rf /usr/share/omf/fedora-release-notes
-rm -rf /usr/share/omf/about-fedora
-rm -rf /usr/share/gnome/help/fedora-release-notes
-rm -rf /usr/share/gnome/help/about-fedora
-rm -rf /usr/share/doc/HTML
-rm -rf /usr/share/locale
-find /usr/share/i18n/locales -type f ! -iname en_US -exec rm -f {} \;
-rm -rf /usr/share/man
-rm -rf /usr/lib64/gconv
-rm -rf /usr/share/doc
-rm -rf /usr/share/X11
-rm -f /usr/lib/locale/*
-rm -rf /usr/share/terminfo/*
+RM="rm -rf"
+# Remove docs and internationalization
+$RM /usr/share/omf
+$RM /usr/share/gnome
+$RM /usr/share/doc
+$RM /usr/share/locale
+$RM /usr/share/libthai
+$RM /usr/share/man
+$RM /usr/share/terminfo
+$RM /usr/share/X11
+find /usr/share/i18n/locales -type f ! -name en_us -exec $RM {} \;
+find /usr/share/i18n/charmaps -regextype egrep -type f ! -regex ".*/UTF-8.gz|.*/ISO-8859-1.gz" -exec $RM {} \;
+find /usr/share/zoneinfo -regextype egrep -type f ! -regex ".*/EST.*|.*/GMT" -exec $RM {} \;
+$RM /usr/lib/locale
+$RM /usr/lib/syslinux
+$RM /usr/lib64/gconv
+$RM /usr/lib64/pango
+$RM /usr/lib64/libpango*
+$RM /etc/pango
+$RM /usr/bin/pango*
+# Remove unnecessary kernel modules
+$RM $MODULES/sound
+fs_mods="9p affs autofs autofs4 befs bfs cifs coda configfs cramfs dlm \
+         ecryptfs efs exportfs freevxfs fuse gfs2 hfs hfsplus jbd jbd2 \
+         jffs jfs minix ncpfs ocfs2 qnx4 reiserfs romfs sysv udf ufs xfs"
+for dir in $fs_mods ; do
+   $RM $MODULES/fs/$dir
+net_mods="802 8021q 9p appletalk atm ax25 bluetooth dccp decnet \
+          ieee80211 ipx irda mac80211 netrom rfkill rose sched \
+          sctp sunrpc tipc wanrouter wireless"
+for dir in $net_mods ; do
+   $RM $MODULES/net/$dir
+driver_mods="bluetooth firewire i2c isdn media edac"
+for dir in $driver_mods ; do
+   $RM $MODULES/drivers/$dir
diff --git a/ovirt-host-creator/ovirt-i386.ks b/ovirt-host-creator/ovirt-i386.ks
index 82fdf89..4911883 100644
--- a/ovirt-host-creator/ovirt-i386.ks
+++ b/ovirt-host-creator/ovirt-i386.ks
@@ -1,6 +1,6 @@
 %include common-install.ks
+%packages --excludedocs
 %include common-pkgs.ks
diff --git a/ovirt-host-creator/ovirt-x86_64.ks b/ovirt-host-creator/ovirt-x86_64.ks
index a0bae41..62f62d6 100644
--- a/ovirt-host-creator/ovirt-x86_64.ks
+++ b/ovirt-host-creator/ovirt-x86_64.ks
@@ -1,6 +1,6 @@
 %include common-install.ks
+%packages --excludedocs
 %include common-pkgs.ks

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]