# adaliamokhles/meta-mokhles architecture

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

- Interactive diagram: https://gitdiagram.com/adaliamokhles/meta-mokhles
- Repository: https://github.com/adaliamokhles/meta-mokhles

## Overview

meta-mokhles is a Yocto layer for building a minimal Linux image with CAN support and example programs. Its principal runtime path is booting the image, creating vcan0, then running the SocketCAN sender and receiver over that interface. The layer also supplies kernel CAN configuration and standalone hello-C and hello-file examples. Recipe-to-image inclusion details are not shown in the excerpts; the README documents the capabilities, so the image/packagegroup relationship is marked unverified.

Main entry points: [`recipes-mokhles/images/mokhles-image.bb`](https://github.com/adaliamokhles/meta-mokhles/blob/main/recipes-mokhles/images/mokhles-image.bb) (mokhles image), [`recipes-kernel/linux/linux-yocto_%.bbappend`](https://github.com/adaliamokhles/meta-mokhles/blob/main/recipes-kernel/linux/linux-yocto_%25.bbappend) (Kernel CAN append), [`recipes-mokhles/can-setup/files/can-setup`](https://github.com/adaliamokhles/meta-mokhles/blob/main/recipes-mokhles/can-setup/files/can-setup) (Interface startup), [`recipes-mokhles/can-sender/files/can-sender.c`](https://github.com/adaliamokhles/meta-mokhles/blob/main/recipes-mokhles/can-sender/files/can-sender.c) (CAN sender)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_image["Image composition"]
  node_image_recipe["mokhles image<br/>[mokhles-image.bb]"]
  node_can_group["CAN package group"]
  node_kernel_append["Kernel CAN append"]
  node_can_config["CAN kernel config<br/>[can.cfg]"]
end

subgraph group_can["CAN runtime"]
  node_setup["Interface startup"]
  node_vcan["vcan0 interface"]
  node_sender["CAN sender<br/>[can-sender.c]"]
  node_receiver["CAN receiver<br/>[can-receiver.c]"]
end

subgraph group_examples["Example programs"]
  node_hello_c["Hello C program<br/>[hello.c]"]
  node_hello_file["Hello text file<br/>[hello.txt]"]
end

node_user(("Image user"))

node_user -->|"boots image"| node_image_recipe
node_image_recipe -.->|"includes capability"| node_can_group
node_kernel_append -->|"enables CAN"| node_can_config
node_setup -->|"creates at boot"| node_vcan
node_sender -->|"uses SocketCAN"| node_vcan
node_receiver -->|"uses SocketCAN"| node_vcan

click node_image_recipe "https://github.com/adaliamokhles/meta-mokhles/blob/main/recipes-mokhles/images/mokhles-image.bb"
click node_can_group "https://github.com/adaliamokhles/meta-mokhles/blob/main/recipes-mokhles/packagegroups/packagegroup-mokhles-can.bb"
click node_kernel_append "https://github.com/adaliamokhles/meta-mokhles/blob/main/recipes-kernel/linux/linux-yocto_%25.bbappend"
click node_can_config "https://github.com/adaliamokhles/meta-mokhles/blob/main/recipes-kernel/linux/files/can.cfg"
click node_setup "https://github.com/adaliamokhles/meta-mokhles/blob/main/recipes-mokhles/can-setup/files/can-setup"
click node_sender "https://github.com/adaliamokhles/meta-mokhles/blob/main/recipes-mokhles/can-sender/files/can-sender.c"
click node_receiver "https://github.com/adaliamokhles/meta-mokhles/blob/main/recipes-mokhles/can-receiver/files/can-receiver.c"
click node_hello_c "https://github.com/adaliamokhles/meta-mokhles/blob/main/recipes-mokhles/hello-c/files/hello.c"
click node_hello_file "https://github.com/adaliamokhles/meta-mokhles/blob/main/recipes-mokhles/hello-file/files/hello.txt"

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_image_recipe,node_can_group,node_kernel_append,node_can_config,node_user toneBlue
class node_setup,node_vcan,node_sender,node_receiver toneAmber
class node_hello_c,node_hello_file toneMint
```

## Components

### Image composition

- [mokhles image](https://github.com/adaliamokhles/meta-mokhles/blob/main/recipes-mokhles/images/mokhles-image.bb): `recipes-mokhles/images/mokhles-image.bb`
- [CAN package group](https://github.com/adaliamokhles/meta-mokhles/blob/main/recipes-mokhles/packagegroups/packagegroup-mokhles-can.bb): `recipes-mokhles/packagegroups/packagegroup-mokhles-can.bb`
- [Kernel CAN append](https://github.com/adaliamokhles/meta-mokhles/blob/main/recipes-kernel/linux/linux-yocto_%25.bbappend): `recipes-kernel/linux/linux-yocto_%.bbappend`
- [CAN kernel config](https://github.com/adaliamokhles/meta-mokhles/blob/main/recipes-kernel/linux/files/can.cfg): `recipes-kernel/linux/files/can.cfg`

### CAN runtime

- [Interface startup](https://github.com/adaliamokhles/meta-mokhles/blob/main/recipes-mokhles/can-setup/files/can-setup): `recipes-mokhles/can-setup/files/can-setup`
- **vcan0 interface**
- [CAN sender](https://github.com/adaliamokhles/meta-mokhles/blob/main/recipes-mokhles/can-sender/files/can-sender.c): `recipes-mokhles/can-sender/files/can-sender.c`
- [CAN receiver](https://github.com/adaliamokhles/meta-mokhles/blob/main/recipes-mokhles/can-receiver/files/can-receiver.c): `recipes-mokhles/can-receiver/files/can-receiver.c`

### Example programs

- [Hello C program](https://github.com/adaliamokhles/meta-mokhles/blob/main/recipes-mokhles/hello-c/files/hello.c): `recipes-mokhles/hello-c/files/hello.c`
- [Hello text file](https://github.com/adaliamokhles/meta-mokhles/blob/main/recipes-mokhles/hello-file/files/hello.txt): `recipes-mokhles/hello-file/files/hello.txt`

### Other components

- **Image user**

## Connections

- Image user → mokhles image: boots image (evidence: `README`)
- mokhles image → CAN package group: includes capability
- Kernel CAN append → CAN kernel config: enables CAN (evidence: `README`)
- Interface startup → vcan0 interface: creates at boot (evidence: `README`)
- CAN sender → vcan0 interface: uses SocketCAN (evidence: `README`)
- CAN receiver → vcan0 interface: uses SocketCAN (evidence: `README`)
