Gentoo Archives: gentoo-soc

From: Gunwant Jain <therealgunwant@×××××.com>
To: gentoo-soc@l.g.o
Subject: Re: Fwd: Re: [gentoo-soc] Weekly Report: Portage Powered Android
Date: Thu, 02 Jul 2020 12:01:53
Message-Id: 20200702120139.p6lorbuyjid7l4vy@tardis.localdomain
In Reply to: Re: Fwd: Re: [gentoo-soc] Weekly Report: Portage Powered Android by Benda Xu
1 On 20/07/02 03:47PM, Benda Xu wrote:
2 > Hi Gunwant,
3 >
4 > Gunwant Jain <therealgunwant@×××××.com> writes:
5 >
6 > >> In principle you can choose your way of achieving things. But
7 > >> considering you got stuck in making a functional 'bootstrap-init', I
8 > >> have 2 questions.
9 > >
10 > > I would like to clarify first that bootstrap-init works fine, but due
11 > > to the nature of build-system it requires, I was having difficulties
12 > > in compiling it natively in arm64 Gentoo.
13 >
14 > OK, good.
15 >
16 > >> 1. If you need to prepare a proper environment for Android to boot
17 > >> inside the LXC guest, please check out LXC container hooks in
18 > >> lxc.container.conf(5) manpage. Another init seems an overkill for
19 > >> me.
20 > >
21 > > I was going with this approach initially, but the container configs just
22 > > don't seem apt for a process like this. I mean to mount the early
23 > > partitions only, I have no clue how I would approach parsing the device
24 > > tree using the LXC conf.
25 > >
26 > > Although I had made some slight edits to the original container hook
27 > > scripts, for keeping the rootfs clean after reboots and more. You could
28 > > check the modified scripts in [1].
29 >
30 > Now I understand, thanks.
31 >
32 > >> 2. Why bootstrap-init needs to be written in C++? Would a shell script
33 > >> enough?
34 > >
35 > > I followed Magisk's approach of booting SAR Android. I thought of
36 > > rewriting the entire init but realised that that would be rather
37 > > inefficient. Therefore, I stripped all the "Magisk-y" code and put
38 > > forward the bare minimum required for functioning.
39 > > In theory, we could rewrite it all in shell, but then again, I would not
40 > > recommend it as it could be somewhat lengthy.
41 > > Moreover, this setup is scalable and it could be extended later for any
42 > > new boot-scheme Android pulls up.
43 >
44 > Good. That makes sense to me now.
45 >
46 > One last concern, what is your plan in the long run? If Magisk update
47 > his code, will you be able to easily cherry-pick to you code repository?
48
49 I don't think we are in a position to cherry-pick upstream commits as I
50 have proposed to change the project structure for adapting a newer
51 build-system (vs NDK) in the cmake branch of the repo [1].
52 Nevertheless, I will surely addon and maintain it for future
53 versions of Android; either by following Magisk, or by implementing our
54 own way of doing stuff.
55
56 Regards,
57 Gunwant
58
59 [1] https://gitlab.com/WantGuns/bootstrap-init/-/tree/cmake

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies