# Customize

Source: [https://docs.qualcomm.com/doc/80-70015-11/topic/customize.html](https://docs.qualcomm.com/doc/80-70015-11/topic/customize.html)

Customization is supported for memory and SEPolicy. For a large-size trusted
        application, you can customize the memory regions.

## Memory customization

This feature is available to licensed developers with authorized access to customize
                the memory. If you have access, see [Qualcomm Linux Security Guide - Addendum → Memory
                    customization](https://docs.qualcomm.com/bundle/resource/topics/80-70015-11A/memory-optimization.html).

## SEPolicy customization

Qualcomm SEPolicy depends on the upstream SEPolicy. Therefore, the upstream
                    SEPolicy’s make system is used for building and customizing the
                SEPolicy.

Any customization to upstream code must be stored in the [patches](https://github.com/quic-yocto/meta-qcom-hwe/tree/kirkstone/dynamic-layers/selinux/recipes-security/sepolicy/patches) directory as a path to the
                upstream code. You can find the upstream code at [https://github.com/SELinuxProject/refpolicy/](https://github.com/SELinuxProject/refpolicy/)

The Qualcomm code is configured to the monolithic SEPolicy mode (a single SEPolicy
                image).

**Compile SEPolicy**

To compile the SEPolicy, run the following
                commands:

    export SHELL=/bin/bashCopy to clipboard

Set
                up the build environment. For instructions, see [Qualcomm Linux Build Guide ➝ GitHub workflow for unregistered
                users.](https://docs.qualcomm.com/bundle/publicresource/topics/80-70015-254/github_workflow_unregistered_users.html)

    bitbake <recipe_file_name>Copy to clipboard

**Modify and build**

You can also modify and build incrementally.

The audit2allow and research tools on Ubuntu 18 or 20 do not support policy version
                33. The policy version33 is supported from Ubuntu 23. If you are not using Ubuntu
                23, you can use a docker setup or a virtual machine to run audit2allow.

**Install docker**

The following command is used to install docker on Ubuntu with lower version.

sudo docker pull ubuntu:23.04
    sudo docker run -ti --rm ubuntu /bin/bash
    apt-get update
    apt-get -y install policycoreutils
    apt-get install -y policycoreutils-python-utilsCopy to clipboard

Then run audit2allow on this
                shell .

Pull the policy version33 from the target
                    /etc/selinux/mls/policy/policy.33. This policy is also
                available in the build tree. Use the mountbind or docker copy commands to share the
                policy with the docker.

**Capture denials**

If the command prompt does not change when `policy.33` is pulled from
                the target /build, and if denials.txt is a
                file capturing the denials, use the following
                command:

    audit2allow -i denails.txt -p policy.33Copy to clipboard

**Command not found**

If this command is not found, then use the following command to install the required
                package:

    sudo apt install policycoreutils-python-utilsCopy to clipboard

Last Published: Oct 14, 2024

[Previous Topic
Install or upgrade QCS5430 SoftSKU feature packs](https://docs.qualcomm.com/bundle/publicresource/80-70015-11/topics/upgrade-qualcomm-wes-feature-pack.md) [Next Topic
Debug](https://docs.qualcomm.com/bundle/publicresource/80-70015-11/topics/debug.md)