Rename ID to BOARD_NAME to avoid conflicts

This commit is contained in:
zador-blood-stained 2016-06-23 14:14:39 +03:00
parent 7ebaa36870
commit 35b585a0fa
5 changed files with 40 additions and 37 deletions

View File

@ -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/

View File

@ -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 <sub>('+data.hostname+')</sub>'
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

View File

@ -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/cpuinfo)
[ "X${HARDWARE}" = "XAllwinner" ] && HARDWARE=$(awk '/Hardware/ {print $4}' </proc/cpuinfo)
KERNELID=$(awk -F" " '{print $3}' </proc/version)
KERNELID=$(uname -r)
# Starting with 5.15 read in $BOARD (odroidc2), $ID ("Odroid C2") and $VERSION (5.15)
[[ -f /etc/armbian-release ]] && source /etc/armbian-release
} # collect_information
set_io_scheduler() {
@ -40,7 +41,7 @@ set_io_scheduler() {
} # set_io_scheduler
prepare_board() {
# IRQ distribution based on $HARDWARE and/or $ID, probably some sort of user feedback (leds)
# IRQ distribution based on $HARDWARE and/or $BOARD, probably some sort of user feedback (leds)
case ${HARDWARE} in
Freescale) # i.MX6 boards, send Ethernet to cpu1, MMC to cpu2/cpu3 (when available)
echo 2 >/proc/irq/$(awk -F":" "/ethernet/ {print \$1}" </proc/interrupts | sed 's/\ //g' | head -1)/smp_affinity 2>/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/interrupts | sed 's/\ //g')/smp_affinity
echo 4 >/proc/irq/$(awk -F":" "/${USB2}/ {print \$1}" </proc/interrupts | sed 's/\ //g')/smp_affinity
case ${ID} in
case ${BOARD_NAME} in
"Orange Pi+"|"Orange Pi+ 2"|"Orange Pi+ 2E"|"Banana Pi M2+")
# Send GBit Ethernet IRQs to cpu3
echo 8 >/proc/irq/$(awk -F":" "/${GbE}/ {print \$1}" </proc/interrupts | sed 's/\ //g')/smp_affinity
@ -146,7 +147,7 @@ prepare_board() {
echo 2 >/proc/irq/$(awk -F":" "/usb1/ {print \$1}" </proc/interrupts | sed 's/\ //g')/smp_affinity
echo 4 >/proc/irq/$(awk -F":" "/usb2/ {print \$1}" </proc/interrupts | sed 's/\ //g')/smp_affinity
# Send IRQs for GBit Ethernet on Pine64+ or SD card on Pine64 to cpu3
case $ID in
case $BOARD_NAME in
"Pine64+")
echo 8 >/proc/irq/$(awk -F":" "/1c30000.eth/ {print \$1}" </proc/interrupts | sed 's/\ //g')/smp_affinity
;;
@ -164,9 +165,9 @@ log_hardware_info() {
echo -e "${Log} {\n rotate 12\n weekly\n compress\n missingok\n notifempty\n}" \
> "/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.

View File

@ -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 </run/machine.id) 2>/dev/null
read HOSTNAME </etc/hostname
clear
toilet -f standard -F metal ${ID:-$HOSTNAME}
echo ""
printf 'Welcome to \e[0;91mARMBIAN\x1B[0m %s %s\n' "$PRETTY_NAME $KERNELID"
echo ""
TERM=linux toilet -f standard -F metal $BOARD_NAME
printf '\nWelcome to \e[0;91mARMBIAN\x1B[0m %s %s\n' "$PRETTY_NAME $KERNELID"

View File

@ -1,15 +1,8 @@
#!/bin/bash
export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
. /etc/armbian-release
Main() {
[[ -f /etc/armbian-release ]] && source /etc/armbian-release || read ID </run/machine.id
case ${ID} in
"Orange Pi+"*|"Orange Pi 2"*|"Orange Pi PC"*|"Orange Pi One"|"Orange Pi Lite"|"NanoPi M1"|"Beelink X2")
echo -e "\nNew to Armbian? Check the Armbian H3 Mini FAQ first:\nhttps://github.com/igorpecovnik/lib/blob/master/documentation/H3_mini_faq.md\n\n"
(sleep 1 && rm "$0") &
;;
esac
} # Main
Main
if [ "$LINUXFAMILY" = "sun8i" ]; then
printf "\nNew to Armbian? Check the Armbian H3 Mini FAQ first:\n\e[0;92m https://github.com/igorpecovnik/lib/blob/master/documentation/H3_mini_faq.md \x1B[0m\n"
(sleep 1 && rm "$0") &
fi