Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
sepolicy
Manage
Activity
Members
Plan
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CodeLinaro
public-release-test
platform
system
sepolicy
Commits
86123070
Commit
86123070
authored
7 years ago
by
TreeHugger Robot
Committed by
Android (Google) Code Review
7 years ago
Browse files
Options
Downloads
Plain Diff
Merge "sepolicy_version: change current version to NN.m format" into oc-dev
parents
72126e1b
42f95984
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Android.mk
+18
-12
18 additions, 12 deletions
Android.mk
tools/version_policy.c
+8
-0
8 additions, 0 deletions
tools/version_policy.c
with
26 additions
and
12 deletions
Android.mk
+
18
−
12
View file @
86123070
...
...
@@ -92,11 +92,15 @@ PLAT_PRIVATE_POLICY := $(LOCAL_PATH)/private
PLAT_VENDOR_POLICY
:=
$(
LOCAL_PATH
)
/vendor
REQD_MASK_POLICY
:=
$(
LOCAL_PATH
)
/reqd_mask
# The current version of the platform sepolicy.
# TODO: This must be fetched from build system after b/36783775
PLAT_PUBLIC_POLICY_CURRENT_VERSION
:=
100000.0
# TODO: move to README when doing the README update and finalizing versioning.
# BOARD_SEPOLICY_VERS
should contain the platform version identifier
# corresponding to the
platform
on which the non-platform
policy is to be
# based.
If unspecified, this will build against the current
public platform
# policy in tree
.
# BOARD_SEPOLICY_VERS
must take the format "NN.m" and contain the sepolicy
#
version identifier
corresponding to the
sepolicy
on which the non-platform
#
policy is to be
based. If unspecified, this will build against the current
#
public platform
policy in tree
# BOARD_SEPOLICY_VERS_DIR should contain the public platform policy which
# is associated with the given BOARD_SEPOLICY_VERS. The policy therein will be
# versioned according to the BOARD_SEPOLICY_VERS identifier and included as
...
...
@@ -104,7 +108,8 @@ REQD_MASK_POLICY := $(LOCAL_PATH)/reqd_mask
# platform policy does not break non-platform policy.
ifndef
BOARD_SEPOLICY_VERS
$(
warning
BOARD_SEPOLICY_VERS not specified, assuming current platform version
)
BOARD_SEPOLICY_VERS
:=
current
# The default platform policy version.
BOARD_SEPOLICY_VERS
:=
$(
PLAT_PUBLIC_POLICY_CURRENT_VERSION
)
BOARD_SEPOLICY_VERS_DIR
:=
$(
PLAT_PUBLIC_POLICY
)
else
ifndef
BOARD_SEPOLICY_VERS_DIR
...
...
@@ -319,13 +324,14 @@ include $(BUILD_SYSTEM)/base_rules.mk
# auto-generate the mapping file for current platform policy, since it needs to
# track platform policy development
current_mapping.cil
:=
$(
intermediates
)
/mapping/
current
.cil
$(current_mapping.cil)
:
PRIVATE_VERS := $(
BOARD_SEPOLICY
_VERS)
current_mapping.cil
:=
$(
intermediates
)
/mapping/
$(
PLAT_PUBLIC_POLICY_CURRENT_VERSION
)
.cil
$(current_mapping.cil)
:
PRIVATE_VERS := $(
PLAT_PUBLIC_POLICY_CURRENT
_VERS
ION
)
$(current_mapping.cil)
:
$(plat_pub_policy.cil) $(HOST_OUT_EXECUTABLES)/version_policy
@
mkdir
-p
$(
dir
$@
)
$(
hide
)
$(
HOST_OUT_EXECUTABLES
)
/version_policy
-b
$<
-m
-n
$(
PRIVATE_VERS
)
-o
$@
ifeq
($(BOARD_SEPOLICY_VERS), current)
ifeq
($(BOARD_SEPOLICY_VERS), $(PLAT_PUBLIC_POLICY_CURRENT_VERSION))
mapping_policy_nvr
:=
$(
current_mapping.cil
)
else
mapping_policy_nvr
:=
$(
addsuffix /
$(
BOARD_SEPOLICY_VERS
)
.cil,
$(
PLAT_PRIVATE_POLICY
)
/mapping
)
...
...
@@ -562,17 +568,17 @@ plat_policy.recovery.conf :=
# auto-generate the mapping file for current platform policy, since it needs to
# track platform policy development
current_mapping.recovery.cil
:=
$(
intermediates
)
/mapping/
current
.recovery.cil
$(current_mapping.recovery.cil)
:
PRIVATE_VERS := $(
BOARD_SEPOLICY
_VERS)
current_mapping.recovery.cil
:=
$(
intermediates
)
/mapping/
$(
PLAT_PUBLIC_POLICY_CURRENT_VERSION
)
.recovery.cil
$(current_mapping.recovery.cil)
:
PRIVATE_VERS := $(
PLAT_PUBLIC_POLICY_CURRENT
_VERS
ION
)
$(current_mapping.recovery.cil)
:
$(plat_pub_policy.recovery.cil) $(HOST_OUT_EXECUTABLES)/version_policy
@
mkdir
-p
$(
dir
$@
)
$(
hide
)
$(
HOST_OUT_EXECUTABLES
)
/version_policy
-b
$<
-m
-n
$(
PRIVATE_VERS
)
-o
$@
ifeq
($(BOARD_SEPOLICY_VERS),
current
)
ifeq
($(BOARD_SEPOLICY_VERS),
$(PLAT_PUBLIC_POLICY_CURRENT_VERSION)
)
mapping_policy_nvr.recovery
:=
$(
current_mapping.recovery.cil
)
else
mapping_policy_nvr.recovery
:=
$(
addsuffix /
$(
BOARD_SEPOLICY_VERS
)
.recovery.cil,
\
$(
PLAT_PRIVATE_POLICY
)
/mapping
)
$(
PLAT_PRIVATE_POLICY
)
/mapping
)
endif
current_mapping.recovery.cil
:=
...
...
This diff is collapsed.
Click to expand it.
tools/version_policy.c
+
8
−
0
View file @
86123070
...
...
@@ -87,6 +87,7 @@ int main(int argc, char *argv[])
char
*
base
=
NULL
;
char
*
tgt_policy
=
NULL
;
char
*
num
=
NULL
;
char
*
dot
;
char
*
output
=
NULL
;
struct
cil_db
*
base_db
=
NULL
;
struct
cil_db
*
out_db
=
NULL
;
...
...
@@ -138,6 +139,13 @@ int main(int argc, char *argv[])
usage
(
argv
[
0
]);
}
/* policy language doesn't like '.', so replace them with '_' in mapping version */
dot
=
num
;
while
((
dot
=
strchr
(
dot
,
'.'
))
!=
NULL
)
{
*
dot
=
'_'
;
++
dot
;
}
if
(
mapping
&&
tgt_policy
)
{
fprintf
(
stderr
,
"Please select only one mode between --mapping and --tgt_policy
\n
"
);
usage
(
argv
[
0
]);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment