forked from kako-jun/riscfetch
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest_on_riscv.sh
More file actions
executable file
·57 lines (43 loc) · 1.34 KB
/
Copy pathtest_on_riscv.sh
File metadata and controls
executable file
·57 lines (43 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
# RISC-V Hardware Test Script for riscfetch
# Run this script on Orange Pi RV2 or other RISC-V hardware
set -e
echo "=== riscfetch RISC-V Hardware Test ==="
echo ""
# Check if we're on RISC-V
ARCH=$(uname -m)
echo "Architecture: $ARCH"
if [[ "$ARCH" != "riscv64" && "$ARCH" != "riscv32" ]]; then
echo "WARNING: This doesn't appear to be RISC-V hardware!"
echo "Expected riscv64 or riscv32, got $ARCH"
exit 1
fi
echo "Confirmed: Running on RISC-V hardware"
echo ""
# Show relevant system files
echo "=== /proc/cpuinfo (first 50 lines) ==="
head -50 /proc/cpuinfo
echo ""
echo "=== ISA string from cpuinfo ==="
grep -i "isa" /proc/cpuinfo | head -1 || echo "Not found"
echo ""
echo "=== Hardware IDs from cpuinfo ==="
grep -E "(mvendorid|marchid|mimpid)" /proc/cpuinfo | head -3 || echo "Not found"
echo ""
echo "=== Device Tree Model ==="
cat /proc/device-tree/model 2>/dev/null || echo "Not found"
echo ""
echo "=== Running cargo test ==="
cd "$(dirname "$0")"
cargo test --workspace 2>&1
echo ""
echo "=== Running riscfetch (normal mode) ==="
cargo run --package riscfetch -- 2>&1 || true
echo ""
echo "=== Running riscfetch --explain ==="
cargo run --package riscfetch -- --explain 2>&1 || true
echo ""
echo "=== Running riscfetch --json ==="
cargo run --package riscfetch -- --json 2>&1 || true
echo ""
echo "=== Test completed ==="