Commit graph

14 commits

Author SHA1 Message Date
Inseob Kim
f038c8f1ac Add 202404 mapping files
Bug: 327954176
Test: m treble_sepolicy_tests_202404
Test: m 202404_compat_test
Test: m selinux_policy
Change-Id: I6bdcbff305c0cc998bdd809006feb02e0609784d
2024-03-11 16:38:02 +09:00
Inseob Kim
085f22f82d Add macros to flag-guard te and contexts files
This adds two macros which can be used in te files and contexts files.

* is_flag_enabled(flag_name, codes)
* is_flag_disabled(flag_name, codes)

Also flag-guarding requires to process input files before any
validations. Property contexts test and seapp contexts test are
modified a little to handle that.

Bug: 306563735
Test: build with manual guarding
Change-Id: Ia1c6d00b7aab0da3901c19f16d553153aace018c
2023-11-09 16:05:17 +09:00
Inseob Kim
61d6beb39e Skip building compat files if REL
Bug: 296780580
Test: build with next
Change-Id: I588d249f35fc7049d0db3b64692ed818050af0ed
2023-08-23 08:41:44 +00:00
Inseob Kim
78fd639cac Add 34.0 mapping files
Bug: 288517951
Test: m treble_sepolicy_tests_34.0
Test: m 34.0_compat_test
Test: m selinux_policy
Change-Id: I5c20439dd2c7e5a8d739b8ea9a97e5060ce3cec4
2023-06-23 10:43:17 +00:00
Inseob Kim
646f181c95 Remove 34.0 compat modules
... these are added by mistake with aosp/2519755. Not needed for now

Bug: N/A
Test: TH
Change-Id: I121db03698c51aa3520a40d76bcd3ec1f4afe422
2023-04-07 09:59:09 +09:00
Inseob Kim
d16612cd8a Remove 28.0 compat support
Treble doesn't support U system + P vendor, so removing P (28.0)
prebuilts and compat files.

Bug: 267692547
Test: build
Change-Id: I3734a3d331ba8071d00cc196a2545773ae6a7a60
2023-04-03 15:17:03 +09:00
Inseob Kim
0c4a3ed6e9 Remove redundant comments
Because compat/Android.bp will be modified by compat generate script.

Bug: 207344718
Test: N/A
Change-Id: I4e94db4a9aab492d7fd6df97fad7bfe80756260c
2022-10-19 18:22:48 +09:00
Inseob Kim
79fdbeb1ce Reorganize Android.bp files and modules
Test: build and boot
Change-Id: Id8a1a2faecf37de81b91e2669f6afa4cbe91443c
2022-08-17 09:50:22 +09:00
Inseob Kim
4ae05118c1 Add 33.0 mapping files
Steps taken to produce the mapping files:

0. Add 33.0 prebuilts to prebuilts/api/33.0/.

1. Add the following Android.bp modules.

    33.0.board.compat.map
    33.0.board.compat.cil
    33.0.board.ignore.map
    plat_33.0.cil
    system_ext_33.0.cil
    product_33.0.cil
    33.0.ignore.cil
    system_ext_33.0.ignore.cil
    product_33.0.ignore.cil
    33.0.compat.cil
    system_ext_33.0.compat.cil

2. Touch the following three files.

    private/compat/33.0/33.0.cil
    private/compat/33.0/33.0.compat.cil
    private/compat/33.0/33.0.ignore.cil

3. Add 33.0 to PLATFORM_SEPOLICY_COMPAT_VERSIONS on
build/make/core/config.mk. Note that we don't update
sepolicy_major_vers to 33, but just update compat versions.

4. Run the following command.

    $ source build/make/rbesetup.sh && lunch aosp_arm64-userdebug
    $ m sepolicy_generate_compat
    $ sepolicy_generate_compat --branch=tm-dev \
        --build latest --target-version 33.0 \
        --latest-version 32.0

This change also enables treble_sepolicy_tests_33.0 and installs
33.0.cil mapping file onto the device.

Test: m treble_sepolicy_tests_33.0
Test: m 33.0_compat_test
Test: m slinux_policy
Change-Id: Ie969ff0372ff1268776165cee5cb5b07d303453c
2022-05-02 14:12:28 +09:00
Inseob Kim
4196403c36 Replace se_filegroup to se_build_files
se_build_files is a replacement for se_filegroup module. se_build_files
can be used with the normal Soong convention ":module_name{.tag}" by
implementing android.OutputFileProducer. It's better than implementing
ad-hoc logics across various modules, which is the case for se_filegroup
module.

Test: build and boot
Change-Id: Ic0e34549601eb043145e433055f5a030eaf4347e
2022-04-23 01:47:40 +09:00
Treehugger Robot
e9b0ec455d Merge "Migrate sepolicy compat test to Android.bp" 2022-01-10 02:09:23 +00:00
Inseob Kim
16d3be3dac Migrate sepolicy compat test to Android.bp
compat_test tests whether {ver}.compat.cil is compatible to current
policy or not. This commit migrates all tests into a single module named
"sepolicy_compat_tests".

A minor issue is also resolved with this migration. Suppose that the
vendor's speolicy version is {VER}. Then the following cil files are
compiled in runtime.

- system/etc/selinux/plat_sepolicy.cil
- system/etc/selinux/mapping/{VER}.cil
- system/etc/selinux/mapping/{VER}.compat.cil (optional)
- system_ext/etc/selinux/system_ext_sepolicy.cil (optional)
- system_ext/etc/selinux/mapping/{VER}.cil (optional)
- system_ext/etc/selinux/mapping/{VER}.compat.cil (optional)
- product/etc/selinux/product_sepolicy.cil (optional)
- product/etc/selinux/mapping/{VER}.cil (optional)
- product/etc/selinux/mapping/{VER}.compat.cil (optional)
- vendor/etc/selinux/vendor_sepolicy.cil
- vendor/etc/selinux/plat_pub_versioned.cil
- odm/etc/selinux/odm_sepolicy.cil (optional)

That is, the vendor policy of version {VER} (vendor_sepolicy.cil,
plat_pub_versioned.cil, and odm_sepolicy.cil) is required to be
compatible only to {VER}.compat.cil. So, the vendor policy is included
only to $(BOARD_SEPOLICY_VERS)_compat_test. The other tests will be
built only with platform side policies.

Bug: 33691272
Test: boot
Test: manually edit {ver}.compat.cil files and try build
Change-Id: I16b30a9171f10ee8f08fc03b7bd7c047eec12b19
2022-01-07 18:53:46 +09:00
Bob Badour
048e48cbed [LSC] Add LOCAL_LICENSE_KINDS to system/sepolicy
Added SPDX-license-identifier-Apache-2.0 to:
  compat/Android.bp
  contexts/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all
Change-Id: Ie1f38c4f255b6c0b3d2351638cfa3a43e6cf130c
2022-01-05 11:14:44 -08:00
Inseob Kim
baee4a2cb6 Split compat and contexts part in Android.bp
Because Android.bp is getting bigger and bigger.

Test: build and boot
Test: set OVERRIDE_TARGET_FLATTEN_APEX=true and build
Change-Id: I397ce084bfbc98449d177dd553ff73fdfbdddcaf
2021-12-23 21:36:56 +09:00