-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 This patch compresses all pp files with bzip Adds three new interfaces. +int semanage_module_install_file(semanage_handle_t *, + const char *module_name); +int semanage_module_upgrade_file(semanage_handle_t *, + const char *module_name); +int semanage_module_install_base_file(semanage_handle_t *, + const char *module_name); These interfaces will read either compressed or uncompressed files and store them as compressed files in /etc/selinux/POLICY/targeted/modules/avtive/modules New functions bzip and bunzip, self explanatory. map_file which will take either a compresses or uncompressed file and return the uncompressed data as a memory mapped file. dupfile, which takes an open file descriptor and a filename and duplicates the open filedescriptor to the name. (Used for copying compressed files to the store.) Contains previous patch to setup sandbox as links rather then copies. Some stats: system-config-selinux currently needs over 100 megabytes of disk space to install policy packages, with these fixes we only Fedora 9 # du -m -s /etc/selinux/targeted /usr/share/selinux/targeted/ 40 /etc/selinux/targeted 48 /usr/share/selinux/targeted/ Fedora 10 With this patch # du -m -s /etc/selinux/targeted /usr/share/selinux/targeted/ 10 /etc/selinux/targeted 3 /usr/share/selinux/targeted/ This does not include the space savings in /usr/share/selinux/targeted/modules/tmp Which needs another 40Mb of disk. It does slow down the semodule command slightly, running semodule on all compressed policy packages in Fedora Targeted policy. # time semodule -b base.pp.bz2 -i ../*bz2 real 0m14.774s user 0m13.528s sys 0m0.883s Previous commands without patches # time semodule -b base.pp -i ../*.pp real 0m13.063s user 0m11.742s sys 0m1.179s Max Heap size, as reported by valgrind -tool=massif valgrind --tool=massif --massif-out-file=/tmp/old/massif-b /usr/sbin/semodule -b /usr/share/selinux/targeted/tmp/base.pp -i /usr/share/selinux/targeted/*.pp Without Compression 117970697 With Compression 118459897 -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (GNU/Linux) Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org iEYEARECAAYFAkjzvf0ACgkQrlYvE4MpobNp+QCdHl510g4d/5a72tkzKFh+mKx8 MRcAn0l5cAWfyPw147H6nuEHY2aRf0Re =6I0F -----END PGP SIGNATURE-----