Skip to content

Commit 556a865

Browse files
committed
Add quickstart instructions
Signed-off-by: Eric Van Hensbergen <[email protected]>
1 parent 3300495 commit 556a865

File tree

1 file changed

+77
-21
lines changed

1 file changed

+77
-21
lines changed

README.md

Lines changed: 77 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,67 @@
22

33
This project provides prebuilt binaries for u-root/cpu and u-root/cpud targeting aarch64 architecture.
44

5-
## Quick Install
5+
6+
## Quick Start (on Mac with Raspberry Pi target)
7+
8+
*NOTE*: Replace the version (v0.0.4) with the latest release
9+
and use your own public/private key pair for security.
10+
11+
### On target (Raspberry Pi)
12+
13+
```bash
14+
# Grab pre-built cpud & public key
15+
wget https://github.com/ericvh/cpu-prebuilt/releases/download/v0.0.4/cpud
16+
chmod ugo+x cpud
17+
wget https://github.com/ericvh/cpu-prebuilt/releases/download/v0.0.4/identity.pub
18+
# Start cpud (must be run as root)
19+
sudo ./cpud -pk identity.pub
20+
```
21+
22+
### On Mac
23+
24+
```bash
25+
# Grab pre-built cpu & key
26+
wget https://github.com/ericvh/cpu-prebuilt/releases/download/v0.0.4/cpu
27+
chmod ugo+x cpu
28+
wget https://github.com/ericvh/cpu-prebuilt/releases/download/v0.0.4/identity
29+
# Start a docker, bind in cpu, and use it to launch on target
30+
# This assumes you are operating out of your home directory
31+
# and maps /Users on OSX to /home on the target.
32+
# replace raspberrypi.local with either your pi's hostname
33+
# or IP address
34+
docker run -i -t -v ${HOME}:${HOME/\Users/\/home} -e PWD=${PWD/\/Users/\/home} \
35+
-v ./identity:/etc/cpu/identity -v ./cpu:/usr/bin/cpu \
36+
ubuntu:latest \
37+
/usr/bin/cpu -nfs -sp 17010 -key /etc/cpu/identity \
38+
-namespace "/lib:/usr:/bin:/home:/etc" \
39+
raspberrypi.local /bin/bash
40+
```
41+
42+
### On Mac from inside a devcontainer
43+
44+
This is pretty much like the above, except you'll want to make sure you have already
45+
created a mount point for /workspaces on the target
46+
47+
```bash
48+
# Grab pre-built cpu & key
49+
wget https://github.com/ericvh/cpu-prebuilt/releases/download/v0.0.4/cpu
50+
chmod ugo+x cpu
51+
wget https://github.com/ericvh/cpu-prebuilt/releases/download/v0.0.4/identity
52+
# first time - create workspaces directory on target if it doesn't already exist
53+
# /tmp/local is the full root of the target device
54+
/usr/bin/cpu -nfs -sp 17010 -key /etc/cpu/identity \
55+
-namespace "/lib:/usr:/bin:/home:/etc:/workspaces" \
56+
raspberrypi.local mkdir -p /tmp/local/workspaces
57+
# Start cpu
58+
/usr/bin/cpu -nfs -sp 17010 -key /etc/cpu/identity \
59+
-namespace "/lib:/usr:/bin:/home:/etc:/workspaces" \
60+
raspberrypi.local /bin/bash
61+
```
62+
63+
# NOTE: All other instructions below this line are currently being tested & debugged
64+
65+
## Quick Install (on Linux)
666

767
```bash
868
# Install latest release
@@ -43,7 +103,7 @@ curl -fsSL https://raw.githubusercontent.com/ericvh/cpu-prebuilt/main/install.sh
43103

44104
### Option 1: Install Script (Easiest)
45105
```bash
46-
# Download and run installer
106+
# Download and run installer (binaries run on Linux aarch64 only for now)
47107
curl -fsSL https://raw.githubusercontent.com/ericvh/cpu-prebuilt/main/install.sh | bash
48108

