--- /dev/null
+do_sysinfo_generic() {
+ [ -d /proc/device-tree ] || return
+ mkdir -p /tmp/sysinfo
+ [ -e /tmp/sysinfo/board_name ] || \
+ echo "$(strings /proc/device-tree/compatible | head -1)" > /tmp/sysinfo/board_name
+ [ ! -e /tmp/sysinfo/model -a -e /proc/device-tree/model ] && \
+ echo "$(cat /proc/device-tree/model)" > /tmp/sysinfo/model
+}
+
+boot_hook_add preinit_main do_sysinfo_generic
+++ /dev/null
-do_sysinfo_generic() {
- [ -d /proc/device-tree ] || return
- mkdir -p /tmp/sysinfo
- [ -e /tmp/sysinfo/board_name ] || \
- echo "$(strings /proc/device-tree/compatible | head -1)" > /tmp/sysinfo/board_name
- [ ! -e /tmp/sysinfo/model -a -e /proc/device-tree/model ] && \
- echo "$(cat /proc/device-tree/model)" > /tmp/sysinfo/model
-}
-
-boot_hook_add preinit_main do_sysinfo_generic
--- /dev/null
+#!/bin/sh
+
+do_adm5120() {
+ . /lib/adm5120.sh
+}
+
+boot_hook_add preinit_main do_adm5120
+++ /dev/null
-#!/bin/sh
-
-do_adm5120() {
- . /lib/adm5120.sh
-}
-
-boot_hook_add preinit_main do_adm5120
--- /dev/null
+#!/bin/sh
+
+do_apm821xx() {
+ . /lib/apm821xx.sh
+
+ apm821xx_board_detect
+}
+
+boot_hook_add preinit_main do_apm821xx
+++ /dev/null
-#!/bin/sh
-
-do_apm821xx() {
- . /lib/apm821xx.sh
-
- apm821xx_board_detect
-}
-
-boot_hook_add preinit_main do_apm821xx
--- /dev/null
+#!/bin/sh
+
+do_ar71xx() {
+ . /lib/ar71xx.sh
+
+ ar71xx_board_detect
+}
+
+boot_hook_add preinit_main do_ar71xx
+++ /dev/null
-#!/bin/sh
-
-do_ar71xx() {
- . /lib/ar71xx.sh
-
- ar71xx_board_detect
-}
-
-boot_hook_add preinit_main do_ar71xx
--- /dev/null
+#!/bin/sh
+
+do_at91() {
+ . /lib/at91.sh
+
+ at91_board_detect
+}
+
+boot_hook_add preinit_main do_at91
+++ /dev/null
-#!/bin/sh
-
-do_at91() {
- . /lib/at91.sh
-
- at91_board_detect
-}
-
-boot_hook_add preinit_main do_at91
--- /dev/null
+#!/bin/sh
+# Copyright (C) 2015 OpenWrt.org
+
+do_brcm2708() {
+ . /lib/brcm2708.sh
+
+ brcm2708_detect
+}
+
+boot_hook_add preinit_main do_brcm2708
+++ /dev/null
-#!/bin/sh
-# Copyright (C) 2015 OpenWrt.org
-
-do_brcm2708() {
- . /lib/brcm2708.sh
-
- brcm2708_detect
-}
-
-boot_hook_add preinit_main do_brcm2708
--- /dev/null
+#!/bin/sh
+
+do_brcm63xx() {
+ . /lib/brcm63xx.sh
+
+ brcm63xx_detect
+}
+
+boot_hook_add preinit_main do_brcm63xx
+++ /dev/null
-#!/bin/sh
-
-do_brcm63xx() {
- . /lib/brcm63xx.sh
-
- brcm63xx_detect
-}
-
-boot_hook_add preinit_main do_brcm63xx
--- /dev/null
+#!/bin/sh
+#
+# Copyright (c) 2014 The Linux Foundation. All rights reserved.
+#
+
+do_ipq806x() {
+ . /lib/ipq806x.sh
+
+ ipq806x_board_detect
+}
+
+boot_hook_add preinit_main do_ipq806x
+++ /dev/null
-#!/bin/sh
-#
-# Copyright (c) 2014 The Linux Foundation. All rights reserved.
-#
-
-do_ipq806x() {
- . /lib/ipq806x.sh
-
- ipq806x_board_detect
-}
-
-boot_hook_add preinit_main do_ipq806x
--- /dev/null
+#!/bin/sh
+
+lantiq_board_detect() {
+ name=`grep "^machine" /proc/cpuinfo | sed "s/machine.*: \(.*\)/\1/g" | sed "s/\(.*\) - .*/\1/g"`
+ model=`grep "^machine" /proc/cpuinfo | sed "s/machine.*: \(.*\)/\1/g" | sed "s/.* - \(.*\)/\1/g"`
+ [ -z "$name" ] && name="unknown"
+ [ -z "$model" ] && model="unknown"
+ [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
+ echo $name > /tmp/sysinfo/board_name
+ echo $model > /tmp/sysinfo/model
+}
+
+do_lantiq() {
+ . /lib/functions/lantiq.sh
+
+ lantiq_board_detect
+}
+
+boot_hook_add preinit_main do_lantiq
+++ /dev/null
-#!/bin/sh
-
-lantiq_board_detect() {
- name=`grep "^machine" /proc/cpuinfo | sed "s/machine.*: \(.*\)/\1/g" | sed "s/\(.*\) - .*/\1/g"`
- model=`grep "^machine" /proc/cpuinfo | sed "s/machine.*: \(.*\)/\1/g" | sed "s/.* - \(.*\)/\1/g"`
- [ -z "$name" ] && name="unknown"
- [ -z "$model" ] && model="unknown"
- [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
- echo $name > /tmp/sysinfo/board_name
- echo $model > /tmp/sysinfo/model
-}
-
-do_lantiq() {
- . /lib/functions/lantiq.sh
-
- lantiq_board_detect
-}
-
-boot_hook_add preinit_main do_lantiq
--- /dev/null
+#!/bin/sh
+
+do_mcs814x() {
+ . /lib/mcs814x.sh
+
+ mcs814x_board_detect
+}
+
+boot_hook_add preinit_main do_mcs814x
+++ /dev/null
-#!/bin/sh
-
-do_mcs814x() {
- . /lib/mcs814x.sh
-
- mcs814x_board_detect
-}
-
-boot_hook_add preinit_main do_mcs814x
--- /dev/null
+#!/bin/sh
+
+do_mpc85xx() {
+ . /lib/mpc85xx.sh
+
+ mpc85xx_board_detect
+}
+
+boot_hook_add preinit_main do_mpc85xx
+++ /dev/null
-#!/bin/sh
-
-do_mpc85xx() {
- . /lib/mpc85xx.sh
-
- mpc85xx_board_detect
-}
-
-boot_hook_add preinit_main do_mpc85xx
--- /dev/null
+#!/bin/sh
+
+do_mxs() {
+ . /lib/mxs.sh
+
+ mxs_board_detect
+}
+
+boot_hook_add preinit_main do_mxs
+++ /dev/null
-#!/bin/sh
-
-do_mxs() {
- . /lib/mxs.sh
-
- mxs_board_detect
-}
-
-boot_hook_add preinit_main do_mxs
--- /dev/null
+do_sysinfo_octeon() {
+ local machine
+ local name
+
+ machine=$(grep "^system type" /proc/cpuinfo | sed "s/system type.*: \(.*\)/\1/g")
+
+ case "$machine" in
+ "UBNT_E100"*)
+ name="erlite"
+ ;;
+
+ "UBNT_E200"*)
+ name="er"
+ ;;
+
+ "UBNT_E220"*)
+ name="erpro"
+ ;;
+
+ *)
+ name="generic"
+ ;;
+ esac
+
+ [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
+
+ echo "$name" > /tmp/sysinfo/board_name
+ echo "$machine" > /tmp/sysinfo/model
+}
+
+boot_hook_add preinit_main do_sysinfo_octeon
+++ /dev/null
-do_sysinfo_octeon() {
- local machine
- local name
-
- machine=$(grep "^system type" /proc/cpuinfo | sed "s/system type.*: \(.*\)/\1/g")
-
- case "$machine" in
- "UBNT_E100"*)
- name="erlite"
- ;;
-
- "UBNT_E200"*)
- name="er"
- ;;
-
- "UBNT_E220"*)
- name="erpro"
- ;;
-
- *)
- name="generic"
- ;;
- esac
-
- [ -e "/tmp/sysinfo/" ] || mkdir -p "/tmp/sysinfo/"
-
- echo "$name" > /tmp/sysinfo/board_name
- echo "$machine" > /tmp/sysinfo/model
-}
-
-boot_hook_add preinit_main do_sysinfo_octeon
--- /dev/null
+#!/bin/sh
+
+do_oxnas() {
+ . /lib/oxnas.sh
+
+ oxnas_board_detect
+}
+
+boot_hook_add preinit_main do_oxnas
+++ /dev/null
-#!/bin/sh
-
-do_oxnas() {
- . /lib/oxnas.sh
-
- oxnas_board_detect
-}
-
-boot_hook_add preinit_main do_oxnas
--- /dev/null
+#!/bin/sh
+
+do_ramips() {
+ . /lib/ramips.sh
+
+ ramips_board_detect
+}
+
+boot_hook_add preinit_main do_ramips
+++ /dev/null
-#!/bin/sh
-
-do_ramips() {
- . /lib/ramips.sh
-
- ramips_board_detect
-}
-
-boot_hook_add preinit_main do_ramips
--- /dev/null
+get_model_rb532() {
+ grep system\ type /proc/cpuinfo | awk -F ": " '{print $2}'
+}
+
+do_sysinfo_rb532() {
+ mkdir -p /tmp/sysinfo
+ echo rb532 > /tmp/sysinfo/board_name
+ get_model_rb532 > /tmp/sysinfo/model
+}
+
+boot_hook_add preinit_main do_sysinfo_rb532
+++ /dev/null
-get_model_rb532() {
- grep system\ type /proc/cpuinfo | awk -F ": " '{print $2}'
-}
-
-do_sysinfo_rb532() {
- mkdir -p /tmp/sysinfo
- echo rb532 > /tmp/sysinfo/board_name
- get_model_rb532 > /tmp/sysinfo/model
-}
-
-boot_hook_add preinit_main do_sysinfo_rb532
--- /dev/null
+do_sysinfo_x86() {
+ local vendor product file
+
+ for file in sys_vendor board_vendor; do
+ vendor="$(cat /sys/devices/virtual/dmi/id/$file 2>/dev/null)"
+ [ -n "$vendor" ] && break
+ done
+
+ for file in product_name board_name; do
+ product="$(cat /sys/devices/virtual/dmi/id/$file 2>/dev/null)"
+ [ -n "$product" ] && break
+ done
+
+ [ -n "$vendor" -a -n "$product" ] || return
+
+ mkdir -p /tmp/sysinfo
+
+ echo "$vendor $product" > /tmp/sysinfo/model
+
+ sed -e '
+ y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/;
+ s/[^a-z0-9_-]\+/-/g;
+ s/^-//;
+ s/-$//;
+ ' /tmp/sysinfo/model > /tmp/sysinfo/board_name
+}
+
+boot_hook_add preinit_main do_sysinfo_x86
+++ /dev/null
-do_sysinfo_x86() {
- local vendor product file
-
- for file in sys_vendor board_vendor; do
- vendor="$(cat /sys/devices/virtual/dmi/id/$file 2>/dev/null)"
- [ -n "$vendor" ] && break
- done
-
- for file in product_name board_name; do
- product="$(cat /sys/devices/virtual/dmi/id/$file 2>/dev/null)"
- [ -n "$product" ] && break
- done
-
- [ -n "$vendor" -a -n "$product" ] || return
-
- mkdir -p /tmp/sysinfo
-
- echo "$vendor $product" > /tmp/sysinfo/model
-
- sed -e '
- y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/;
- s/[^a-z0-9_-]\+/-/g;
- s/^-//;
- s/-$//;
- ' /tmp/sysinfo/model > /tmp/sysinfo/board_name
-}
-
-boot_hook_add preinit_main do_sysinfo_x86