# mcfreakky41/pixelos_device_infinix_x6840 architecture

> Architecture diagram of the GitHub repository mcfreakky41/pixelos_device_infinix_x6840, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-12-03). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/mcfreakky41/pixelos_device_infinix_x6840
- Repository: https://github.com/mcfreakky41/pixelos_device_infinix_x6840

## Overview

This repository provides the device configuration and build adaptations for PixelOS Android 16 on the Infinix Smart 20 (X6840/X6840B), rather than the Android source tree itself. The documented workflow places the device and vendor trees into a PixelOS checkout, validates and applies ARM64 host patches, fetches vendor blobs, builds selected images, then flashes them through fastbootd. The README documents these stages and device capabilities; source excerpts are limited to the patch dry-run and encoding checker, so unsampled implementation links are omitted where not documented.

Main entry points: [`device/infinix/X6840/AndroidProducts.mk`](https://github.com/mcfreakky41/pixelos_device_infinix_x6840/blob/main/device/infinix/X6840/AndroidProducts.mk) (Product targets), [`device/infinix/X6840/pixelos_X6840.mk`](https://github.com/mcfreakky41/pixelos_device_infinix_x6840/blob/main/device/infinix/X6840/pixelos_X6840.mk) (PixelOS product), [`scripts/dryrun-arm64-patches.py`](https://github.com/mcfreakky41/pixelos_device_infinix_x6840/blob/main/scripts/dryrun-arm64-patches.py) (Patch dry-run), [`scripts/apply-arm64-host.sh`](https://github.com/mcfreakky41/pixelos_device_infinix_x6840/blob/main/scripts/apply-arm64-host.sh) (Apply host patches)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_device["Device definition"]
  node_products["Product targets<br/>[AndroidProducts.mk]"]
  node_product["PixelOS product<br/>[pixelos_X6840.mk]"]
  node_device_config["Device configuration<br/>[device.mk]"]
  node_board["Board configuration<br/>[BoardConfig.mk]"]
  node_kernel["Prebuilt kernel"]
  node_fstab["Filesystem table<br/>[fstab.mt6768]"]
  node_sepolicy["SELinux policy"]
  node_lunch["Lunch setup<br/>[vendorsetup.sh]"]
end

subgraph group_host["Build preparation"]
  node_patch_docs["ARM64 host patches<br/>[README.md]"]
  node_dryrun["Patch dry-run"]
  node_apply["Apply host patches"]
  node_repair["Source tree fixes<br/>[fix-source-tree.sh]"]
  node_blob_fetch["Vendor blob fetch<br/>[fetch-blobs.sh]"]
  node_encoding["Text encoding check"]
end

subgraph group_delivery["Build and flash"]
  node_build["Image build"]
  node_images["Flashable images"]
end

node_builder(("ROM builder"))
node_blob_release[("Blob release")]
node_pixelos["PixelOS source checkout"]
node_fastboot(("Fastbootd device"))

node_builder -->|"syncs source"| node_pixelos
node_builder -->|"places device tree"| node_products
node_products -.->|"selects target"| node_product
node_builder -->|"validates patches"| node_dryrun
node_dryrun -->|"precedes application"| node_apply
node_builder -->|"applies patches"| node_apply
node_builder -->|"fixes source tree"| node_repair
node_builder -->|"fetches blobs"| node_blob_fetch
node_blob_release -->|"provides blobs"| node_blob_fetch
node_builder -.->|"checks text"| node_encoding
node_products -.->|"configures target"| node_build
node_product -.->|"configures product"| node_build
node_device_config -.->|"configures device"| node_build
node_board -.->|"configures board"| node_build
node_kernel -.->|"supplies kernel"| node_build
node_fstab -.->|"sets partitions"| node_build
node_sepolicy -.->|"sets policy"| node_build
node_lunch -.->|"registers target"| node_build
node_builder -->|"builds images"| node_build
node_build -->|"produces images"| node_images
node_builder -->|"enters fastbootd"| node_fastboot
node_images -->|"flashes selected"| node_fastboot

click node_products "https://github.com/mcfreakky41/pixelos_device_infinix_x6840/blob/main/device/infinix/X6840/AndroidProducts.mk"
click node_product "https://github.com/mcfreakky41/pixelos_device_infinix_x6840/blob/main/device/infinix/X6840/pixelos_X6840.mk"
click node_device_config "https://github.com/mcfreakky41/pixelos_device_infinix_x6840/blob/main/device/infinix/X6840/device.mk"
click node_board "https://github.com/mcfreakky41/pixelos_device_infinix_x6840/blob/main/device/infinix/X6840/BoardConfig.mk"
click node_kernel "https://github.com/mcfreakky41/pixelos_device_infinix_x6840/blob/main/device/infinix/X6840/prebuilt/kernel"
click node_fstab "https://github.com/mcfreakky41/pixelos_device_infinix_x6840/blob/main/device/infinix/X6840/rootdir/etc/fstab.mt6768"
click node_sepolicy "https://github.com/mcfreakky41/pixelos_device_infinix_x6840/tree/main/device/infinix/X6840/sepolicy"
click node_lunch "https://github.com/mcfreakky41/pixelos_device_infinix_x6840/blob/main/device/infinix/X6840/vendorsetup.sh"
click node_patch_docs "https://github.com/mcfreakky41/pixelos_device_infinix_x6840/blob/main/patches/arm64-host/README.md"
click node_dryrun "https://github.com/mcfreakky41/pixelos_device_infinix_x6840/blob/main/scripts/dryrun-arm64-patches.py"
click node_apply "https://github.com/mcfreakky41/pixelos_device_infinix_x6840/blob/main/scripts/apply-arm64-host.sh"
click node_repair "https://github.com/mcfreakky41/pixelos_device_infinix_x6840/blob/main/scripts/fix-source-tree.sh"
click node_blob_fetch "https://github.com/mcfreakky41/pixelos_device_infinix_x6840/blob/main/scripts/fetch-blobs.sh"
click node_encoding "https://github.com/mcfreakky41/pixelos_device_infinix_x6840/blob/main/scripts/check-text-encoding.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_products,node_product,node_device_config,node_board,node_kernel,node_fstab,node_sepolicy,node_lunch toneBlue
class node_patch_docs,node_dryrun,node_apply,node_repair,node_blob_fetch,node_encoding,node_blob_release toneAmber
class node_build,node_images toneMint
class node_builder,node_pixelos,node_fastboot toneIndigo
```

## Components

### Device definition

- [Product targets](https://github.com/mcfreakky41/pixelos_device_infinix_x6840/blob/main/device/infinix/X6840/AndroidProducts.mk): `device/infinix/X6840/AndroidProducts.mk`
- [PixelOS product](https://github.com/mcfreakky41/pixelos_device_infinix_x6840/blob/main/device/infinix/X6840/pixelos_X6840.mk): `device/infinix/X6840/pixelos_X6840.mk`
- [Device configuration](https://github.com/mcfreakky41/pixelos_device_infinix_x6840/blob/main/device/infinix/X6840/device.mk): `device/infinix/X6840/device.mk`
- [Board configuration](https://github.com/mcfreakky41/pixelos_device_infinix_x6840/blob/main/device/infinix/X6840/BoardConfig.mk): `device/infinix/X6840/BoardConfig.mk`
- [Prebuilt kernel](https://github.com/mcfreakky41/pixelos_device_infinix_x6840/blob/main/device/infinix/X6840/prebuilt/kernel): `device/infinix/X6840/prebuilt/kernel`
- [Filesystem table](https://github.com/mcfreakky41/pixelos_device_infinix_x6840/blob/main/device/infinix/X6840/rootdir/etc/fstab.mt6768): `device/infinix/X6840/rootdir/etc/fstab.mt6768`
- [SELinux policy](https://github.com/mcfreakky41/pixelos_device_infinix_x6840/tree/main/device/infinix/X6840/sepolicy): `device/infinix/X6840/sepolicy`
- [Lunch setup](https://github.com/mcfreakky41/pixelos_device_infinix_x6840/blob/main/device/infinix/X6840/vendorsetup.sh): `device/infinix/X6840/vendorsetup.sh`

### Build preparation

- [ARM64 host patches](https://github.com/mcfreakky41/pixelos_device_infinix_x6840/blob/main/patches/arm64-host/README.md): `patches/arm64-host/README.md`
- [Patch dry-run](https://github.com/mcfreakky41/pixelos_device_infinix_x6840/blob/main/scripts/dryrun-arm64-patches.py): `scripts/dryrun-arm64-patches.py`
- [Apply host patches](https://github.com/mcfreakky41/pixelos_device_infinix_x6840/blob/main/scripts/apply-arm64-host.sh): `scripts/apply-arm64-host.sh`
- [Source tree fixes](https://github.com/mcfreakky41/pixelos_device_infinix_x6840/blob/main/scripts/fix-source-tree.sh): `scripts/fix-source-tree.sh`
- [Vendor blob fetch](https://github.com/mcfreakky41/pixelos_device_infinix_x6840/blob/main/scripts/fetch-blobs.sh): `scripts/fetch-blobs.sh`
- [Text encoding check](https://github.com/mcfreakky41/pixelos_device_infinix_x6840/blob/main/scripts/check-text-encoding.py): `scripts/check-text-encoding.py`

### Build and flash

- **Image build**
- **Flashable images**

### Other components

- **ROM builder**
- **Blob release**
- **PixelOS source checkout**
- **Fastbootd device**

## Connections

- ROM builder → PixelOS source checkout: syncs source (evidence: `README.md`)
- ROM builder → Product targets: places device tree (evidence: `README.md`)
- Product targets → PixelOS product: selects target
- ROM builder → Patch dry-run: validates patches (evidence: `README.md`)
- Patch dry-run → Apply host patches: precedes application (evidence: `README.md`)
- ROM builder → Apply host patches: applies patches (evidence: `README.md`)
- ROM builder → Source tree fixes: fixes source tree (evidence: `README.md`)
- ROM builder → Vendor blob fetch: fetches blobs (evidence: `README.md`)
- Blob release → Vendor blob fetch: provides blobs (evidence: `README.md`)
- ROM builder → Text encoding check: checks text
- Product targets → Image build: configures target
- PixelOS product → Image build: configures product
- Device configuration → Image build: configures device
- Board configuration → Image build: configures board
- Prebuilt kernel → Image build: supplies kernel
- Filesystem table → Image build: sets partitions
- SELinux policy → Image build: sets policy
- Lunch setup → Image build: registers target
- ROM builder → Image build: builds images (evidence: `README.md`)
- Image build → Flashable images: produces images (evidence: `README.md`)
- ROM builder → Fastbootd device: enters fastbootd (evidence: `README.md`)
- Flashable images → Fastbootd device: flashes selected (evidence: `README.md`)
