1 |
Thanks for your query. |
2 |
|
3 |
On 20/06/23 12:45PM, Pengcheng Xu wrote: |
4 |
> Have you figured out _why_ Android is not booting? I can think of a bunch of reasons, such as missing dependencies for a dynamically-linked executable, crashing on execution, etc. Simply saying "would not boot Android" does not convey any information. |
5 |
|
6 |
The binary exits after execution in the container. Also, it is a static |
7 |
binary. |
8 |
|
9 |
> Besides, I don't think you need NDK for something as low-level as an init; you shouldn’t need one as long as the code does not use Android-specific functions or call into Android service (e.g. vold). You should be able to get away with something standard, i.e. newlib/musl/glibc. I haven't read the source code though, and I might be wrong here; do your survey. |
10 |
|
11 |
I had the same thoughts/arguments regarding using NDK for init. Also as |
12 |
far as I can tell, it does not depend any Android-specific functions |
13 |
either. But even then, using Gentoo's libc does not produce a working |
14 |
binary. Couple of things to keep in mind regarding the NDK setup: |
15 |
- It uses clang instead of gcc |
16 |
- Uses a different sysroot, which is provided/bundled in NDK itself |
17 |
(it is bundled according to the API level). |
18 |
- It uses a different STL (again, bundled with NDK). |
19 |
|
20 |
> You may try with bionic toolchain, but just as I said, so long as no Android-specific APIs are involved, libc should not be the problem. |
21 |
|
22 |
I would argue the same actually, but using Bionic is the closest we can |
23 |
get to have a NDK like environment without actually using NDK. |
24 |
|
25 |
|
26 |
If required, I could also have this week devoted entirely in rewriting |
27 |
`bootstrap-init`, but this would be counter-productive since the same |
28 |
code-base produces working binaries using a different build-system. |
29 |
|
30 |
I am open to any new advices on this topic. |
31 |
|
32 |
Regards, |
33 |
Gunwant |
34 |
|
35 |
> |
36 |
> Regards, |
37 |
> -- |
38 |
> Pengcheng Xu |
39 |
> https://jsteward.moe |