Fix/prepare board detection with mainline kernel in armhwinfo/firstrun

This commit is contained in:
Thomas Kaiser 2016-02-25 13:17:13 +01:00
parent 3e99880955
commit 07d2993a92
2 changed files with 8 additions and 3 deletions

View File

@ -128,15 +128,16 @@ if [ "$ARCH" = "armv7l" ]; then
[ -f /proc/asound/imxvt1613audio/id ] && ID="Udoo"
fi
fi
[ -f /proc/device-tree/model ] && MACHINE=$(cat /proc/device-tree/model)
[ -f /proc/device-tree/model ] && read MACHINE </proc/device-tree/model
ID="$(echo "${MACHINE}" | sed 's/Xunlong\ //')"
if [[ $MACHINE == *LIME2 ]]; then ID="Lime 2"; fi
if [[ $MACHINE == *LIME ]]; then ID="Lime"; fi
if [[ $MACHINE == *Micro ]]; then ID="Micro"; fi
if [[ $MACHINE == *Banana* ]]; then ID="Banana"; fi
if [[ $MACHINE == *Udoo* ]]; then ID="udoo"; fi
if [[ $MACHINE == *Lamobo* ]]; then ID="Lamobo R1"; fi
if [[ $MACHINE == *Orange* ]]; then ID="Orange"; fi
if [[ $MACHINE == *Neo* ]]; then ID="Udoo Neo"; fi
if [[ $MACHINE == *Cubietruck* ]]; then ID="Cubietruck"; fi
if [[ $MACHINE == *Cubieboard* ]]; then ID="Cubieboard"; fi

View File

@ -96,13 +96,17 @@ autodetect_h3() {
# This function adjusts script.bin, hostname and cpufreq settings based on
# /run/machine.id so that two OS images (one built for Orange Pi Plus and one
# for the other H3 devices using the internal Ethernet PHY) can be shipped.
#
# TODO for mainline kernel: Ship with u-boot debs for all Oranges and install
# the right one instead of trying to relink script.bin if detecting mainline
# kernel [[ -f /proc/device-tree/model ]]
# trigger red LED as user feedback
echo heartbeat >/sys/class/leds/red_led/trigger
# wait for armhwinfo
sleep 3
read MACHINE </run/machine.id
MACHINE="$(tail -n1 /run/machine.id)"
case ${MACHINE} in
"Orange Pi+"*)
ln -sf /boot/bin/orangepiplus.bin /boot/script.bin