Merge pull request #199 from ThomasKaiser/master

Fix Orange Pi 2 detection, enable armhwinfo logging
This commit is contained in:
Igor Pečovnik 2016-03-01 06:44:30 +01:00
commit b3489368ee
4 changed files with 46 additions and 4 deletions

View File

@ -21,7 +21,7 @@ Armbian supports starting with release 5.04 all available H3 based Orange Pi boa
***Known issues with 5.04***
- It seems auto detection for the Orange Pi 2 doesn't work properly. Please have a look [in the forum](http://forum.armbian.com/index.php/topic/617-wip-orange-pi-one-support-for-the-upcoming-orange-pi-one/?p=5718). Will be fixed in 5.05 if we ever get feedback (otherwise image for Orange Pi 2 will be withdrawn
- Auto detection for the Orange Pi 2 doesn't work properly. Please have a look [for a manual fix](http://forum.armbian.com/index.php/topic/617-wip-orange-pi-one-support-for-the-upcoming-orange-pi-one/?p=5718) or wait for 5.05 where this will be fixed
- Mali acceleration currently only working for root user. Please apply [a fix](http://forum.armbian.com/index.php/topic/617-wip-orange-pi-one-support-for-the-upcoming-orange-pi-one/?p=5719) manually or wait for 5.05 to fix this
***Important to know***

View File

@ -156,9 +156,12 @@ keyboard:
dpkg-reconfigure keyboard-configuration
system language:
system language:
# Debian --> https://wiki.debian.org/ChangeLanguage
dpkg-reconfigure locales
# Ubuntu --> https://help.ubuntu.com/community/Locale
update-locale LANG=[options] && dpkg-reconfigure locales
console font, codepage:

View File

@ -13,6 +13,8 @@ if [ "X$1" != "Xstart" ]; then
exit 1
fi
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
create_motd_warning() {
cat > /etc/update-motd.d/90-warning <<EOT
#!/bin/bash
@ -203,3 +205,27 @@ if [[ $MACHINE == *M2* ]]; then ID="Banana M2"; fi
echo -e "[\e[0;32m ok \x1B[0m] Starting ARM hardware info: $ID"
echo $ID > /var/run/machine.id
export HARDWARE DISTROID DISTROCODE ARCH KERNELID MACHINE ID
if [ -f /var/log/armhwinfo.log ]; then
echo -e "\n\n\n$(date) $HARDWARE $DISTROID $DISTROCODE $ARCH $KERNELID $MACHINE $ID" >>/var/log/armhwinfo.log
else
echo "$(date) $HARDWARE $DISTROID $DISTROCODE $ARCH $KERNELID $MACHINE $ID" >>/var/log/armhwinfo.log
chmod 755 /var/log/armhwinfo.log
fi
cat /proc/version >>/var/log/armhwinfo.log
echo -e "\n### dmesg:\n" >>/var/log/armhwinfo.log
cat "${TMPFILE}" >>/var/log/armhwinfo.log
echo -e "\n### lsusb:" >>/var/log/armhwinfo.log
lsusb -v >>/var/log/armhwinfo.log
echo -e "\n### lscpu:\n" >>/var/log/armhwinfo.log
lscpu >>/var/log/armhwinfo.log
echo -e "\n### cpuinfo:\n" >>/var/log/armhwinfo.log
cat /proc/cpuinfo >>/var/log/armhwinfo.log
echo -e "\n### meminfo:\n" >>/var/log/armhwinfo.log
cat /proc/meminfo >>/var/log/armhwinfo.log
echo -e "\n### interrupts:\n" >>/var/log/armhwinfo.log
cat /proc/interrupts >>/var/log/armhwinfo.log
echo -e "\n### ifconfig:\n" >>/var/log/armhwinfo.log
ifconfig >>/var/log/armhwinfo.log
echo -e "\n### df:\n" >>/var/log/armhwinfo.log
df -h >>/var/log/armhwinfo.log

View File

@ -117,9 +117,16 @@ autodetect_h3() {
# wait for armhwinfo
sleep 3
MACHINE="$(tail -n1 /run/machine.id)"
NEWHOSTNAME="$(echo "${MACHINE}" | tr '[:upper:]' '[:lower:]' | sed -e 's/+/plus/' -e 's/\ //g')"
ScriptBinName="$(echo "${NEWHOSTNAME}" | sed -e 's/2mini$/2/g' -e 's/plus2$/plus/g').bin"
ScriptBinUsed="$(readlink -f "/boot/script.bin")"
case ${MACHINE} in
"Orange Pi+"*)
ln -sf /boot/bin/orangepiplus.bin /boot/script.bin
if [ "X${ScriptBinName}" != "X${ScriptBinUsed##*/}" ]; then
# wrong detection due to disabled Ethernet on 1st boot
ln -sf /boot/bin/orangepi2.bin /boot/script.bin
NEWHOSTNAME="orangepi2"
fi
;;
"Orange Pi 2"*)
ln -sf /boot/bin/orangepi2.bin /boot/script.bin
@ -137,8 +144,14 @@ autodetect_h3() {
sed -i -e 's/MIN_SPEED=480000/MIN_SPEED=648000/' \
-e 's/MAX_SPEED=1296000/MAX_SPEED=1200000/' /etc/default/cpufrequtils
;;
"Banana Pi M2+")
if [ "X${ScriptBinName}" != "X${ScriptBinUsed##*/}" ]; then
# wrong detection due to disabled Ethernet on 1st boot
ln -sf /boot/bin/orangepipc.bin /boot/script.bin
NEWHOSTNAME="orangepipc"
fi
;;
esac
NEWHOSTNAME="$(echo "${MACHINE}" | tr '[:upper:]' '[:lower:]' | sed -e 's/+/plus/' -e 's/\ //g')"
echo "${NEWHOSTNAME}" >/etc/hostname
sed -i "s/orangepih3/${NEWHOSTNAME}/" /etc/hosts
rm /boot/bin/orangepih3.bin