49109
# Or download first, then run
@@ -54,30 +114,24 @@ chmod +x install.sh
54114

55115
### Option 2: Manual Download from Releases
56116
```bash
57-
# Download individual binaries (replace VERSION with actual version)
58-
wget https://github.com/ericvh/cpu-prebuilt/releases/download/v1.0.0/cpu
59-
wget https://github.com/ericvh/cpu-prebuilt/releases/download/v1.0.0/cpud
117+
# Download individual binaries (replace VERSION with actual version) (this can be used with docker desktop)
118+
wget https://github.com/ericvh/cpu-prebuilt/releases/download/v0.0.4/cpu
119+
wget https://github.com/ericvh/cpu-prebuilt/releases/download/v0.0.4/cpud
60120

61121
# Make executable
62122
chmod +x cpu cpud
63123

64124
# Verify checksums (optional)
65-
wget https://github.com/ericvh/cpu-prebuilt/releases/download/v1.0.0/cpu.sha256
66-
wget https://github.com/ericvh/cpu-prebuilt/releases/download/v1.0.0/cpud.sha256
125+
wget https://github.com/ericvh/cpu-prebuilt/releases/download/v0.0.4/cpu.sha256
126+
wget https://github.com/ericvh/cpu-prebuilt/releases/download/v0.0.4/cpud.sha256
67127
sha256sum -c cpu.sha256 cpud.sha256
68128
```
69129

70130
### Option 3: Download Complete Archive
71131
```bash
72132
# Download and verify archive
73-
VERSION="v1.0.0" # Replace with desired version
74-
wget https://github.com/ericvh/cpu-prebuilt/releases/download/$VERSION/cpu-binaries-aarch64-$VERSION.tar.gz
75-
wget https://github.com/ericvh/cpu-prebuilt/releases/download/$VERSION/cpu-binaries-aarch64-$VERSION.tar.gz.sha256
76-
sha256sum -c cpu-binaries-aarch64-$VERSION.tar.gz.sha256
77-
78-
# Extract
79-
tar -xzf cpu-binaries-aarch64-$VERSION.tar.gz
80-
chmod +x cpu cpud
133+
Go to https://github.com/ericvh/cpu-prebuilt/releases/tag/v0.0.4
134+
Download the archive cpu-binaries-aarch64-*.tar.gz
81135
```
82136

83137
### Option 4: Container Usage
@@ -126,14 +180,14 @@ sudo cp cpud-initramfs.cpio.gz /boot/
126180
git clone https://github.com/ericvh/cpu-prebuilt.git
127181
cd cpu-prebuilt
128182

129-
# Build binaries (requires Go 1.21+)
130-
./build.sh
183+
# Build binaries (requires Go 1.24+)
184+
make
131185

132186
# Clean build artifacts
133-
./build.sh clean
187+
make clean
134188

135189
# Install locally built binaries
136-
./install.sh --local
190+
make install
137191
```
138192

139193
### Build Directory Structure
@@ -206,11 +260,13 @@ curl -fsSL https://raw.githubusercontent.com/ericvh/cpu-prebuilt/main/install.sh
206260
# Download initramfs
207261
wget https://github.com/ericvh/cpu-prebuilt/releases/latest/download/cpud-initramfs.cpio.gz
208262

209-
# Boot with QEMU (example)
263+
# Boot with QEMU (example - you need to get your aarch64 Image from elsewhere)
210264
qemu-system-aarch64 \
211-
-kernel vmlinuz-aarch64 \
265+
-kernel Image \
212266
-initrd cpud-initramfs.cpio.gz \
213267
-append "init=/init console=ttyAMA0" \
268+
-netdev user,id=n1,hostfwd=tcp:0.0.0.0:17010-:17010,net=192.168.1.0/24,host=192.168.1.1 \
269+
-device virtio-net-pci,netdev=n1 \
214270
-machine virt -cpu cortex-a57 -m 1024M -nographic
215271

216272
# Or boot on Raspberry Pi

0 commit comments

Comments
 (0)