|
23 | 23 | <link rel="apple-touch-icon" href="/favicon.ico"> |
24 | 24 | <link rel="stylesheet" href="/assets/css/site.css?v=b310d7c992"> |
25 | 25 | <link rel="stylesheet" href="/assets/css/main.css?v=ccd72260b9"> |
26 | | - <script type="application/ld+json">[{"@context": "https://schema.org", "@type": "TechArticle", "headline": "Kernel configuration", "description": "How to compile an Android kernel with Droidspaces support: the config options and patches for non-GKI and GKI kernels.", "url": "https://www.droidspaces.org/docs/kernel-configuration.html", "inLanguage": "en", "dateModified": "2026-10-03", "author": {"@type": "Organization", "name": "Droidspaces", "url": "https://www.droidspaces.org/", "sameAs": ["https://github.com/ravindu644/Droidspaces-OSS", "https://t.me/Droidspaces"]}, "publisher": {"@type": "Organization", "name": "Droidspaces", "url": "https://www.droidspaces.org/", "sameAs": ["https://github.com/ravindu644/Droidspaces-OSS", "https://t.me/Droidspaces"]}, "isPartOf": {"@type": "WebSite", "name": "Droidspaces", "url": "https://www.droidspaces.org/"}}, {"@context": "https://schema.org", "@type": "BreadcrumbList", "itemListElement": [{"@type": "ListItem", "position": 1, "name": "Home", "item": "https://www.droidspaces.org/"}, {"@type": "ListItem", "position": 2, "name": "Documentation", "item": "https://www.droidspaces.org/docs/"}, {"@type": "ListItem", "position": 3, "name": "Kernel configuration", "item": "https://www.droidspaces.org/docs/kernel-configuration.html"}]}]</script> |
| 26 | + <script type="application/ld+json">[{"@context": "https://schema.org", "@type": "TechArticle", "headline": "Kernel configuration", "description": "How to compile an Android kernel with Droidspaces support: the config options and patches for non-GKI and GKI kernels.", "url": "https://www.droidspaces.org/docs/kernel-configuration.html", "inLanguage": "en", "dateModified": "2026-10-04", "author": {"@type": "Organization", "name": "Droidspaces", "url": "https://www.droidspaces.org/", "sameAs": ["https://github.com/ravindu644/Droidspaces-OSS", "https://t.me/Droidspaces"]}, "publisher": {"@type": "Organization", "name": "Droidspaces", "url": "https://www.droidspaces.org/", "sameAs": ["https://github.com/ravindu644/Droidspaces-OSS", "https://t.me/Droidspaces"]}, "isPartOf": {"@type": "WebSite", "name": "Droidspaces", "url": "https://www.droidspaces.org/"}}, {"@context": "https://schema.org", "@type": "BreadcrumbList", "itemListElement": [{"@type": "ListItem", "position": 1, "name": "Home", "item": "https://www.droidspaces.org/"}, {"@type": "ListItem", "position": 2, "name": "Documentation", "item": "https://www.droidspaces.org/docs/"}, {"@type": "ListItem", "position": 3, "name": "Kernel configuration", "item": "https://www.droidspaces.org/docs/kernel-configuration.html"}]}]</script> |
27 | 27 | <script>(function(){const t=localStorage.getItem('theme');if(t)document.documentElement.setAttribute('data-theme',t);})();</script> |
28 | 28 | </head> |
29 | 29 | <body> |
@@ -122,13 +122,17 @@ <h3 id="step-1-mandatory-configuration">Step 1: Mandatory configuration <a class |
122 | 122 | <span class="c"># Control groups support</span> |
123 | 123 | <span class="nv">CONFIG_CGROUPS</span><span class="o">=</span>y |
124 | 124 | <span class="nv">CONFIG_CGROUP_DEVICE</span><span class="o">=</span>y |
125 | | -<span class="nv">CONFIG_CGROUP_PIDS</span><span class="o">=</span>y |
126 | | -<span class="nv">CONFIG_MEMCG</span><span class="o">=</span>y |
127 | 125 | <span class="nv">CONFIG_CGROUP_SCHED</span><span class="o">=</span>y |
128 | 126 | <span class="nv">CONFIG_FAIR_GROUP_SCHED</span><span class="o">=</span>y |
129 | 127 | <span class="nv">CONFIG_CGROUP_FREEZER</span><span class="o">=</span>y |
130 | 128 | <span class="nv">CONFIG_CGROUP_NET_PRIO</span><span class="o">=</span>y |
131 | 129 |
|
| 130 | +<span class="c"># Resource limits: --memory, --cpus, --pids-limit, in that order.</span> |
| 131 | +<span class="c"># Optional: a limit whose option is missing is skipped with a warning</span> |
| 132 | +<span class="nv">CONFIG_MEMCG</span><span class="o">=</span>y |
| 133 | +<span class="nv">CONFIG_CFS_BANDWIDTH</span><span class="o">=</span>y |
| 134 | +<span class="nv">CONFIG_CGROUP_PIDS</span><span class="o">=</span>y |
| 135 | + |
132 | 136 | <span class="c"># Device filesystem support</span> |
133 | 137 | <span class="nv">CONFIG_DEVTMPFS</span><span class="o">=</span>y |
134 | 138 |
|
@@ -258,7 +262,8 @@ <h3 id="step-1-apply-the-mandatory-kabi-patches">Step 1: Apply the mandatory kAB |
258 | 262 | <h3 id="step-2-edit-gki_defconfig">Step 2: Edit <code>gki_defconfig</code> <a class="header-anchor" href="#step-2-edit-gki_defconfig">#</a></h3> |
259 | 263 | <p>Do not use separate fragment files here. Edit <code>arch/arm64/configs/gki_defconfig</code> directly and apply this <strong>GKI-only configuration</strong>.</p> |
260 | 264 | <p>These options are tested on all GKI kernels and do not break the ABI.</p> |
261 | | -<div class="callout callout-warning"><strong class="callout-title">Warning</strong><p><strong>Do not</strong> enable anything beyond the GKI configuration below. These specific options are kABI-safe only in combination with the Step 1 patch.</p></div> |
| 265 | +<div class="callout callout-warning"><strong class="callout-title">Warning</strong><p><strong>Do not</strong> enable anything beyond the GKI configuration below. These specific options are kABI-safe only in combination with the Step 1 patch.</p> |
| 266 | +<p>The <strong>Resource limits</strong> group at the end is the exception: it is not kABI-tested. Leave it out unless you need CPU or process limits, and test each option on its own.</p></div> |
262 | 267 | <div class="code-block"><span class="code-lang">makefile</span><button class="icon-button copy-btn" onclick="copyCode(this)" aria-label="Copy"><span class="icon" aria-hidden="true">content_copy</span></button><pre><code><span class="c"># Kernel configurations for full DroidSpaces support for GKI</span> |
263 | 268 | <span class="c"># Copyright (C) 2026 ravindu644 <droidcasts@protonmail.com></span> |
264 | 269 |
|
@@ -300,6 +305,12 @@ <h3 id="step-2-edit-gki_defconfig">Step 2: Edit <code>gki_defconfig</code> <a cl |
300 | 305 | <span class="c"># For NixOS support</span> |
301 | 306 | <span class="nv">CONFIG_TMPFS_POSIX_ACL</span><span class="o">=</span>y |
302 | 307 | <span class="nv">CONFIG_TMPFS_XATTR</span><span class="o">=</span>y |
| 308 | + |
| 309 | +<span class="c"># Resource limits: --cpus and --pids-limit. CONFIG_MEMCG is already on in GKI.</span> |
| 310 | +<span class="c"># Not covered by the kABI patches: both resize scheduler and cgroup structures</span> |
| 311 | +<span class="c"># that vendor modules read. Enable one at a time and be ready for a bootloop</span> |
| 312 | +<span class="nv">CONFIG_CFS_BANDWIDTH</span><span class="o">=</span>y |
| 313 | +<span class="nv">CONFIG_CGROUP_PIDS</span><span class="o">=</span>y |
303 | 314 | </code></pre></div> |
304 | 315 | <p><strong>How to edit the file:</strong></p> |
305 | 316 | <ul> |
@@ -335,6 +346,7 @@ <h3 id="1-run-the-requirements-check">1. Run the requirements check <a class="he |
335 | 346 | <li>OverlayFS support (optional, for volatile mode)</li> |
336 | 347 | <li>VETH and Bridge support (optional, for NAT mode)</li> |
337 | 348 | <li>IPv6 NAT support (optional, for IPv6 in NAT mode)</li> |
| 349 | +<li>Memory, CPU and process limit support (optional, for <code>--memory</code>, <code>--cpus</code> and <code>--pids-limit</code>)</li> |
338 | 350 | <li>PTY/devpts support</li> |
339 | 351 | <li>Loop device support</li> |
340 | 352 | <li>ext4 support</li> |
@@ -427,6 +439,21 @@ <h3 id="3-what-to-do-if-something-is-missing">3. What to do if something is miss |
427 | 439 | <td><code>CONFIG_SECCOMP=y</code></td> |
428 | 440 | <td>Seccomp shield disabled. Security risk.</td> |
429 | 441 | </tr> |
| 442 | +<tr> |
| 443 | +<td>Memory limit</td> |
| 444 | +<td><code>CONFIG_MEMCG=y</code></td> |
| 445 | +<td><code>--memory</code> is skipped.</td> |
| 446 | +</tr> |
| 447 | +<tr> |
| 448 | +<td>CPU limit</td> |
| 449 | +<td><code>CONFIG_CFS_BANDWIDTH=y</code></td> |
| 450 | +<td><code>--cpus</code> is skipped.</td> |
| 451 | +</tr> |
| 452 | +<tr> |
| 453 | +<td>Process limit</td> |
| 454 | +<td><code>CONFIG_CGROUP_PIDS=y</code></td> |
| 455 | +<td><code>--pids-limit</code> is skipped.</td> |
| 456 | +</tr> |
430 | 457 | </tbody> |
431 | 458 | </table></div> |
432 | 459 | <hr /> |
|
0 commit comments