Skip to content

Commit faa3391

Browse files
committed
Merge branch 'v1' of github.com:shoaibmerchant/mecha-docs into remote-access
2 parents 23b9d69 + f517b73 commit faa3391

File tree

12 files changed

+3137
-1168
lines changed

12 files changed

+3137
-1168
lines changed

docs/benchmarks/GeekbenchChart.js

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
import React from "react";
2+
import {
3+
BarChart,
4+
Bar,
5+
XAxis,
6+
YAxis,
7+
CartesianGrid,
8+
Tooltip,
9+
Legend,
10+
ResponsiveContainer,
11+
} from "recharts";
12+
13+
// Custom tick formatter to break long names into two lines
14+
const formatXAxis = (tick) => {
15+
const words = tick.split(" ");
16+
if (words.length > 3) {
17+
return `${words.slice(0, 3).join(" ")}\n${words.slice(3).join(" ")}`;
18+
}
19+
return tick;
20+
};
21+
22+
const GeekbenchChart = () => {
23+
const data = [
24+
{
25+
name: "Single-Core Score",
26+
RaspberryPi: 297,
27+
MechaComet: 180,
28+
RaspberryPi3: 118,
29+
},
30+
{
31+
name: "Multi-Core Score",
32+
RaspberryPi: 690,
33+
MechaComet: 520,
34+
RaspberryPi3: 127,
35+
},
36+
{
37+
name: "Idle Power Consumption",
38+
RaspberryPi: 2.5,
39+
MechaComet: 1.5,
40+
RaspberryPi3: null,
41+
},
42+
{
43+
name: "File Compression (Single-Core)",
44+
RaspberryPi: 309,
45+
MechaComet: 253,
46+
RaspberryPi3: 162,
47+
},
48+
{
49+
name: "Navigation (Single-Core)",
50+
RaspberryPi: 424,
51+
MechaComet: 383,
52+
RaspberryPi3: 297,
53+
},
54+
{
55+
name: "HTML5 Browser (Single-Core)",
56+
RaspberryPi: 375,
57+
MechaComet: 242,
58+
RaspberryPi3: 193,
59+
},
60+
{
61+
name: "PDF Renderer (Single-Core)",
62+
RaspberryPi: 455,
63+
MechaComet: 283,
64+
RaspberryPi3: 206,
65+
},
66+
{
67+
name: "Photo Library (Single-Core)",
68+
RaspberryPi: 246,
69+
MechaComet: 139,
70+
RaspberryPi3: 114,
71+
},
72+
{
73+
name: "Clang (Single-Core)",
74+
RaspberryPi: 416,
75+
MechaComet: 271,
76+
RaspberryPi3: 230,
77+
},
78+
{
79+
name: "Text Processing (Single-Core)",
80+
RaspberryPi: 311,
81+
MechaComet: 201,
82+
RaspberryPi3: 143,
83+
},
84+
{
85+
name: "Asset Compression (Single-Core)",
86+
RaspberryPi: 395,
87+
MechaComet: 260,
88+
RaspberryPi3: 219,
89+
},
90+
{
91+
name: "Object Detection (Single-Core)",
92+
RaspberryPi: 93,
93+
MechaComet: 55,
94+
RaspberryPi3: 47,
95+
},
96+
{
97+
name: "Background Blur (Single-Core)",
98+
RaspberryPi: 182,
99+
MechaComet: 69,
100+
RaspberryPi3: 60,
101+
},
102+
{
103+
name: "File Compression (Multi-Core)",
104+
RaspberryPi: 328,
105+
MechaComet: 440,
106+
RaspberryPi3: 174,
107+
},
108+
{
109+
name: "Navigation (Multi-Core)",
110+
RaspberryPi: 769,
111+
MechaComet: 842,
112+
RaspberryPi3: 559,
113+
},
114+
{
115+
name: "HTML5 Browser (Multi-Core)",
116+
RaspberryPi: 824,
117+
MechaComet: 750,
118+
RaspberryPi3: 16,
119+
},
120+
{
121+
name: "PDF Renderer (Multi-Core)",
122+
RaspberryPi: 1378,
123+
MechaComet: 1115,
124+
RaspberryPi3: 92,
125+
},
126+
{
127+
name: "Photo Library (Multi-Core)",
128+
RaspberryPi: 758,
129+
MechaComet: 502,
130+
RaspberryPi3: 162,
131+
},
132+
];
133+
134+
return (
135+
<div className="w-full max-w-6xl mx-auto p-4">
136+
<h2 className="text-xl font-bold text-center mb-4 ">
137+
Benchmark Comparison: Raspberry Pi 4 vs Mecha Comet vs Raspberry Pi 3
138+
</h2>
139+
<ResponsiveContainer width="100%" height={800}>
140+
<BarChart data={data}>
141+
<CartesianGrid strokeDasharray="3 3" />
142+
<XAxis
143+
dataKey="name"
144+
angle={-45}
145+
textAnchor="end"
146+
height={200}
147+
tickFormatter={formatXAxis}
148+
/>
149+
<YAxis
150+
domain={[50, 1500]}
151+
label={{ value: "Score", angle: -90, position: "insideLeft" }}
152+
/>
153+
<Tooltip />
154+
<Legend />
155+
<Bar
156+
dataKey="MechaComet"
157+
fill="rgb(187, 63, 41)"
158+
name="Mecha Comet"
159+
/>
160+
<Bar
161+
dataKey="RaspberryPi"
162+
fill="rgb(58, 177, 84)"
163+
name="Raspberry Pi 4"
164+
/>
165+
<Bar
166+
dataKey="RaspberryPi3"
167+
fill="rgb(27, 52, 161)"
168+
name="Raspberry Pi 3"
169+
/>
170+
</BarChart>
171+
</ResponsiveContainer>
172+
</div>
173+
);
174+
};
175+
176+
export default GeekbenchChart;

