2026年2月13日 星期五

[Linux] 安裝 OpenClaw @ raspberrypi Debian 12




之前有一台 Pi 3 閒置,查了一下記憶體有 1GB ,試試看吧!先把它更新到 Debian GNU/Linux 12 (bookworm) ,接著用 nvm 安裝出 node.js v22 環境,再調整 swap 到 1GB 來跑:

```
@raspberrypi:~ $ uname -a
Linux raspberrypi 6.1.21-v8+ #1642 SMP PREEMPT Mon Apr  3 17:24:16 BST 2023 aarch64 GNU/Linux

@raspberrypi:~ $ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 12 (bookworm)
Release: 12
Codename: bookworm

@raspberrypi:~ $ apt policy raspberrypi-bootloader
raspberrypi-bootloader:
  Installed: 1:1.20230405-1
  Candidate: 1:1.20230405-1
  Version table:
 *** 1:1.20230405-1 500
        500 http://archive.raspberrypi.org/debian bookworm/main arm64 Packages
        100 /var/lib/dpkg/status

@raspberrypi:~ $ cat /etc/apt/sources.list.d/raspi.list
deb http://archive.raspberrypi.org/debian/ bookworm main

@raspberrypi:~ $ cat /etc/apt/sources.list
deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware
deb http://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware
deb http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware

@raspberrypi:~ $ lscpu
Architecture:            aarch64
  CPU op-mode(s):        32-bit, 64-bit
  Byte Order:            Little Endian
CPU(s):                  4
  On-line CPU(s) list:   0-3
Vendor ID:               ARM
  Model name:            Cortex-A53
    Model:               4
    Thread(s) per core:  1
    Core(s) per cluster: 4
    Socket(s):           -
    Cluster(s):          1
    Stepping:            r0p4
    CPU(s) scaling MHz:  100%
    CPU max MHz:         1200.0000
    CPU min MHz:         600.0000
    BogoMIPS:            38.40
    Flags:               fp asimd evtstrm crc32 cpuid
Caches (sum of all):     
  L1d:                   128 KiB (4 instances)
  L1i:                   128 KiB (4 instances)
  L2:                    512 KiB (1 instance)
Vulnerabilities:         
  Itlb multihit:         Not affected
  L1tf:                  Not affected
  Mds:                   Not affected
  Meltdown:              Not affected
  Mmio stale data:       Not affected
  Retbleed:              Not affected
  Spec store bypass:     Not affected
  Spectre v1:            Mitigation; __user pointer sanitization
  Spectre v2:            Not affected
  Srbds:                 Not affected
  Tsx async abort:       Not affected

@raspberrypi:~ $ sudo vcgencmd measure_temp
temp=54.8'C

@raspberrypi:~ $ sudo vcgencmd measure_clock arm
frequency(48)=600062000

@raspberrypi:~ $ sudo vcgencmd get_mem gpu
gpu=76M

@raspberrypi:~ $ cat /proc/device-tree/model
Raspberry Pi 3 Model B Rev 1.2

$ cat /proc/cpuinfo | grep Model
Model : Raspberry Pi 3 Model B Rev 1.2
```

---

```
@raspberrypi:~ $ openclaw onboard

<--- Last few GCs --->

[17543:0x7fb04c0000]   229321 ms: Scavenge 451.3 (463.5) -> 450.8 (464.3) MB, pooled: 0 MB, 21.16 / 0.00 ms  (average mu = 0.614, current mu = 0.204) allocation failure; 
[17543:0x7fb04c0000]   229421 ms: Scavenge 452.0 (464.3) -> 451.5 (469.0) MB, pooled: 0 MB, 40.55 / 0.00 ms  (average mu = 0.614, current mu = 0.204) allocation failure; 


<--- JS stacktrace --->

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
----- Native stack trace -----

 1: 0xe13218 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [openclaw]
 2: 0x11a7f8c v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [openclaw]
 3: 0x11a813c v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [openclaw]
 4: 0x13ccadc  [openclaw]
 5: 0x13e4a50 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [openclaw]
 6: 0x13bb378 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [openclaw]
 7: 0x13bc1b0 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [openclaw]
 8: 0x13972d0 v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) [openclaw]
 9: 0x17b0b5c v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [openclaw]
10: 0x1cc19d4  [openclaw]
```

```
@raspberrypi:~ $ free -h
               total        used        free      shared  buff/cache   available
Mem:           909Mi       209Mi       555Mi       3.8Mi       212Mi       700Mi
Swap:           99Mi        99Mi       160Ki


@raspberrypi:~ $ sudo dphys-swapfile swapoff
@raspberrypi:~ $ sudo vim /etc/dphys-swapfile
CONF_SWAPSIZE=1024
@raspberrypi:~ $ sudo dphys-swapfile setup
@raspberrypi:~ $ sudo dphys-swapfile swapon

@raspberrypi:~ $ free -h
               total        used        free      shared  buff/cache   available
Mem:           909Mi       313Mi       428Mi       5.0Mi       236Mi       596Mi
Swap:          1.0Gi          0B       1.0Gi
```

```
@raspberrypi:~ $ NODE_OPTIONS="--max-old-space-size=768" openclaw onboard

🦞 OpenClaw 2026.2.9 (33c75cb) — I read logs so you can keep pretending you don't have to.

▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
██░▄▄▄░██░▄▄░██░▄▄▄██░▀██░██░▄▄▀██░████░▄▄▀██░███░██
██░███░██░▀▀░██░▄▄▄██░█░█░██░█████░████░▀▀░██░█░█░██
██░▀▀▀░██░█████░▀▀▀██░██▄░██░▀▀▄██░▀▀░█░██░██▄▀▄▀▄██
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
                  🦞 OPENCLAW 🦞                    
 
┌  OpenClaw onboarding
◇  Security ──────────────────────────────────────────────────────────────────────────────╮
│                                                                                         │
│  Security warning — please read.                                                        │
│                                                                                         │
│  OpenClaw is a hobby project and still in beta. Expect sharp edges.                     │
│  This bot can read files and run actions if tools are enabled.                          │
│  A bad prompt can trick it into doing unsafe things.                                    │
│                                                                                         │
│  If you’re not comfortable with basic security and access control, don’t run OpenClaw.  │
│  Ask someone experienced to help before enabling tools or exposing it to the internet.  │
│                                                                                         │
│  Recommended baseline:                                                                  │
│  - Pairing/allowlists + mention gating.                                                 │
│  - Sandbox + least-privilege tools.                                                     │
│  - Keep secrets out of the agent’s reachable filesystem.                                │
│  - Use the strongest available model for any bot with tools or untrusted inboxes.       │
│                                                                                         │
│  Run regularly:                                                                         │
│  openclaw security audit --deep                                                         │
│  openclaw security audit --fix                                                          │
│                                                                                         │
│  Must read: https://docs.openclaw.ai/gateway/security                                   │
│                                                                                         │
├─────────────────────────────────────────────────────────────────────────────────────────╯
◆  I understand this is powerful and inherently risky. Continue?
│  ○ Yes / ● No
```

沒有留言:

張貼留言