From 641f52b165626e26b0395547ae8bde71df69f6c5 Mon Sep 17 00:00:00 2001 From: kako-jun <3541096+kako-jun@users.noreply.github.com> Date: Mon, 27 Apr 2026 21:49:03 +0900 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20kako-jun/riscfetch#11=20Orange=20Pi?= =?UTF-8?q?=20RV2=20=E3=82=92=20SpacemiT=20=E3=81=A8=E3=81=97=E3=81=A6?= =?UTF-8?q?=E6=A4=9C=E5=87=BA=E3=81=99=E3=82=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Ky 派生カーネルは /proc/device-tree/compatible に `ky,x1` / `ky,orangepi-rv2` を吐き、`spacemit,*` 文字列を含まないため、 既存の "spacemit" キーワードで検出できず汎用 RISC-V ロゴへ フォールバックしていた。VENDOR_KEYWORDS に "ky,x1" を追加。 "ky," 単独マッチは将来 Ky が別 SoC を採用した場合の silent miscategorization を招くため避け、"orangepi-rv2" は board 文字列 にしか出ない冗長キーワードのため採用しない。BPI-F3 等は既存の "spacemit" でヒット済みで影響なし。 --- CHANGELOG.md | 5 +++++ crates/riscfetch-cli/src/vendors.rs | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1de577b..53546e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,11 @@ All notable changes to this project will be documented in this file. +## [Unreleased] + +### Fixed +- Detect Orange Pi RV2 (SpacemiT K1) as SpacemiT vendor. Ky-derived kernels expose `ky,x1` / `ky,orangepi-rv2` in `/proc/device-tree/compatible` instead of `spacemit,*`, so the existing `spacemit` keyword missed them and the board fell back to the generic RISC-V logo. + ## [2.3.0] - 2026-04-06 ### Added diff --git a/crates/riscfetch-cli/src/vendors.rs b/crates/riscfetch-cli/src/vendors.rs index b86b4d2..f61c435 100644 --- a/crates/riscfetch-cli/src/vendors.rs +++ b/crates/riscfetch-cli/src/vendors.rs @@ -92,6 +92,7 @@ const VENDOR_KEYWORDS: &[(&str, &str)] = &[ ("cv1800", "sophgo"), ("sg2000", "sophgo"), ("ch32v", "wch"), + ("ky,x1", "spacemit"), // Vendor names (generic, checked after specific keywords) ("eswin", "eswin"), ("ultrarisc", "ultrarisc"), @@ -242,6 +243,14 @@ mod tests { assert_eq!(detect_vendor("Some Unknown Board", "unknown,board"), None); } + #[test] + fn test_detect_orangepi_rv2_as_spacemit() { + assert_eq!( + detect_vendor("ky x1 orangepi-rv2 board", "ky,orangepi-rv2 ky,x1"), + Some("spacemit") + ); + } + #[test] fn test_all_vendors_have_info() { for (aliases, display_name, subtitle) in VENDORS { From e8223f0010dddec8df802b860e9e7fc1c0e5a311 Mon Sep 17 00:00:00 2001 From: kako-jun <3541096+kako-jun@users.noreply.github.com> Date: Mon, 27 Apr 2026 21:51:18 +0900 Subject: [PATCH 2/2] =?UTF-8?q?test:=20ky,orangepi-rv2=20=E5=8D=98?= =?UTF-8?q?=E7=8B=AC=E5=85=A5=E5=8A=9B=E3=81=A7=E6=A4=9C=E5=87=BA=E3=81=95?= =?UTF-8?q?=E3=82=8C=E3=81=AA=E3=81=84=E3=81=93=E3=81=A8=E3=82=92=E6=8B=85?= =?UTF-8?q?=E4=BF=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 将来 "ky," プレフィックスでまとめて受け入れる方向に変更された場合、 このテストが落ちて意図 (Ky 派生 distro 全部を SpacemiT 扱いしない) を 気付かせる防衛テスト。 --- crates/riscfetch-cli/src/vendors.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/crates/riscfetch-cli/src/vendors.rs b/crates/riscfetch-cli/src/vendors.rs index f61c435..5d85a51 100644 --- a/crates/riscfetch-cli/src/vendors.rs +++ b/crates/riscfetch-cli/src/vendors.rs @@ -251,6 +251,14 @@ mod tests { ); } + #[test] + fn test_ky_orangepi_alone_does_not_match() { + // We deliberately key on "ky,x1" only. A bare "ky,orangepi-rv2" without + // "ky,x1" is rejected so future Ky-derived boards on non-SpacemiT SoCs + // are not silently miscategorized. + assert_eq!(detect_vendor("", "ky,orangepi-rv2"), None); + } + #[test] fn test_all_vendors_have_info() { for (aliases, display_name, subtitle) in VENDORS {