docs/benchmarks/mecha-comet-benchmark.mdx

Lines changed: 230 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 204 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,204 @@
1+
---
2+
title: Building Debian Rootfs Manually
3+
hide_table_of_contents: true
4+
---
5+
6+
This guide details the steps to manually build a Debian-based root filesystem tailored for the **Mecha Comet** that runs on arm platform. The process leverages `debootstrap` for system initialization, configures essential packages, and ensures compatibility with the Mecha ecosystem. The final root filesystem is bundled into a compressed tar archive for easy deployment.
7+
8+
---
9+
10+
## **Prerequisites**
11+
12+
This guide assumes you are running a Debian-based Linux system as the host. Root privileges are required for most steps.
13+
we also assume that system is running on x86_64 architecture that is mostly to be the platform for **host environment**.
14+
15+
16+
### **1. Install Required Packages**
17+
18+
These tools are necessary for setting up a Debian root filesystem and enabling execution of ARM binaries on an x86_64 host.
19+
20+
```bash
21+
sudo apt install debootstrap qemu-user-static
22+
```
23+
24+
### **2. Set Up the Root Directory**
25+
26+
We create a directory to hold the root filesystem and set an environment variable for convenience.
27+
28+
```bash
29+
mkdir target
30+
export ROOTDIR=$(realpath target)
31+
```
32+
33+
### **3. Bootstrap Debian (Bookworm)**
34+
35+
`debootstrap` is a tool used to install a Debian-based root filesystem. It operates in two stages:
36+
37+
- **First stage (executed on the host machine):** Downloads and extracts base system packages.
38+
- **Second stage (executed inside the chroot environment):** Configures and installs remaining system components.
39+
40+
We use the `--foreign` flag because we are cross-building for an ARM64 architecture on an x86_64 host.
41+
42+
```bash
43+
sudo debootstrap --arch=arm64 --foreign --no-check-gpg --include=eatmydata,gnupg bookworm $ROOTDIR http://deb.debian.org/debian
44+
45+
```
46+
47+
### **4. Enable ARM Execution Support**
48+
49+
To execute ARM64 binaries within the chroot environment, we copy `qemu-aarch64-static` into the root filesystem.
50+
51+
```bash
52+
sudo cp /usr/bin/qemu-aarch64-static $ROOTDIR/usr/bin/
53+
54+
```
55+
56+
## **5. Complete Debootstrap Installation**
57+
58+
`chroot` changes the apparent root directory for processes, allowing us to simulate running commands inside the target system. This is necessary when setting up a root filesystem on a different architecture or preparing it for deployment.
59+
60+
At this point, we enter the chroot environment to complete the Debian setup.
61+
62+
```bash
63+
export CHROOTCMD="eval LC_ALL=C LANGUAGE=C LANG=C sudo chroot $ROOTDIR"
64+
$CHROOTCMD /debootstrap/debootstrap --second-stage
65+
66+
```
67+
68+
*Explanation:* The `--second-stage` completes the installation of essential Debian packages inside the chroot environment.
69+
70+
### **6. Set Up Networking**
71+
72+
To enable networking inside the chroot environment, we bind essential virtual filesystems and copy network configuration from the host.
73+
74+
```bash
75+
sudo mkdir -p $ROOTDIR/home/root
76+
sudo mount -t sysfs sysfs $ROOTDIR/sys
77+
sudo mount -t proc proc $ROOTDIR/proc
78+
79+
# Backup and apply host networking configuration
80+
cp $ROOTDIR/etc/environment{,.sav}
81+
cp $ROOTDIR/etc/resolv.conf{,.sav}
82+
cp $ROOTDIR/etc/hosts{,.sav}
83+
cp /etc/resolv.conf $ROOTDIR/etc/resolv.conf
84+
cp /etc/hosts $ROOTDIR/etc/hosts
85+
86+
```
87+
88+
### **7. Configure Package Sources**
89+
90+
To ensure seamless package availability and optimal performance on Mecha Comet devices, we recommend adding the Mecha Debian repository to your system. This repository hosts essential kernel and firmware Debian packages, specifically tailored for Mecha Comet devices.
91+
92+
Additionally, the Mecha Debian repository serves as a central hub for our in-house developed GUI and pre-built applications, carefully crafted to enhance the Mecha Comet user experience.
93+
94+
By adding this repository, you'll gain access to:
95+
96+
Optimized kernel and firmware packages
97+
98+
- Optimized kernel and firmware packages
99+
100+
Exclusive GUI and application packages designed for Mecha Comet
101+
102+
- Exclusive GUI and application packages designed for Mecha Comet
103+
104+
```bash
105+
echo "deb http://debian.mecha.build apollo main" | sudo tee -a $ROOTDIR/etc/apt/sources.list
106+
$CHROOTCMD apt-get update
107+
108+
```
109+
110+
### **8. Install Essential Packages**
111+
112+
We install core system packages required for the Mecha Comet platform. These include installing firmware, kernel, utilities, networking tools, display managers, and audio support in order to ensure the platform's robust operation.
113+
114+
You can also add the packages as needed to make the OS/image unique to your preferences.
115+
116+
```bash
117+
$CHROOTCMD apt-get install -y initramfs-tools imx-sdma-firmware bluez-firmware u-boot-tools
118+
$CHROOTCMD apt-get install -y linux-image-6.6.36+mecha+ linux-headers-6.6.36+mecha+ linux-libc-dev=6.6.36-g00659ceb855e-1
119+
$CHROOTCMD apt-get install -y dbus nano openssh-server sudo bash-completion dosfstools cpufrequtils upower libglib2.0-0
120+
$CHROOTCMD apt-get install -y bluez hostapd file ethtool network-manager net-tools curl wget unzip
121+
$CHROOTCMD apt-get install -y systemd-timesyncd locales
122+
$CHROOTCMD apt-get install -y xwayland xorg libwlroots12t64 labwc weston
123+
$CHROOTCMD apt-get install -y greetd
124+
$CHROOTCMD apt-get install -y pulseaudio mpg123 pulseaudio-module-bluetooth alsa-tools alsa-utils libasound2 libasound2-plugins
125+
$CHROOTCMD apt-get install -y mechanix-launcher mechanix-keyboard mechanix_desktop_dbus_server mechanix_system_dbus_server mechanix-camera mechanix-files mechanix-settings mecha-connect mecha-agent
126+
127+
```
128+
129+
### **9. Configure Users**
130+
131+
We create a `mecha` user with password `mecha`, granting it sudo and network privileges for target device
132+
133+
```bash
134+
$CHROOTCMD useradd -m -u 1001 -p '\$5\$11223344\$Qi1UvJ46XO2CCaKoCyuMjV4cPu7YWZYWoSJpu3gdGsD' mecha
135+
$CHROOTCMD adduser mecha sudo
136+
$CHROOTCMD adduser mecha netdev
137+
$CHROOTCMD chsh -s /bin/bash mecha
138+
139+
```
140+
141+
### **10. Set Hostname**
142+
143+
we need to set `hostname` for our target device, you can select the name you want.
144+
145+
```bash
146+
echo "127.0.0.1 localhost.localdomain mecha-comet" >> $ROOTDIR/etc/hosts
147+
echo "mecha-comet" > $ROOTDIR/etc/hostname
148+
149+
```
150+
151+
### **11. Configure Filesystem**
152+
153+
The `fstab` file defines how disk partitions and other file systems should be mounted at boot.
154+
155+
```bash
156+
cp fstab $ROOTDIR/etc/fstab
157+
158+
```
159+
160+
### **12. Final Cleanup**
161+
162+
We restore networking configurations and unmounted virtual filesystems before packaging the root filesystem.
163+
164+
```bash
165+
$CHROOTCMD apt-get clean
166+
mv $ROOTDIR/etc/environment.sav $ROOTDIR/etc/environment
167+
mv $ROOTDIR/etc/resolv.conf.sav $ROOTDIR/etc/resolv.conf
168+
mv $ROOTDIR/etc/hosts.sav $ROOTDIR/etc/hosts
169+
170+
```
171+
172+
Unmount filesystems:
173+
174+
```bash
175+
umount -l -f $ROOTDIR/sys
176+
umount -l -f $ROOTDIR/proc
177+
rm -rf $ROOTDIR/tmp/deb
178+
179+
```
180+
181+
### **13. Bundle Root Filesystem**
182+
183+
Finally, we package the root filesystem into a compressed archive for deployment.
184+
185+
```bash
186+
tar -czf mecha-comet-rootfs.tar.gz -C $ROOTDIR .
187+
188+
```
189+
190+
## Conclusion
191+
192+
After following the steps in this guide, you will have successfully built a Debian-based root filesystem for the Mecha Comet on an ARM64 architecture. This root filesystem is now ready for deployment to the target device.
193+
194+
### **Next Steps**:
195+
196+
1. Extract the root filesystem archive to the target device's root partition:
197+
198+
```bash
199+
200+
$ tar -xzf mecha-comet-rootfs.tar.gz -C /mnt/rootfs
201+
```
202+
203+
2. Ensure that the bootloader and kernel are properly configured for the Mecha Comet platform.
204+
3. Once everything is set up, reboot the device, and the new system will be ready for use!

0 commit comments

Comments
 (0)