Perry N. Myers
2008-Mar-20 04:06 UTC
[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 at redhat.com> -------------- next part -------------- A non-text attachment was scrubbed... Name: image-minimization.patch Type: text/x-patch Size: 3865 bytes Desc: not available URL: <http://listman.redhat.com/archives/ovirt-devel/attachments/20080320/b83e8f4e/attachment.bin>
Jim Meyering
2008-Mar-20 08:13 UTC
[Ovirt-devel] [PATCH] some cleanup of ovirt-host kickstart to make images smaller
"Perry N. Myers" <pmyers at redhat.com> wrote:> 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....> 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 888Hi Perry, Thanks for noticing the debug-redirection I used when testing a recent change. I've just pushed the following, to remove it: Remove debugging-redirect to temp file added in 87dfab3abb32e498739d8d82036bd22f729d4d47. diff --git a/ovirt-host-creator/common-post.ks b/ovirt-host-creator/common-post.ks index 8c9f090..a34877a 100644 --- a/ovirt-host-creator/common-post.ks +++ b/ovirt-host-creator/common-post.ks @@ -162,7 +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) -cat <<EOF > /t/i2 +cat <<EOF 888 888 ${g}d8b$n 888 888 888 ${g}Y8P$n 888 -- 1.5.5.rc0.17.gb6ce2
Jim Meyering
2008-Mar-20 08:35 UTC
[Ovirt-devel] [PATCH] some cleanup of ovirt-host kickstart to make images smaller
"Perry N. Myers" <pmyers at redhat.com> wrote:> 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)... Nice decrease.> 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...> -find /usr/share/i18n/locales -type f ! -iname en_US -exec rm -f {} \;...> +find /usr/share/i18n/locales -type f ! -name en_us -exec $RM {} \;Won't the new find command remove the entire /usr/share/i18n/locales hierarchy? Maybe that's ok in practice, if we're sure to work in the C locale (in which case, don't bother with find, and just use rm -rf /usr/share/i18n/locales). Otherwise, on at least the rawhide, FC6 and RHEL4.6 systems I checked, the directory is named /usr/share/i18n/locales/en_US. BTW, since they're always "-type f", there's no need to change the rm -f to "rm -rf".
Chris Lalancette
2008-Mar-20 13:40 UTC
[Ovirt-devel] [PATCH] some cleanup of ovirt-host kickstart to make images smaller
Perry N. Myers wrote:> 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.It looks good to me....just remove the mkdir -p /t (since Jim pushed a fix for that), and remove all of the locales (going with C locale), and I think it is good. Chris Lalancette
Perry N. Myers
2008-Mar-20 14:49 UTC
[Ovirt-devel] [PATCH] repost: some cleanup of ovirt-host kickstart to make images smaller
Perry N. Myers wrote:> 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 at redhat.com>Changed to remove /usr/share/i18n completely, added back sunrpc modules and merged with Jim's fix for removing debugging statements. Signed-off-by: Perry Myers <pmyers at redhat.com> -------------- next part -------------- A non-text attachment was scrubbed... Name: image-minimization.patch Type: text/x-patch Size: 3461 bytes Desc: not available URL: <http://listman.redhat.com/archives/ovirt-devel/attachments/20080320/9ac5f36e/attachment.bin>