Repository navigation
Conversation
flavours/<arch>/android.config holds the lines the android flavour changes in a stem's config, and patches/android/ the patch it carries on every stem. CONFIG_ONLY=1 seeds a missing <stem>-android config from the stem's config plus the fragment and fails unless every fragment line survives olddefconfig. A build still reads the committed resolved config, and 6.1.158-android resolves and applies exactly as before.
Seeded with CONFIG_ONLY=1 ./build.sh 6.1.190-android on x86_64; every line of flavours/x86_64/android.config survived. arm64 still needs resolving on an arm64 machine.
Resolved natively on arm64 (buildpack-deps:noble, CONFIG_ONLY=1). The arm64 fragment drops three lines no 6.1 tree can keep: CONFIG_IPV6_PRIVACY (removed upstream), CONFIG_MEMCG_SWAP (dropped in 6.1, swap accounting follows SWAP and MEMCG) and CONFIG_NFT_COUNTER (built into nf_tables). The x86_64 fragment never carried them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AtipGDi8uiAr2rwfSnqLQF
|
We require contributors to sign our Contributor License Agreement, and we don't have @Davixk on file. You can sign our CLA at https://e2b.dev/docs/cla . Once you've signed, post a comment here that says '@cla-bot check' |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The android flavour is a full config,
configs/<arch>/6.1.158-android.config. The weekly bump neither seeds from it nor bumps it, so the flavour is stuck on 6.1.158 while the stems moved on to 6.1.190. Carrying it to a new stem by hand means copying a 3,600-line config and working out again which lines are Android's.Change
flavours/<arch>/android.configholds only the lines the flavour changes in a stem's config (181 on x86_64, 117 on arm64), with a header saying how they were derived.patches/6.1.158-android/topatches/android/(a pure rename, content unchanged) and applies after the stem's patches on every<stem>-androidbuild. Ifpatches/<stem>-android/holds patches, they replace the shared set for that one build, for a stem the shared patch no longer applies to.build.sh: withCONFIG_ONLY=1 ./build.sh <stem>-<flavour> [arch], whenconfigs/<arch>/<stem>-<flavour>.configdoes not exist yet butflavours/<arch>/<flavour>.configdoes, the config is seeded fromconfigs/<arch>/<stem>.configwith the fragment appended (Kconfig takes a symbol's last assignment, so the fragment wins). It is resolved witholddefconfigas for any version, and the build salt is set from the tag. It fails without writing anything if any fragment line did not survive. A symbol the resolved config leaves out counts asn, the same way Kconfig reads it. An existing flavoured config is re-settled as before and checked against the fragment again. A normal build still reads the committed resolved config, so what ships is what was reviewed.scripts/flavour_fragment.pyderives a fragment from a flavoured config and its seed. The same module provides the survival check the tests use.scripts/test_flavours.py: every committed<stem>-<flavour>.configkeeps every line of its fragment; every pin inkernel_versions.txthas a config on both arches; unit tests for the derivation and the survival rule.test_ipvs_config.pynow skips pins with no config on an arch, so a missing config fails once, intest_flavours.py, instead of raisingFileNotFoundErrorin every IPVS test.6.1.190-androidis pinned, andconfigs/x86_64/6.1.190-android.configis produced by the new CONFIG_ONLY path.<new stem>-android(pin it, seed it withCONFIG_ONLY=1on each arch).6.1.158-android builds exactly as before: its committed config is unchanged and still read as is, the stem patches apply first, then the same memfd patch byte for byte (100% rename), in the same order.
How the fragments were derived
A fragment is every symbol whose value differs between the config the flavour was seeded from and the flavour's resolved config, with the flavour's value. A symbol a config leaves out counts as
n. Toolchain probes (CC_*,AS_*,LD_*,GCC_*,CLANG_*,LLD_*,PAHOLE_*,RUSTC_*) andBUILD_SALTare left out, because every stem's config carries its own.configs/x86_64/6.1.177.configat e7b859b (the parent of 1ee3def, which added the flavour; at that commit 6.1.177 and 6.1.182 differ only in BUILD_SALT), flavourconfigs/x86_64/6.1.158-android.configat origin/main. 181 lines: binder, binderfs, DMA-BUF heaps, PSI on by default, BPF JIT, MEMFD_ASHMEM_COMPAT, Android netfilter/xfrm/crypto options, EROFS/F2FS, RTC, modules on (signed, forced), kexec off.configs/arm64/6.1.158.configat the same commit, flavourconfigs/arm64/6.1.158-android.configat origin/main. 120 lines, of which three are dead on 6.1 and were dropped (see below), leaving 117. The arm64 flavour was evidently seeded from arm64 6.1.158, not 6.1.177. A 6.1.177 seed yields 175 lines, a strict superset, and the 55 extra lines are exactly what the 6.1.177 bump changed on arm64: tracing off,DEBUG_INFOoff,ARM64_ERRATUM_3194386/4118414off, and others. Those are not Android's, and applying them to new stems would turn off CPU errata workarounds and debug info.To reproduce:
python3 scripts/flavour_fragment.py <(git show e7b859b30b60:firecracker/fc-kernels/configs/<arch>/<seed>.config) configs/<arch>/6.1.158-android.config.What was verified
CONFIG_ONLY=1 ./build.sh 6.1.190-android x86_64ran as root inbuildpack-deps:noble(the toolchain the committed configs record, gcc 13.3.0 Ubuntu 24.04). It seeded fromconfigs/x86_64/6.1.190.configplus the fragment, checked outkernel-6.1.190-237.442.amzn2023, applied the four 6.1.190 patches and thenpatches/android/0001-memfd-answer-ashmem-ioctls.patchcleanly, set the salt to6.1.190-android-amzn2023.x86_64, and every one of the 181 fragment lines survivedolddefconfig.configs/x86_64/6.1.190-android.config: 3622 lines, sha2564944722c69f679c9bdca75fad74cd94b81e462557db256baeac0c45b840d9127. Compared with the 6.1.190 stem config, it differs in 179 symbols: 178 are fragment lines (3 fragment lines already match the stem, for example# CONFIG_KEXEC_FILE is not set), and one is outside the fragment,CONFIG_MODULE_SIG_ALL=y(see open items).6.1.158-android, x86_64 and arm64), checked by the new test.configs/arm64/6.1.190-android.config, sha25645503b167de38946931ab32c8c2d57eadf54d25e37d0f24a98335862551f23ce, resolved natively on arm64 (buildpack-deps:noble,CONFIG_ONLY=1 ./build.sh 6.1.190-android arm64). The arm64 fragment drops three lines no 6.1 tree can keep:CONFIG_IPV6_PRIVACY(removed upstream),CONFIG_MEMCG_SWAP(dropped in 6.1; swap accounting followsSWAPandMEMCG) andCONFIG_NFT_COUNTER(built into nf_tables). The arm64 6.1.158-android config carries them as dead lines; the x86_64 fragment never had them.python3 -m pytest firecracker/fc-kernels/scripts -q: 69 passed.Open items for maintainers
CONFIG_MODULE_SIG_ALL: it is# ... is not setin 6.1.158-android, but the seed never showed the symbol (modules were off there), so the value-difference rule does not put it in the fragment. On 6.1.190 it resolves toy, the Kconfig default once modules are on. It only makesmodules_installsign modules and does not change the vmlinux. The same gap applies to 64 x86_64 and 4 arm64 symbols that only the flavour exposes, all left at their defaultnin 6.1.158-android. OnlyMODULE_SIG_ALLresolves differently on 6.1.190. If maintainers want the flavour to pin those answers too, change the rule to also count a symbol the flavour shows as not set and the seed does not show, then regenerate.<new stem>-androidnext to each new stem and seed it withCONFIG_ONLY=1per arch. That automation is not part of this change.Test evidence
OS1 built E2B's 6.1.158-android flavour lines (same fragment logic) plus the flavour patch on stem vmlinux-6.1.177_5008931 and booted it on a self-hosted E2B host. binder protocol 8; binderfs devices binder, hwbinder, vndbinder and binder-control; BINDER_CTL_ADD works; memfd with F_SEAL_FUTURE_WRITE; ASHMEM_GET_SIZE on a memfd returns the size; /proc/pressure present; bpf_jit_enable=1; /dev/dma_heap/system present. Pause and resume kept a process's binder fd and memfd. The guest uses about +9 MiB RAM vs stock.
🤖 Generated with Claude Code