I am thinking of adding compression to libselinux

Richard W.M. Jones rjones at redhat.com
Thu Sep 12 19:05:55 UTC 2013


On Thu, Sep 12, 2013 at 07:53:30AM -0400, Daniel J Walsh wrote:
> Basically looking at compressing the policy file to shrink SELinux footprint
> in the minimal install/cloud image.
> 
> Currently the policy modules (pp files) are shipped with bzip compression but
> the actually policy file.
> 
> But the /etc/selinux/targeted/policy/policy.29 is not compressed.  systemd and
> load_policy use libselinux to read in the policy file and load it into the
> kernel, so since systemd currently uses libxz, I figured this would be the
> best solution to add libxz support to libselinux.

This example code may be helpful.  It loads a file that may be gzip or
lzma (xz) compressed into memory:

https://github.com/libguestfs/supermin/blob/master/helper/init.c#L284

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine.  Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/


More information about the devel mailing list