Commit Graph

26 Commits

Author SHA1 Message Date
Jooyung Han f207f09e39 microdroid runs in a single mount namespace
Since there's no two separate mount namespace, we don't need to
"enter_default_mount_ns".

Bug: 185991357
Test: MicrodroidHostTestCases
Change-Id: I0bea5ef51da95c378ade1288c36d4cab91266ab2
2021-07-29 17:17:36 +09:00
Jiyong Park 858c0404d4 Add the standard cpuset nodes
These nodes are not meaningful in Microdroid, but added here in order to
satisfy the existing code that tries to put a PID to one of the cpusets.

Bug: 193118995
Test: run microdroid. Check if errors like the below are not shown:
couldn't write 152 to /dev/cpuset/system-background/tasks

Change-Id: Ibafb25355936ef21b6517c5707d093d25fc2d247
2021-07-15 16:19:11 +09:00
Jooyung Han 1a72c6fadf microdroid: remove sdkext APEX
com.android.sdkext is to decide the extension SDK level of the device
and set system properties so that apps can query it.

In microdroid we don't support it yet. So remove it from the mandatory
system APEX list.

Bug: 193118107
Test: MicrodroidHostTestCases
Change-Id: I1e913b0826d78f06439ec37889e390ef97c4623a
2021-07-09 14:39:09 +09:00
Andrew Scull 9ba2657f2f Add microdroid-specialized KeyMint service
KeyMint in microdroid will initially be a specialized version of the
software KeyMint reference implementation. Begin this specialization by
removing the services that aren't needed within VMs.

Bug: 190578423
Test: atest MicrodroidHostTestCases
Change-Id: I6eee95944ccc555656868dad193f29b83ebf46a4
2021-06-23 08:46:56 +00:00
Inseob Kim 6b8d08001b Remove unused triggers in init.rc
Triggers like bpf, zygote, firmware are not needed in microdroid.

Bug: N/A
Test: boot microdroid
Change-Id: I1e924fa4810de7245c1d86ff797f6d4ca9e17c77
2021-06-18 13:00:50 +09:00
Paul Crowley 62c5682bbc Merge "Remove wait_for_keymaster and all references" 2021-06-17 18:18:28 +00:00
Jooyung Han d4a7a7a043 microdroid: apk is mounted via apkdmverity
In microdroid, APK and its idsig is used to dm-verity mount before
zipfuse mounts it into a filesystem.

Bug: 190343842
Test: MicrodroidHostTestCases
Change-Id: Icd48fb823eabc087c0266e46f9b3d302e90fd208
2021-06-17 14:29:29 +09:00
Paul Crowley d5426704bd Remove wait_for_keymaster and all references
No longer needed now init listens for property changes on a
separate thread.

Bug: 186580823
Test: Cuttlefish boots successfully
Test: atest MicrodroidHostTestCases
Change-Id: I4953e1f9e596db6e8b5ecc49a05cbf4375b7f6c4
2021-06-15 16:45:02 -07:00
Inseob Kim 17d0db10da Change /data to tmpfs
For security reason, we will use tmpfs for /data. It should contain only
small, temporary files for now.

vold is removed as it's redundant now. MicrodroidTestCase's boot marker
is also updated because logd reinit won't happen if vold is removed.

Bug: 185767624
Test: atest MicrodroidHostTestCases
Change-Id: I3f60d5dfad2519b6d593a3f514bb50c50019b526
2021-06-09 14:30:47 +09:00
Inseob Kim de6b6894f6 Enable file encryption on /data partition
For now, the default implementation will be used. In the future,
microdroid-specific keymint HAL will be implemented.

Bug: 185767624
Test: atest MicrodroidHostTestCases
Test: mount userdata.img and see files encrypted
Change-Id: I593e659b60d6b33b153f8d614395755e83e597de
2021-06-02 20:40:48 +09:00
Inseob Kim 8f095c900c Add vold and keymint related services
These are for encrypting /data partition. Also vintf related xmls are
added for the services.

Bug: 185767624
Bug: 188013319
Test: boot microdroid
Change-Id: Ie511e2b4f3565fef181cc57588c2e107182f1961
2021-06-02 20:38:51 +09:00
Jooyung Han 16186d9519 microdroid: do not use bootstrap mount namespace
In microdroid, init enters "default" mount namespace from the beginning
and every process starts in it.

Bug: 185991357
Test: MicrodroidHostTestCases
Change-Id: I36262de8a6ff3bcf452e27c21716cfffe84d6d72
2021-06-01 19:59:13 +09:00
Jooyung Han 347d9f2bee microdroid_manager: initial impl
It is started by init in microdroid and executes a command specified in
a VM payload config.

Bug: 189301496
Test: MicrodroidHostTestCases
  (in a microdroid, run /system/bin/microdroid_manager manulally)
Change-Id: I85c7e370d4a0dcf58b4aafbe6e9fba73e69c2a44
2021-05-28 07:30:44 +09:00
Inseob Kim 67ab436363 Update init.rc and fstab to normal convention
Bug: 185767624
Test: boot and see data mounted
Change-Id: Iabeca8c4c03df586ee1a65e8274e3667c2bdd2dc
2021-05-26 17:17:05 +09:00
Jiyong Park 9abfc1f67a Run zipfuse in microdroid
zipfuse now runs in microdroid as a service. The source zip file path
and the mount point are fixed to /dev/block/by-name/microdroid-apk and
/mnt/apk, respectively.

