[Thincrust-devel] [PATCH] Added the image-minimization code to the relocated kickstart files
Bryan Kearney
bkearney at redhat.com
Thu Sep 4 15:44:08 UTC 2008
From: root <root at localhost.localdomain>
---
kickstarts/aos-f8.ks | 6 +--
kickstarts/aos-f9.ks | 7 +--
kickstarts/aos-rawhide.ks | 7 +--
kickstarts/base-post.ks | 97 ++++++++++++--------------------------------
4 files changed, 35 insertions(+), 82 deletions(-)
diff --git a/kickstarts/aos-f8.ks b/kickstarts/aos-f8.ks
index bfb0846..d856578 100644
--- a/kickstarts/aos-f8.ks
+++ b/kickstarts/aos-f8.ks
@@ -31,8 +31,6 @@ repo --name=f8-updates --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?
%end
#
-# Add custom post scripts after the base post.
+# Image minimization
#
-%post
- #%include base-post.ks
-%end
+%include base-post.ks
diff --git a/kickstarts/aos-f9.ks b/kickstarts/aos-f9.ks
index 3851911..8bc6074 100644
--- a/kickstarts/aos-f9.ks
+++ b/kickstarts/aos-f9.ks
@@ -31,8 +31,7 @@ repo --name=f9-updates --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?
%end
#
-# Add custom post scripts after the base post.
+# Image minimization
#
-%post
- #%include base-post.ks
-%end
+%include base-post.ks
+
diff --git a/kickstarts/aos-rawhide.ks b/kickstarts/aos-rawhide.ks
index eeb65ef..f152a25 100644
--- a/kickstarts/aos-rawhide.ks
+++ b/kickstarts/aos-rawhide.ks
@@ -30,8 +30,7 @@ repo --name=rawhide --mirrorlist=http://mirrors.fedoraproject.org/mirrorlist?rep
%end
#
-# Add custom post scripts after the base post.
+# Image minimization
#
-%post
- #%include base-post.ks
-%end
+%include base-post.ks
+
diff --git a/kickstarts/base-post.ks b/kickstarts/base-post.ks
index e244865..3a19035 100644
--- a/kickstarts/base-post.ks
+++ b/kickstarts/base-post.ks
@@ -1,70 +1,27 @@
-# from katzj's appliance creator script
-# cut locale archive down to a smaller set; this should be handled
-# automatically based on %packages --installLangs once that's supported
-localedef --list-archive |grep -v en_US | xargs localedef --delete-from-archive
-mv /usr/lib/locale/locale-archive /usr/lib/locale/locale-archive.tmpl
-/usr/sbin/build-locale-archive
-
-# remove some things that mkinitrd doesn't really need in this case
-# we should probably find a way to remove the deps and still have
-# ordering work properly
-rpm -e --nodeps mkinitrd kpartx dmraid mdadm lvm2 tar
-
-# fedora-release-notes is required by fedora-release and is pretty
-# large, but not really needed for an appliance
-rpm -e --nodeps fedora-release-notes
-
-# 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
-
-# FIXME: ug, hard-coded paths. This is going to break if we change to F-9
-# or upgrade certain packages. Not quite sure how to handle it better
-
-# Added from pmyers image-minimization patch
-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
-$RM /usr/share/i18n
-
-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
-
-MODULES="XXX/lib/modules/*/kernel"
-$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
-done
-
-net_mods="802 8021q 9p appletalk atm ax25 bluetooth dccp decnet \
- ieee80211 ipx irda mac80211 netrom rfkill rose sched \
- sctp tipc wanrouter wireless"
-for dir in $net_mods ; do
- $RM $MODULES/net/$dir
-done
-
-driver_mods="bluetooth firewire i2c isdn media edac"
-for dir in $driver_mods ; do
- $RM $MODULES/drivers/$dir
-done
-
-
+%post --nochroot --interpreter image-minimizer
+ drop /usr/share/omf
+ drop /usr/share/gnome
+ drop /usr/share/doc
+ drop /usr/share/libthai
+ drop /usr/share/man
+ drop /usr/share/terminfo
+ drop /usr/share/X11
+ drop /usr/share/i18n
+
+ # Remove many of the time zones.
+ drop /usr/share/zoneinfo
+ keep /usr/share/zoneinfo/EST
+ keep /usr/share/zoneinfo/UTC
+
+ drop /usr/lib/locale
+ drop /usr/lib/syslinux
+ drop /usr/lib64/gconv
+ drop /usr/lib64/pango
+ drop /usr/lib64/libpango*
+ drop /etc/pango
+ drop /usr/bin/pango*
+
+ # Nix all locale stuff
+ drop /usr/share/locale
+ keep /usr/share/locale/en_US
+%end
--
1.5.5.1
More information about the Thincrust-devel
mailing list