More selective removal of H3 auto
This commit is contained in:
parent
124a25df97
commit
2049939fd8
@ -147,8 +147,6 @@ create_board_package (){
|
||||
for i in $(ls -w1 $SRC/lib/config/fex/*.fex | xargs -n1 basename); do
|
||||
fex2bin $SRC/lib/config/fex/${i%*.fex}.fex $destination/boot/bin/${i%*.fex}.bin
|
||||
done
|
||||
# One H3 image for all Fast Ethernet equipped Orange Pi H3
|
||||
cp -p "$destination/boot/bin/orangepi2.bin" "$destination/boot/bin/orangepih3.bin"
|
||||
|
||||
# bluetooth device enabler - for cubietruck
|
||||
install -m 755 $SRC/lib/bin/brcm_bt_reset $destination/usr/local/bin
|
||||
|
||||
@ -103,69 +103,8 @@ display_alert() {
|
||||
}
|
||||
|
||||
autodetect_sunxi() {
|
||||
# This function adjusts script.bin, hostname and cpufreq settings based on
|
||||
# /run/machine.id so that two OS images (one built for GbE H3 devices like
|
||||
# Orange Pi Plus or Banana Pi M2+ and one for the other H3 devices using
|
||||
# the internal Ethernet PHY or Banana Pro vs. Pi) 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 or blue LED as user feedback
|
||||
echo heartbeat >/sys/class/leds/*red*/trigger 2>/dev/null || echo heartbeat >/sys/class/leds/*blue*/trigger 2>/dev/null
|
||||
|
||||
# wait for armhwinfo
|
||||
sleep 3
|
||||
read MACHINE </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
|
||||
"Banana Pi")
|
||||
ln -sf /boot/bin/bananapi.bin /boot/script.bin
|
||||
;;
|
||||
"Orange Pi+"*)
|
||||
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
|
||||
;;
|
||||
"Orange Pi PC")
|
||||
ln -sf /boot/bin/orangepipc.bin /boot/script.bin
|
||||
;;
|
||||
"Orange Pi One")
|
||||
ln -sf /boot/bin/orangepione.bin /boot/script.bin
|
||||
sed -i -e 's/MAX_SPEED=1296000/MAX_SPEED=1200000/' /etc/default/cpufrequtils
|
||||
;;
|
||||
"Orange Pi Lite")
|
||||
ln -sf /boot/bin/orangepilite.bin /boot/script.bin
|
||||
sed -i -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
|
||||
;;
|
||||
"Beelink X2")
|
||||
ln -sf /boot/bin/beelinkx2.bin /boot/script.bin
|
||||
sed -i -e 's/MIN_SPEED=480000/MIN_SPEED=648000/' \
|
||||
-e 's/MAX_SPEED=1296000/MAX_SPEED=1200000/' /etc/default/cpufrequtils
|
||||
;;
|
||||
"NanoPi M1")
|
||||
ln -sf /boot/bin/nanopim1.fex /boot/script.bin
|
||||
sed -i -e 's/MAX_SPEED=1296000/MAX_SPEED=1200000/' /etc/default/cpufrequtils
|
||||
;;
|
||||
esac
|
||||
echo "${NEWHOSTNAME}" >/etc/hostname
|
||||
sed -i -e "s/^::1 localhost.*/::1 localhost ${NEWHOSTNAME} ip6-localhost ip6-loopback/" \
|
||||
-e "s/^127.0.0.1 localhost.*/127.0.0.1 localhost ${NEWHOSTNAME}/" /etc/hosts
|
||||
echo heartbeat >/sys/class/leds/*red*/trigger 2>/dev/null || echo heartbeat >/sys/class/leds/*blue*/trigger 2>/dev/null
|
||||
[ -f /etc/wicd/wired-settings.conf ] && \
|
||||
sed -i "s/^dhcphostname =.*/dhcphostname = ${NEWHOSTNAME}/" /etc/wicd/wired-settings.conf && \
|
||||
sed -i "s/wpa_driver =.*/wpa_driver = none/" /etc/wicd/manager-settings.conf
|
||||
@ -261,9 +200,9 @@ main() {
|
||||
touch /tmp/firstrun_running
|
||||
/tmp/create_swap.sh &
|
||||
|
||||
#if [ "X${HARDWARE}" = "Xsun8i" -o "X${HARDWARE}" = "Xsun7i" ]; then
|
||||
# autodetect_sunxi
|
||||
#fi
|
||||
if [ "X${HARDWARE}" = "Xsun8i" -o "X${HARDWARE}" = "Xsun7i" ]; then
|
||||
autodetect_sunxi
|
||||
fi
|
||||
|
||||
# pine64 temp workaround
|
||||
if [ "$(awk '/Hardware/ {print $3}' </proc/cpuinfo)" = "sun50iw1p1" ] && [ -z "$(grep ethaddr /boot/uEnv.txt)" ] && [ -f "/sys/class/net/eth0/address" ]; then
|
||||
|
||||
Loading…
Reference in New Issue
Block a user