To support that, microdroid_payload.json is amended to add
MicrodroidTestAppk.apk to the payload.img file. This eventually should
be done dynamically by the virt manager.

Bug: 186377508
Test: atest MicrodroidHostTestCases
Change-Id: I7a031ad442995dbd3cdc00a51a0e939c1589a7b2
2021-05-24 09:24:48 +09:00
Inseob Kim 7f8ac32ccb Remove redundant tombstoned directory
/data/anr is technically also redundant, but we have to fix tombstoned
to fix it. Leaving it as-is is simpler.

Bug: 185210957
Test: boot microdroid and run debuggerd
Change-Id: Ib8411143761109c94d3d476cf69679f06086849e
2021-04-29 22:42:39 +09:00
Inseob Kim 87ba1f12a1 Create /data/local/tmp and add test writing to it
Bug: 185767624
Test: atest MicrodroidHostTestCases
Change-Id: Iba9c640e4e8e535f861836be97b6aa0830f86e8c
2021-04-27 16:52:02 +09:00
Inseob Kim cd13c69150 Run tombstoned service on microdroid
Bug: 185210957
Test: run debuggerd in microdroid
Change-Id: I20c9dc33c625012f7c9d2a6af4350ee50e38ef25
2021-04-23 16:00:44 +09:00
Inseob Kim afd9dc07f4 Add userdata partition to microdroid
Many programs need /data (especially /data/local/tmp) to properly work.
This change adds a basic unencrypted ext4 userdata partition to
microdroid. Eventually microdroid will support userdata encryption so
only VM can access /data.

Bug: 185767624
Test: atest MicrodroidHostTestCases
Test: log in to microdroid and test writing to /data
Change-Id: I115a8083ad6741fea9dedd61eca7194b1b5e5712
2021-04-23 15:59:35 +09:00
Jooyung Han 017916bf35 Microdroid activates host APEXes
Host apexes are passed to microdroid via the payload composite image.
The payload composite image can be created by either
mk_payload_signature/mk_cdisk or mk_payload.

For now, microdroid expects two APEXes from the host:
- com.android.adbd
- com.android.sdkext

The exact set of host apexes for microdroid is TBD. The current set is
only for demonstration.

Bug: 181093750
Test: MicrodroidTestCase
Change-Id: I7fe33fe03ac94799a4e109b83286bfb39e44b882
2021-04-21 23:20:29 +09:00
Jooyung Han c36b18a443 Apexd runs in microdroid
Previously, we ran only 'apexd-bootstrap' because 'apexd' crashes due to
the lack of /data/apex in microdroid.

Now apexd runs in "vm" mode. In vm mode, apexd only activates built-in
apexes and block apexes. No data apexes, no session handling.

Bug: 179342589
Test: MicrodroidTestCase
Change-Id: I8c6a16c3b08010fcb008d822d0ba0e311c0a9985
2021-04-21 23:19:04 +09:00
Inseob Kim 23ce158063 Add build.prop for microdroid
Bug: 181728482
Test: boot microdroid, adb shell getprop
Change-Id: Ief3064661d8a2fd715a69880e4024abcc8357be2
2021-04-06 21:25:57 +09:00
Inseob Kim 95d620c09b Remove services except for adb
Now init_rc is packaged, so we don't need to define services in
microdroid's init.rc. The exception is adb, which is meant to be in
APEX.

Bug: 181747401
Test: boot and see logd, servicemanager, and apex-bootstrap work
Change-Id: I177bec881a595b30983b9e67d9f76c0865ff3863
2021-03-11 14:20:24 +09:00
Jiyong Park 22bdc857c5 Enable adbd on microdroid
The following system properties are forcibly set to make adbd function.

ro.apex.updatable=true : otherwise, apexd doesn't activate critical
APEXes like the runtime APEX

ro.adb.secure=0 : to bypass the adb authentication

ro.debuggable=1 : to be able to use ro.adb.secure=0

This change also updates README.md file for the instruction to use adb.

Bug: 181728474
Test: adb shell works towards microdroid. See microdroid/README.md

Change-Id: Ica405e8bd4d2d1ef03e545aef5ed07ddc4bea34c
2021-03-04 09:46:34 +09:00
Inseob Kim 870e76bdb4 Add linkerconfig to microdroid
Bug: 179340111
Test: boot microdroid on cuttlefish VM
Change-Id: I19117fea79095b2e13c625da871cfa33d9ad6724
2021-02-25 18:26:14 +09:00
Inseob Kim dc2af866ec Add minimized init.rc and services to microdroid
This adds a minimized init.rc and services to microdroid, so microdroid
can boot and adb can work.

Bug: 179340780
Test: boot with manually added selinux stuffs and apexd session patch
Change-Id: I42ae13f3f2ac9ca22ed646564867da3931824682
2021-02-18 09:25:11 +09:00