# ading2210/shimboot architecture

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

- Interactive diagram: https://gitdiagram.com/ading2210/shimboot
- Repository: https://github.com/ading2210/shimboot

## Overview

##### Component Details

a. Pre-Boot Environment (Top Section):
- Chrome OS Recovery Mode
- RMA Shim Detection
- Hardware Interface Components
- Display
- Storage
- Network
- Input devices

b. Bootloader Layer (Middle Section):
- Partition Management System
- 4 partition layout:
- 1MB dummy stateful partition
- 32MB Chrome OS kernel
- 20MB bootloader
- Rootfs partitions
- Bootloader Components:
- Bootstrap process (/bootloader/bin/bootstrap.sh)
- Init system (/bootloader/bin/init)
- Mount handlers
- Encryption support

c. Operating System Layer (Bottom Section):
- Root Filesystem
- Systemd (with Chrome OS patches)
- Desktop Environments
- Driver Framework
- Hardware Support Modules

##### Flow Indicators

- Boot sequence flow (top to bottom)
- Data flow between components
- Hardware interaction paths
- System initialization sequence

##### Special Features to Highlight

Create dedicated sections showing:
- Compression support (squashfs)
- Desktop environment options
- Driver compatibility layer
- Rescue mode functionality
- Firmware interaction points

##### Notes Section

Callouts for:
- Security considerations
- Hardware compatibility notes
- Known limitations (audio, suspend)
- Enterprise enrollment implications

Important Considerations:

## Diagram (Mermaid)

```mermaid
graph TB
    %% Styles and classes
    classDef hardware fill:#gray,stroke:#333
    classDef chromeos fill:#b3d9ff,stroke:#333
    classDef shimboot fill:#90EE90,stroke:#333
    classDef linux fill:#ffb366,stroke:#333
    classDef security fill:#ff9999,stroke:#333
    classDef interface fill:#e6e6e6,stroke:#333

    %% Pre-Boot Environment
    subgraph PreBoot["Pre-Boot Environment"]
        ChromeOS["Chrome OS Recovery Mode"]:::chromeos
        RMAShim["RMA Shim Detection"]:::shimboot
        
        subgraph Hardware["Hardware Interface"]
            Display["Display Interface"]:::hardware
            Storage["Storage Interface"]:::hardware
            Network["Network Interface"]:::hardware
            Input["Input Devices"]:::hardware
        end
    end

    %% Bootloader Layer
    subgraph Bootloader["Bootloader Layer"]
        PartMgmt["Partition Management"]:::shimboot
        
        subgraph Partitions["Partition Layout"]
            Dummy["1MB Dummy Stateful"]:::interface
            Kernel["32MB Chrome OS Kernel"]:::chromeos
            Boot["20MB Bootloader"]:::shimboot
            RootFS["RootFS Partitions"]:::linux
        end

        Bootstrap["Bootstrap Process"]:::shimboot
        Init["Init System"]:::shimboot
        MountHandler["Mount Handlers"]:::shimboot
        Encryption["Encryption Support"]:::shimboot
        CrossSystem["Hardware Interface Tools"]:::interface
    end

    %% Operating System Layer
    subgraph OS["Operating System Layer"]
        RootFilesystem["Root Filesystem"]:::linux
        Systemd["Systemd (Chrome OS Patches)"]:::linux
        Desktop["Desktop Environments"]:::linux
        Drivers["Driver Framework"]:::linux
        HWSupport["Hardware Support Modules"]:::linux
        UIGreeter["Shimboot Greeter"]:::interface
    end

    %% Relationships
    ChromeOS --> RMAShim
    RMAShim --> Hardware
    RMAShim --> PartMgmt
    PartMgmt --> Partitions
    PartMgmt --> Bootstrap
    Bootstrap --> Init
    Init --> MountHandler
    MountHandler --> Encryption
    MountHandler --> RootFilesystem
    RootFilesystem --> Systemd
    Systemd --> Desktop
    Systemd --> Drivers
    Drivers --> HWSupport
    CrossSystem --> Hardware

    %% Click events for component mapping
    click Bootstrap "https://github.com/ading2210/shimboot/blob/main//bootloader/bin/bootstrap.sh"
    click Init "https://github.com/ading2210/shimboot/tree/main//bootloader/bin/init"
    click Encryption "https://github.com/ading2210/shimboot/tree/main//bootloader/opt/mount-encrypted"
    click Network "https://github.com/ading2210/shimboot/blob/main//rootfs/etc/modules-load.d/wifi.conf"
    click RootFilesystem "https://github.com/ading2210/shimboot/tree/main//rootfs/usr/local/bin/expand_rootfs"
    click Display "https://github.com/ading2210/shimboot/blob/main//rootfs/etc/systemd/system/kill-frecon.service"
    click RootFS "https://github.com/ading2210/shimboot/blob/main//rootfs/opt/setup_rootfs.sh"
    click UIGreeter "https://github.com/ading2210/shimboot/tree/main//rootfs/usr/local/bin/shimboot_greeter"
    click CrossSystem "https://github.com/ading2210/shimboot/tree/main//bootloader/opt/crossystem"

    %% Legend
    subgraph Legend
        L1["Chrome OS Components"]:::chromeos
        L2["Shimboot Components"]:::shimboot
        L3["Linux Components"]:::linux
        L4["Hardware Interfaces"]:::hardware
        L5["Security Boundaries"]:::security
        L6["Interface Components"]:::interface
    end
```
