Gentoo Archives: gentoo-soc

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

Attachments

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

Replies

Subject Author
Re: Fwd: Re: [gentoo-soc] Weekly Report: Portage Powered Android Gunwant Jain <therealgunwant@×××××.com>