Perry Myers
2008-Nov-21 05:52 UTC
[Ovirt-devel] [PATCH node-image] Add minimal python into the Node
core python libs and interpreter are added to facilitate scripting Node size increases by approx 4MB compressed This patch removes all of the .py files installed by python RPM since the .pyc and .pyo files are already present and the source shouldn't be strictly needed. Signed-off-by: Perry Myers <pmyers at redhat.com> --- common-blacklist.ks | 9 ++++++--- 1 files changed, 6 insertions(+), 3 deletions(-) diff --git a/common-blacklist.ks b/common-blacklist.ks index 3c89236..2f2c950 100644 --- a/common-blacklist.ks +++ b/common-blacklist.ks @@ -11,9 +11,9 @@ echo "Removing excess RPMs" # However, this is just an install-time dependency; we can remove # it afterwards, which we do here RPMS="system-config-firewall-tui system-config-network-tui rhpl \ - rpm-python dbus-python kudzu newt-python newt" + rpm-python dbus-python kudzu newt-python newt libsemanage-python" -RPMS="$RPMS kpartx mkinitrd isomd5sum dmraid python python-libs checkpolicy" +RPMS="$RPMS kpartx mkinitrd isomd5sum dmraid checkpolicy" # Remove additional RPMs forcefully RPMS="$RPMS gamin pm-utils kbd usermode vbetool ConsoleKit hdparm \ @@ -91,7 +91,7 @@ blacklist="/boot /etc/alsa /etc/pki /usr/share/hwdata/MonitorsDB \ /usr/share/tc /usr/share/emacs /usr/share/info /usr/kerberos \ /usr/src /usr/etc /usr/games /usr/include /usr/local \ /usr/sbin/{dell*,sasldblistusers2,build-locale-archive,glibc_post_upgrade.*}" -blacklist_lib="/usr/lib{,64}/python2.5 /usr/lib{,64}/gconv \ +blacklist_lib="/usr/lib{,64}/gconv \ /usr/{,lib64}/tc /usr/lib{,64}/tls /usr/lib{,64}/sse2 \ /usr/lib{,64}/pkgconfig /usr/lib{,64}/nss /usr/lib{,64}/X11 \ /usr/lib{,64}/games /usr/lib{,64}/alsa-lib /usr/lib{,64}/fs/reiserfs \ @@ -119,6 +119,9 @@ find /usr/share -type d -exec rmdir {} \; > /dev/null 2>&1 echo "Cleanup excess selinux modules" $RM /usr/share/selinux +echo "Removing python source files" +find / -name *.py -exec rm -f {} \; + echo "Running image-minimizer..." %end -- 1.6.0.3
Bryan Kearney
2008-Nov-21 12:54 UTC
[Ovirt-devel] [PATCH node-image] Add minimal python into the Node
Perry Myers wrote:> core python libs and interpreter are added to facilitate scripting > Node size increases by approx 4MB compressed > > This patch removes all of the .py files installed by python RPM > since the .pyc and .pyo files are already present and the source > shouldn't be strictly needed. > > Signed-off-by: Perry Myers <pmyers at redhat.com> > --- > common-blacklist.ks | 9 ++++++--- > 1 files changed, 6 insertions(+), 3 deletions(-) > > diff --git a/common-blacklist.ks b/common-blacklist.ks > index 3c89236..2f2c950 100644 > --- a/common-blacklist.ks > +++ b/common-blacklist.ks > @@ -11,9 +11,9 @@ echo "Removing excess RPMs" > # However, this is just an install-time dependency; we can remove > # it afterwards, which we do here > RPMS="system-config-firewall-tui system-config-network-tui rhpl \ > - rpm-python dbus-python kudzu newt-python newt" > + rpm-python dbus-python kudzu newt-python newt libsemanage-python" > > -RPMS="$RPMS kpartx mkinitrd isomd5sum dmraid python python-libs checkpolicy" > +RPMS="$RPMS kpartx mkinitrd isomd5sum dmraid checkpolicy" > > # Remove additional RPMs forcefully > RPMS="$RPMS gamin pm-utils kbd usermode vbetool ConsoleKit hdparm \ > @@ -91,7 +91,7 @@ blacklist="/boot /etc/alsa /etc/pki /usr/share/hwdata/MonitorsDB \ > /usr/share/tc /usr/share/emacs /usr/share/info /usr/kerberos \ > /usr/src /usr/etc /usr/games /usr/include /usr/local \ > /usr/sbin/{dell*,sasldblistusers2,build-locale-archive,glibc_post_upgrade.*}" > -blacklist_lib="/usr/lib{,64}/python2.5 /usr/lib{,64}/gconv \ > +blacklist_lib="/usr/lib{,64}/gconv \ > /usr/{,lib64}/tc /usr/lib{,64}/tls /usr/lib{,64}/sse2 \ > /usr/lib{,64}/pkgconfig /usr/lib{,64}/nss /usr/lib{,64}/X11 \ > /usr/lib{,64}/games /usr/lib{,64}/alsa-lib /usr/lib{,64}/fs/reiserfs \ > @@ -119,6 +119,9 @@ find /usr/share -type d -exec rmdir {} \; > /dev/null 2>&1 > echo "Cleanup excess selinux modules" > $RM /usr/share/selinux > > +echo "Removing python source files" > +find / -name *.py -exec rm -f {} \; > + > echo "Running image-minimizer..." > %end >Does this mean the startup stuff can use python? -- bk
Alan Pevec
2008-Nov-30 15:07 UTC
[Ovirt-devel] Re: [PATCH node-image] Add minimal python into the Node
Perry Myers wrote:> core python libs and interpreter are added to facilitate scripting > Node size increases by approx 4MB compressed > > This patch removes all of the .py files installed by python RPM > since the .pyc and .pyo files are already present and the source > shouldn't be strictly needed.ACK, thanks! We can now use python for the next version of ovirt-config-* scripts, current ones are taking shell scripting to the limit. Pushed with the additional removal of .pyo files b/c optimized bytecode doesn't help much and we save 2MB. Side-effect is that python -O doesn't work, but that's not much used anyway - on my machine I found -O used only by /usr/bin/alacarte and /usr/bin/rpmlint scripts.