diff --git a/adafruit_platformdetect/board.py b/adafruit_platformdetect/board.py index db7f3f6a..47c104ba 100644 --- a/adafruit_platformdetect/board.py +++ b/adafruit_platformdetect/board.py @@ -153,6 +153,8 @@ def id(self) -> Optional[str]: board_id = self._rock_pi_id() or self._armbian_id() elif chip_id == chips.ATOM_X5_Z8350: board_id = self._rock_pi_id() + elif chip_id == chips.ATOM_J4105: + board_id = self._j4105_id() elif chip_id == chips.RK3288: board_id = self._asus_tinker_board_id() elif chip_id == chips.RK3328: @@ -529,6 +531,19 @@ def _udoo_id(self) -> Optional[str]: return None + def _j4105_id(self) -> Optional[str]: + """Try to detect the id of J4105 board.""" + try: + with open( + "/sys/devices/virtual/dmi/id/board_name", "r", encoding="utf-8" + ) as board_name: + board_value = board_name.read().rstrip() + if board_value == "ODYSSEY-X86J4105": + return boards.ODYSSEY_X86J4105 + return None + except FileNotFoundError: + return None + def _asus_tinker_board_id(self) -> Optional[str]: """Check what type of Tinker Board.""" board_value = self.detector.get_device_model() @@ -712,6 +727,11 @@ def any_udoo_board(self) -> bool: """Check to see if the current board is an UDOO board""" return self.id in boards._UDOO_BOARD_IDS + @property + def any_seeed_board(self) -> bool: + """Check to see if the current board is an SEEED board""" + return self.id in boards._SEEED_BOARD_IDS + @property def any_asus_tinker_board(self) -> bool: """Check to see if the current board is an ASUS Tinker Board""" @@ -775,6 +795,7 @@ def lazily_generate_conditions(): yield self.any_rock_pi_board yield self.any_clockwork_pi_board yield self.any_udoo_board + yield self.any_seeed_board yield self.any_asus_tinker_board yield self.any_stm32mp1 yield self.any_lubancat diff --git a/adafruit_platformdetect/chip.py b/adafruit_platformdetect/chip.py index 9377635d..2e08d02b 100644 --- a/adafruit_platformdetect/chip.py +++ b/adafruit_platformdetect/chip.py @@ -290,6 +290,8 @@ def _linux_id(self) -> Optional[str]: linux_id = chips.PENTIUM_N3710 elif "X5-Z8350" in model_name: linux_id = chips.ATOM_X5_Z8350 + elif "J4105" in model_name: + linux_id = chips.ATOM_J4105 else: linux_id = chips.GENERIC_X86 ## print("linux_id = ", linux_id) diff --git a/adafruit_platformdetect/constants/boards.py b/adafruit_platformdetect/constants/boards.py index a2a6b81a..52800a57 100644 --- a/adafruit_platformdetect/constants/boards.py +++ b/adafruit_platformdetect/constants/boards.py @@ -172,6 +172,9 @@ GREATFET_ONE = "GREATFET_ONE" +# SeeedStudio boards +ODYSSEY_X86J4105 = "ODYSSEY_X86J4105" + # Udoo boards UDOO_BOLT_V3 = "UDOO_BOLT_V3" UDOO_BOLT_V8 = "UDOO_BOLT_V8" @@ -538,6 +541,9 @@ # UDOO _UDOO_BOARD_IDS = {UDOO_BOLT_V8: ("SC40-2000-0000-C0|C",), UDOO_X86: ("dummy",)} +# SeeedStudio boards +_SEEED_BOARD_IDS = ODYSSEY_X86J4105 + # MaaXBoard boards _MAAXBOARD_IDS = ("MAAXBOARD", "MAAXBOARD_MINI") diff --git a/adafruit_platformdetect/constants/chips.py b/adafruit_platformdetect/constants/chips.py index dd622021..6a4b35fc 100644 --- a/adafruit_platformdetect/constants/chips.py +++ b/adafruit_platformdetect/constants/chips.py @@ -68,6 +68,6 @@ ATOM_X5_Z8350 = "X5-Z8350" RP2040_U2IF = "RP2040_U2IF" D1_RISCV = "D1_RISCV" - +ATOM_J4105 = "ATOM_J4105" BCM_RANGE = {"BCM2708", "BCM2709", "BCM2711", "BCM2835", "BCM2837"} diff --git a/bin/detect.py b/bin/detect.py index 764e8ad1..5ba5c782 100755 --- a/bin/detect.py +++ b/bin/detect.py @@ -53,6 +53,7 @@ print("Is this an embedded Linux system?", detector.board.any_embedded_linux) print("Is this a generic Linux PC?", detector.board.GENERIC_LINUX_PC) print("Is this a UDOO Bolt?", detector.board.UDOO_BOLT) +print("Is this a ODYSSEY X86YJ4105?", detector.board.ODYSSEY_X86J4105) print("Is this an ASUS Tinker Board?", detector.board.ASUS_TINKER_BOARD) print("Is this an STM32MP1 Board?", detector.board.any_stm32mp1) print(