From 63ab23845063299cc1ff74ff9a2e8367602a62c9 Mon Sep 17 00:00:00 2001 From: Jeff Vander Stoep Date: Thu, 25 Mar 2021 22:18:53 +0100 Subject: [PATCH] Run virtmanager with its new UID Bug: 183583115 Test: start virtmanager ps -AZ | grep virtmanager u: r:virtmanager:s0 virtmanager 2453 1 10930880 4544 0 0 S virtmanager Change-Id: Ib98029e61ee094842859609271e4d26b30cd2a7b --- apex/Android.bp | 8 ++++++++ apex/virtmanager.rc | 19 +++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 apex/virtmanager.rc diff --git a/apex/Android.bp b/apex/Android.bp index fa3806fa..bb736308 100644 --- a/apex/Android.bp +++ b/apex/Android.bp @@ -35,6 +35,8 @@ apex { "vm", ], filesystems: ["microdroid"], + prebuilts: ["com.android.virt.init.rc"], + file_contexts: ":com.android.virt-file_contexts", } apex_key { @@ -47,3 +49,9 @@ android_app_certificate { name: "com.android.virt.certificate", certificate: "com.android.virt", } + +prebuilt_etc { + name: "com.android.virt.init.rc", + src: "virtmanager.rc", + filename: "init.rc", +} diff --git a/apex/virtmanager.rc b/apex/virtmanager.rc new file mode 100644 index 00000000..4a411542 --- /dev/null +++ b/apex/virtmanager.rc @@ -0,0 +1,19 @@ +# Copyright (C) 2021 The Android Open Source Project +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +service virtmanager /apex/com.android.virt/bin/virtmanager + class main + user virtmanager + group virtmanager + disabled