From 0d975ca07406a9479f0130c5fd27340fc70e7a2e Mon Sep 17 00:00:00 2001 From: Thomas Kaiser Date: Tue, 11 Apr 2017 14:05:46 +0200 Subject: [PATCH] Few more OMV and OPi Zero Plus 2 H3 fixes --- ...roplus2.conf => orangepizeroplus2-h3.conf} | 0 ...zeroplus2.fex => orangepizeroplus2-h3.fex} | 8 +++---- configuration.sh | 2 +- scripts/customize-image.sh.template | 23 +++++++++++-------- scripts/update-motd.d/10-header | 6 ++++- 5 files changed, 22 insertions(+), 17 deletions(-) rename config/boards/{orangepizeroplus2.conf => orangepizeroplus2-h3.conf} (100%) rename config/fex/{orangepizeroplus2.fex => orangepizeroplus2-h3.fex} (98%) diff --git a/config/boards/orangepizeroplus2.conf b/config/boards/orangepizeroplus2-h3.conf similarity index 100% rename from config/boards/orangepizeroplus2.conf rename to config/boards/orangepizeroplus2-h3.conf diff --git a/config/fex/orangepizeroplus2.fex b/config/fex/orangepizeroplus2-h3.fex similarity index 98% rename from config/fex/orangepizeroplus2.fex rename to config/fex/orangepizeroplus2-h3.fex index 31aa100f9a..10354f6874 100644 --- a/config/fex/orangepizeroplus2.fex +++ b/config/fex/orangepizeroplus2-h3.fex @@ -4,13 +4,11 @@ ; TODO: ; - try to boot ; - verify DRAM parameters -; - check whether AP6212 is connected to uart1 or uart2 -; - check whether red led is still connected to PA17 -; - check which USB port is missing: usbc1, usbc2 or usbc3 +; - fix powering on AP6212 ; [product] version = "100" -machine = "Xunlong Orange Pi Zero Plus 2" +machine = "Xunlong Orange Pi Zero Plus 2 H3" [platform] debug_mode = 1 @@ -553,7 +551,7 @@ usb_regulator_vol = 0 usb_not_suspend = 0 [usbc1] -usb_used = 1 +usb_used = 0 usb_drv_vbus_gpio = usb_restrict_gpio = usb_host_init_state = 1 diff --git a/configuration.sh b/configuration.sh index 813c5065a2..0f368e387a 100644 --- a/configuration.sh +++ b/configuration.sh @@ -17,7 +17,7 @@ MAINTAINERMAIL="igor.pecovnik@****l.com" # deb signature TZDATA=`cat /etc/timezone` # Timezone for target is taken from host or defined here. USEALLCORES=yes # Use all CPU cores for compiling EXIT_PATCHING_ERROR="" # exit patching if failed -HOST="$BOARD" # set hostname to the board +HOST="$(echo "$BOARD" | cut -f1 -d-)" # set hostname to the board CACHEDIR=$DEST/cache ROOTFSCACHE_VERSION=3 diff --git a/scripts/customize-image.sh.template b/scripts/customize-image.sh.template index 34e236b5a8..726b891230 100644 --- a/scripts/customize-image.sh.template +++ b/scripts/customize-image.sh.template @@ -48,8 +48,7 @@ InstallOpenMediaVault() { cp -p /etc/default/cpufrequtils /etc/default/cpufrequtils.bak locale-gen "en_US.UTF-8" locale-gen "C" - export LANG=C - export LC_ALL="en_US.UTF-8" + export LANG=C LC_ALL="en_US.UTF-8" #Add OMV source.list and Update System cat > /etc/apt/sources.list.d/openmediavault.list <<- EOF @@ -88,7 +87,7 @@ InstallOpenMediaVault() { -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install \ openmediavault - #install OMV extras + # install OMV extras, enable folder2ram, tweak some settings FILE=$(mktemp) wget http://omv-extras.org/openmediavault-omvextrasorg_latest_all3.deb -qO $FILE && dpkg -i $FILE && rm $FILE /usr/sbin/omv-update @@ -107,16 +106,20 @@ InstallOpenMediaVault() { # rootfs resize to 4GB max and adding omv-initsystem to firstrun -- q&d but shouldn't matter echo 8388608s >/root/.rootfs_resize sed -i '/systemctl\ disable\ firstrun/i \ - \tmv /usr/bin/newaliases.bak /usr/bin/newaliases \ - \texport DEBIAN_FRONTEND=noninteractive \ - \tapt-get install -f || exit 0 \ - \t/usr/sbin/omv-initsystem \ - \tmv /etc/default/cpufrequtils.bak /etc/default/cpufrequtils' /etc/init.d/firstrun + mv /usr/bin/newaliases.bak /usr/bin/newaliases \ + export DEBIAN_FRONTEND=noninteractive \ + apt-get install -f || exit 0 \ + /usr/sbin/omv-initsystem \ + mv /etc/default/cpufrequtils.bak /etc/default/cpufrequtils \ + . /etc/default/cpufrequtils \ + echo -e "OMV_CPUFREQUTILS_GOVERNOR=${GOVERNOR}" >>/etc/default/openmediavault \ + echo -e "OMV_CPUFREQUTILS_MINSPEED=${MIN_SPEED}" >>/etc/default/openmediavault \ + echo -e "OMV_CPUFREQUTILS_MAXSPEED=${MAX_SPEED}" >>/etc/default/openmediavault' /etc/init.d/firstrun sed -i '/systemctl\ disable\ firstrun/a \ - \tsync && sleep 30 && reboot' /etc/init.d/firstrun + sync && sleep 30 && reboot' /etc/init.d/firstrun # some performance tuning - sed -i '/^exit\ 0/i \ + grep -q ondemand /etc/default/cpufrequtils && sed -i '/^exit\ 0/i \ echo ondemand >/sys/devices/system/cpu/cpu0/cpufreq/scaling_governor \ sleep 0.1 \ echo 1 >/sys/devices/system/cpu/cpufreq/ondemand/io_is_busy \ diff --git a/scripts/update-motd.d/10-header b/scripts/update-motd.d/10-header index 51fec39472..2c8bc06ab5 100644 --- a/scripts/update-motd.d/10-header +++ b/scripts/update-motd.d/10-header @@ -14,6 +14,10 @@ done KERNELID=$(uname -r) -TERM=linux toilet -f standard -F metal $BOARD_NAME +if [ $(echo $BOARD_NAME | wc -c) -ge 18 ]; then + TERM=linux toilet -f standard -F metal $(echo $BOARD_NAME | sed 's/Orange Pi/OPi/') +else + TERM=linux toilet -f standard -F metal $BOARD_NAME +fi printf '\nWelcome to \e[0;91mARMBIAN\x1B[0m %s %s %s %s\n' "$VERSION $IMAGE_TYPE $PRETTY_NAME $KERNELID"