docs(ebpf-poc): require build-essential in setup

A fresh Ubuntu machine can have gcc without the C library headers. PMG
builds runtime/cgo, so the build fails with 'fatal error: errno.h: No
such file or directory'. Also adds a check that the build succeeded
before installing the binary, since a failed build leaves the previous
file in place.
This commit is contained in:
Sahilb315
2026-07-28 17:53:28 +05:30
parent 472a3e859a
commit e9ce5a27f2
+13 -1
View File
@@ -55,12 +55,18 @@ Run this command:
```bash
sudo apt-get update
sudo apt-get install -y clang llvm libbpf-dev git
sudo apt-get install -y build-essential clang llvm libbpf-dev git
```
`build-essential` gives the C standard library headers.
PMG needs them because it builds a part that uses C.
`clang` compiles the C code to eBPF bytecode.
`libbpf-dev` gives the header files that the C code includes.
Do not skip `build-essential`.
A machine can have `gcc` but not these headers.
The build then fails with messages such as `fatal error: errno.h: No such file or directory`.
---
## Step 3. Install Go
@@ -158,6 +164,11 @@ You must see the PMG banner and a version number.
If you see a list of flags such as `-exempt-uid`, you built the wrong program.
Return to the repository root and build again.
Always check the build before you copy the file.
A failed build does not create the file.
The copy then installs an old file, or it fails.
Run `/tmp/pmg version` first, then copy.
---
## Step 8. Build the Hook Agent
@@ -390,6 +401,7 @@ It deletes the certificate files.
| `./pmgwatch: command not found` | You are in the wrong directory | `cd ~/pmg/ebpf-poc` |
| `directory prefix . does not contain modules listed in go.work` | The workspace file hides this module | `export GOWORK=off` |
| `'asm/types.h' file not found` | Wrong architecture path | See Step 6 |
| `fatal error: errno.h: No such file or directory` | The C library headers are missing | `sudo apt-get install -y build-essential` |
| `Text file busy` | The proxy is running from that file | Stop the proxy, then copy again |
| `map create: operation not permitted` | You are not root | Use `sudo` |
| `UNABLE_TO_VERIFY_LEAF_SIGNATURE` | npm does not trust the certificate | Run Step 11 again |