From 35b585a0facbbeac5553d9ec1765eaa7e4c808f8 Mon Sep 17 00:00:00 2001 From: zador-blood-stained Date: Thu, 23 Jun 2016 14:14:39 +0300 Subject: [PATCH] Rename ID to BOARD_NAME to avoid conflicts --- makeboarddeb.sh | 12 +++++++++- scripts/armbianmonitor/armbianmonitor-daemon | 10 ++++----- scripts/armhwinfo | 23 ++++++++++---------- scripts/update-motd.d/10-header | 15 ++++++------- scripts/update-motd.d/99-point-to-faq | 17 +++++---------- 5 files changed, 40 insertions(+), 37 deletions(-) diff --git a/makeboarddeb.sh b/makeboarddeb.sh index 4804000f83..7f15228160 100644 --- a/makeboarddeb.sh +++ b/makeboarddeb.sh @@ -106,7 +106,7 @@ create_board_package() cat <<-EOF > $destination/etc/armbian-release # PLEASE DO NOT EDIT THIS FILE BOARD=$BOARD - ID="$BOARD_NAME" + BOARD_NAME="$BOARD_NAME" VERSION=$REVISION LINUXFAMILY=$LINUXFAMILY BRANCH=$BRANCH @@ -142,6 +142,16 @@ create_board_package() APT::Install-Suggests "0"; EOF + # pin priority for armbian repo + # reference: man apt_preferences + # this allows providing own versions of hostapd, libdri2 and sunxi-tools + mkdir -p $destination/etc/apt/preferences.d/ + cat <<-EOF > $destination/etc/apt/preferences.d/50-armbian.pref + Package: * + Pin: origin "apt.armbian.com" + Pin-Priority: 990 + EOF + # script to install to SATA mkdir -p $destination/usr/sbin/ cp -R $SRC/lib/scripts/nand-sata-install/usr $destination/ diff --git a/scripts/armbianmonitor/armbianmonitor-daemon b/scripts/armbianmonitor/armbianmonitor-daemon index 68e8f1a297..0dfaa6b2e6 100644 --- a/scripts/armbianmonitor/armbianmonitor-daemon +++ b/scripts/armbianmonitor/armbianmonitor-daemon @@ -68,7 +68,7 @@ DiskCheckInterval=60 # time in seconds between disk checks Main() { PreRequisits - case ${ID} in + case ${BOARD_NAME} in Cubieboard|Cubietruck|Orange|"Lamobo R1"|"Lime 2"|Lime|Banana|Micro) DealWithAXP209 ;; @@ -176,7 +176,7 @@ DealWithAXP209() { rm -f /etc/armbianmonitor/datasources/soctemp fi echo -n 25000 >/etc/armbianmonitor/datasources/soctemp - export GetSoCTemp="${ARCH}-${ID}" + export GetSoCTemp="${ARCH}-${BOARD_NAME}" fi if [ -d /sys/devices/platform/soc@01c00000/1c2ac00.i2c/i2c-0/0-0034 ]; then # mainline kernel and 'axp209 mainline sysfs interface' patch applied @@ -253,8 +253,8 @@ CreateTemplates() { echo "web.page.icon='img/armbian.png' web.page.menutitle='RPi-Monitor ('+data.hostname+')' web.page.pagetitle='RPi-Monitor ('+data.hostname+')' -web.status.1.name=$ID -web.statistics.1.name=$ID +web.status.1.name=$BOARD_NAME +web.statistics.1.name=$BOARD_NAME web.addons.1.name=Addons web.addons.1.addons=about include=/etc/armbianmonitor/templates/version.conf @@ -357,7 +357,7 @@ PreRequisits() { # we need the informations gathered from armhwinfo. In case we're not called # from there, get the variables on our own - if [ "X${ID}" = "X" ]; then + if [ "X${BOARD_NAME}" = "X" ]; then . /etc/init.d/armhwinfo start >/dev/null 2>&1 fi diff --git a/scripts/armhwinfo b/scripts/armhwinfo index 0c5a6e67aa..0e31abf69f 100644 --- a/scripts/armhwinfo +++ b/scripts/armhwinfo @@ -10,6 +10,9 @@ export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin +# Starting with 5.15 read in $BOARD (odroidc2), $BOARD_NAME ("Odroid C2") and $VERSION (5.15) +. /etc/armbian-release + collect_information() { ifconfig | grep -q eth0 || (ifconfig eth0 up ; sleep 2) TMPFILE=$(mktemp /tmp/${0##*/}.XXXXXX) @@ -18,10 +21,8 @@ collect_information() { ARCH=$(lscpu | awk '/Architecture/ {print $2}') HARDWARE=$(awk '/Hardware/ {print $3}' /proc/irq/$(awk -F":" "/ethernet/ {print \$1}" /dev/null @@ -116,7 +117,7 @@ prepare_board() { # Assign 1st and 2nd USB port to cpu1 and cpu2 on every sun8i board echo 2 >/proc/irq/$(awk -F":" "/${USB1}/ {print \$1}" /proc/irq/$(awk -F":" "/${USB2}/ {print \$1}" /proc/irq/$(awk -F":" "/${GbE}/ {print \$1}" /proc/irq/$(awk -F":" "/usb1/ {print \$1}" /proc/irq/$(awk -F":" "/usb2/ {print \$1}" /proc/irq/$(awk -F":" "/1c30000.eth/ {print \$1}" "/etc/logrotate.d/${0##*/}" ; chmod 644 "/etc/logrotate.d/${0##*/}" if [ -f ${Log} ]; then - echo -e "\n\n\n$(date) $HARDWARE $ARCH $KERNELID $MACHINE $ID $VERSION" >>${Log} + echo -e "\n\n\n$(date) $HARDWARE $ARCH $KERNELID $MACHINE $BOARD_NAME $VERSION" >>${Log} else - echo "$(date) $HARDWARE $ARCH $KERNELID $MACHINE $ID $VERSION" >>${Log} + echo "$(date) $HARDWARE $ARCH $KERNELID $MACHINE $BOARD_NAME $VERSION" >>${Log} chmod 755 ${Log} fi echo -e "\n### dmesg:\n" >>${Log} @@ -247,7 +248,7 @@ case $1 in # display message, log hardware id to file, write log echo -e "[\e[0;32m ok \x1B[0m] Starting ARM hardware info: $ID (${VERSION})" - echo $ID >/var/run/machine.id # we should leave this, maybe users depend on it + echo $BOARD_NAME >/var/run/machine.id # we should leave this, maybe users depend on it if [ $? -ne 0 ]; then # most probably readonly fs. We'll try to warn the user. show_motd_warning "It seems the rootfs is readonly at the moment. Please check your SD card for errors" @@ -258,14 +259,14 @@ case $1 in log_hardware_info # crash detection, enable verbose logging and disable it at clean shutdown - echo "$(date "+%s") $HARDWARE $ARCH $KERNELID $MACHINE $ID $VERSION" >/boot/.verbose + echo "$(date "+%s") $HARDWARE $ARCH $KERNELID $MACHINE $BOARD_NAME $VERSION" >/boot/.verbose sync ;; query) # armbianmonitor mode -- only interested in hardware info collect_information >/dev/null prepare_board >/dev/null - export HARDWARE ARCH KERNELID MACHINE ID VERSION + export HARDWARE ARCH KERNELID MACHINE BOARD_NAME VERSION ;; *stop*) # remove /boot/.verbose only if /boot/.force-verbose doesn't exist. diff --git a/scripts/update-motd.d/10-header b/scripts/update-motd.d/10-header index 6a0d8771d0..31c56e0a43 100644 --- a/scripts/update-motd.d/10-header +++ b/scripts/update-motd.d/10-header @@ -1,11 +1,10 @@ #!/bin/bash -export TERM=linux + . /etc/os-release +. /etc/armbian-release + KERNELID=$(uname -r) -([[ -f /etc/armbian-release ]] && source /etc/armbian-release || read ID /dev/null -read HOSTNAME