{"id":25666178,"url":"https://github.com/jackdbd/lineageos-builds","last_synced_at":"2025-07-10T09:38:26.526Z","repository":{"id":277196733,"uuid":"931599876","full_name":"jackdbd/lineageos-builds","owner":"jackdbd","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-12T16:25:06.000Z","size":3,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-19T08:43:15.211Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Nix","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jackdbd.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-12T14:52:00.000Z","updated_at":"2025-02-12T16:25:11.000Z","dependencies_parsed_at":"2025-02-12T17:43:15.128Z","dependency_job_id":null,"html_url":"https://github.com/jackdbd/lineageos-builds","commit_stats":null,"previous_names":["jackdbd/lineageos-builds"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jackdbd/lineageos-builds","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackdbd%2Flineageos-builds","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackdbd%2Flineageos-builds/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackdbd%2Flineageos-builds/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackdbd%2Flineageos-builds/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jackdbd","download_url":"https://codeload.github.com/jackdbd/lineageos-builds/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jackdbd%2Flineageos-builds/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264559671,"owners_count":23628040,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-02-24T08:19:01.494Z","updated_at":"2025-07-10T09:38:26.289Z","avatar_url":"https://github.com/jackdbd.png","language":"Nix","funding_links":[],"categories":[],"sub_categories":[],"readme":"# LineageOS build for Xiaomi Redmi Note 7 (code name lavender)\n\n\u003e [!WARNING]\n\u003e **Work in progress**: these instructions are incomplete. I managed to download the LineageOS source code, the device-specific configuration and kernel, but I haven't yet figure out how to build LineageOS on NixOS.\n\n## Preparation\n\nRun these devenv scripts to [create the directories](https://wiki.lineageos.org/devices/lavender/build/#create-the-directories), [install the `repo` command](https://wiki.lineageos.org/devices/lavender/build/#install-the-repo-command) (it's an executable Python script), [initialize the LineageOS source repository](https://wiki.lineageos.org/devices/lavender/build/#initialize-the-lineageos-source-repository) and [download the LineageOS source code](https://wiki.lineageos.org/devices/lavender/build/#download-the-source-code).\n\n```sh\ncreate-directories\ninstall-repo\ninit-lineage-source-repo\ndownload-lineage-source\n```\n\n## [Prepare the device-specific code](https://wiki.lineageos.org/devices/lavender/build/#prepare-the-device-specific-code)\n\nUse this `sd` command to replace `/bin/pwd` in `~/android/lineage/build/envsetup.sh`.\n\n```sh\nsd ' /bin/pwd' \"$(which pwd)\" ~/android/lineage/build/envsetup.sh\n```\n\nOpen `~/android/lineage/build/envsetup.sh` and replace this line...\n\n```sh\nexport ANDROID_BUILD_TOP=$(gettop)\n```\n\n...with these lines:\n\n```sh\nexport TOP=\"/home/jack/android/lineage\";\nexport ANDROID_BUILD_TOP=\"/home/jack/android/lineage\";\n```\n\nNote: I tried using `~/android/lineage` but it didn't work. I had to use the full path.\n\nYou could maybe try this command instead of replacing that line manually (I haven't tested it):\n\n```sh\nsd 'export ANDROID_BUILD_TOP=\\$\\((.+)\\)' 'export ANDROID_BUILD_TOP=\"/home/jack/android/lineage\"' ~/android/lineage/build/envsetup.sh\n```\n\nFrom `~/android/lineage`, run:\n\n```sh\nexport TOP=\"/home/jack/android/lineage\"\nexport ANDROID_BUILD_TOP=\"/home/jack/android/lineage\"\nsource build/envsetup.sh\nbreakfast lavender\n```\n\nThis will download your device’s [device specific configuration](https://github.com/LineageOS/android_device_xiaomi_lavender) and [kernel](https://github.com/LineageOS/android_kernel_xiaomi_sdm660).\n\n## [Start the build](https://wiki.lineageos.org/devices/lavender/build/#start-the-build)\n\n\u003e [!CAUTION]\n\u003e I am stuck at this step.\n\n```sh\nsource ~/android/lineage/build/soong/scripts/microfactory.bash\n./home/jack/android/lineage/build/soong/scripts/microfactory.bash\n```\n\nThe file `~/android/lineage/build/soong/scripts/microfactory.bash` contains a function `soong_build_go` that - once called - runs this command:\n\n```sh\nbuild_go soong_ui android/soong/cmd/soong_ui\n```\n\nWhere:\n\n- `soong_ui` is the name of the requested binary\n- `android/soong/cmd/soong_ui` is the package name\n\nBuild Microfactory?\n\n```sh\n${GOROOT}bin/go build \\\n  -tags netgo \\\n  -ldflags '-extldflags \\\"-static\\\"' \\\n  -o ${BUILDDIR}/microfactory_$(uname) \\\n  ${BLUEPRINTDIR}/microfactory/microfactory.go\n```\n\nThen use Microfactory to build another binary?\n\n\u003e [!NOTE]\n\u003e Microfactory is a [tool to incrementally compile a go program](https://android.googlesource.com/platform/build/blueprint/+/refs/heads/master/microfactory/microfactory.go).\n\nThe `soong_build_go` function builds a dynamic executable. I cannot run that on NixOS without using something like [nix-ld](https://nix.dev/guides/faq#how-to-run-non-nix-executables).\n\n## References\n\n- [Build LineageOS for Xiaomi Redmi Note 7 (lavender)](https://wiki.lineageos.org/devices/lavender/build/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackdbd%2Flineageos-builds","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjackdbd%2Flineageos-builds","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjackdbd%2Flineageos-builds/lists"}