Skip to content

Add Device Identification and Branding #8

@mihai-chiorean

Description

@mihai-chiorean

Description

Current implementation lacks proper device identification. Need to add EdgeOS branding and unique device naming based on hardware serial.

Current Problem

  • Static product name
  • No manufacturer branding
  • No unique device identification

Implementation

  1. Extract device serial from multiple sources
  2. Set manufacturer to "EdgeOS"
  3. Set product name with serial suffix
  4. Create fallback chain for different hardware

Serial Detection Chain

# Try device tree serial (modern approach)
if [ -f /proc/device-tree/serial-number ]; then
    SERIAL=$(cat /proc/device-tree/serial-number | tr -d '\0')
fi

# Try Raspberry Pi method
if [ -z "$SERIAL" ] && [ -f /proc/cpuinfo ]; then
    SERIAL=$(awk -F ': ' '/Serial/ {print $2}' /proc/cpuinfo)
fi

# Try Jetson methods
if [ -z "$SERIAL" ]; then
    SERIAL=$(cat /sys/devices/platform/tegra-fuse/uid 2>/dev/null)
fi

# Fallback to MAC address
if [ -z "$SERIAL" ]; then
    SERIAL=$(cat /sys/class/net/eth0/address 2>/dev/null || echo "UNKNOWN")
fi

USB Gadget Configuration

# Get last 8 characters for short identifier
SHORT_SERIAL=${SERIAL: -8}
CLEAN_SERIAL=$(echo $SHORT_SERIAL | tr -d ':')

# Set device identification
echo "EdgeOS" > strings/0x409/manufacturer
echo "EdgeOS Device ${CLEAN_SERIAL}" > strings/0x409/product
echo "$SERIAL" > strings/0x409/serialnumber

Acceptance Criteria

  • Device appears as "EdgeOS Device XXXX" in host OS
  • Serial number correctly extracted from hardware
  • Works on RPi, Jetson, and generic ARM boards
  • Meaningful fallback if serial unavailable
  • Clean serial format (no colons or special chars in product name)
  • Full serial preserved in serialnumber field

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions