mirror of
https://github.com/openwrt/openwrt.git
synced 2024-12-28 17:48:58 +00:00
dc72499b53
Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com> SVN-Revision: 44447
37 lines
613 B
Bash
Executable File
37 lines
613 B
Bash
Executable File
#!/bin/sh
|
|
#
|
|
# Copyright (C) 2015 OpenWrt.org
|
|
#
|
|
|
|
brcm2708_board_detect() {
|
|
local machine
|
|
local name
|
|
|
|
machine=$(awk 'BEGIN{FS="[ \t]+:[ \t]"} /Hardware/ {print $2}' /proc/cpuinfo)
|
|
|
|
case "$machine" in
|
|
BCM2708)
|
|
name="Raspberry Pi"
|
|
;;
|
|
BCM2709)
|
|
name="Raspberry Pi 2"
|
|
;;
|
|
esac
|
|
|
|
[ -z "$name" ] && name="unknown"
|
|
|
|
[ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
|
|
|
|
echo "$machine" > /tmp/sysinfo/board_name
|
|
echo "$name" > /tmp/sysinfo/model
|
|
}
|
|
|
|
brcm2708_board_name() {
|
|
local name
|
|
|
|
[ -f /tmp/sysinfo/board_name ] && name=$(cat /tmp/sysinfo/board_name)
|
|
[ -z "$name" ] && name="unknown"
|
|
|
|
echo "$name"
|
|
}
|