From d907029ee4f3cc57c933a7864ede4ee00d0e201a Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Sat, 12 Jan 2019 13:45:30 +0200 Subject: [PATCH] Convert all os_ variables to uppercase --- board/common/mkimage.sh | 10 ++--- board/common/overlay/etc/init.d/S00datapart | 2 +- board/common/overlay/etc/init.d/S01mountall | 10 ++--- board/common/overlay/etc/init.d/S02modules | 2 +- board/common/overlay/etc/init.d/S03hostname | 4 +- board/common/overlay/etc/init.d/S04syslog | 4 +- board/common/overlay/etc/init.d/S12udev | 2 +- board/common/overlay/etc/init.d/S13watchdog | 2 +- .../common/overlay/etc/init.d/S14postupgrade | 6 +-- board/common/overlay/etc/init.d/S30dbus | 2 +- board/common/overlay/etc/init.d/S33hostapd | 2 +- board/common/overlay/etc/init.d/S35wifi | 18 ++++----- board/common/overlay/etc/init.d/S36ppp | 6 +-- board/common/overlay/etc/init.d/S37bluetooth | 2 +- board/common/overlay/etc/init.d/S40network | 40 +++++++++---------- board/common/overlay/etc/init.d/S41netwatch | 4 +- board/common/overlay/etc/init.d/S43firewall | 2 +- board/common/overlay/etc/init.d/S45dnsmasq | 2 +- board/common/overlay/etc/init.d/S50date | 4 +- board/common/overlay/etc/init.d/S51crond | 2 +- board/common/overlay/etc/init.d/S60sshd | 4 +- board/common/overlay/etc/init.d/S98userinit | 2 +- board/common/overlay/etc/init.d/S99showinfo | 8 ++-- board/common/overlay/etc/init.d/base | 6 +-- board/common/overlay/etc/init.d/rcK | 2 +- board/common/overlay/etc/init.d/rcS | 2 +- board/common/overlay/etc/os.conf | 25 ++++++------ board/common/overlay/etc/version | 8 ++-- board/common/overlay/sbin/fwupdate | 16 ++++---- board/nanopineo/os.conf | 2 +- board/nanopineo2/os.conf | 2 +- board/odroidc1/os.conf | 2 +- board/odroidc2/os.conf | 2 +- board/odroidxu4/overlay/etc/init.d/S02waiteth | 2 +- .../raspberrypi/overlay/etc/init.d/S05cpufreq | 2 +- .../overlay/etc/init.d/S11throttlewatch | 2 +- .../raspberrypi/overlay/etc/init.d/S13btuart | 2 +- .../overlay/etc/init.d/S05cpufreq | 2 +- .../overlay/etc/init.d/S11throttlewatch | 2 +- .../overlay/etc/init.d/S05cpufreq | 2 +- .../overlay/etc/init.d/S11throttlewatch | 2 +- .../raspberrypi3/overlay/etc/init.d/S13btuart | 2 +- 42 files changed, 113 insertions(+), 112 deletions(-) diff --git a/board/common/mkimage.sh b/board/common/mkimage.sh index a681280f63..96143054ba 100755 --- a/board/common/mkimage.sh +++ b/board/common/mkimage.sh @@ -28,7 +28,7 @@ GUARD_SIZE="10" # MB DISK_SIZE=$((ROOT_START + ROOT_SIZE + GUARD_SIZE)) COMMON_DIR=$(cd $IMG_DIR/../../../board/common; pwd) -OS_NAME=$(source $COMMON_DIR/overlay/etc/version && echo $os_short_name) +OS_NAME=$(source $COMMON_DIR/overlay/etc/version && echo $OS_SHORT_NAME) # boot filesystem msg "creating boot loop device" @@ -73,19 +73,19 @@ tar -xpsf $ROOT_SRC -C $ROOT if [ -f $ROOT/etc/version ]; then if [ -n "$THINGOS_NAME" ]; then msg "setting OS name to $THINGOS_NAME" - sed -ri "s/os_name=\".*\"/os_name=\"$THINGOS_NAME\"/" $ROOT/etc/version + sed -ri "s/OS_NAME=\".*\"/OS_NAME=\"$THINGOS_NAME\"/" $ROOT/etc/version fi if [ -n "$THINGOS_SHORT_NAME" ]; then msg "setting OS short name to $THINGOS_SHORT_NAME" - sed -ri "s/os_short_name=\".*\"/os_short_name=\"$THINGOS_SHORT_NAME\"/" $ROOT/etc/version + sed -ri "s/OS_SHORT_NAME=\".*\"/OS_SHORT_NAME=\"$THINGOS_SHORT_NAME\"/" $ROOT/etc/version fi if [ -n "$THINGOS_PREFIX" ]; then msg "setting OS prefix to $THINGOS_PREFIX" - sed -ri "s/os_prefix=\".*\"/os_prefix=\"$THINGOS_PREFIX\"/" $ROOT/etc/version + sed -ri "s/OS_PREFIX=\".*\"/OS_PREFIX=\"$THINGOS_PREFIX\"/" $ROOT/etc/version fi if [ -n "$THINGOS_VERSION" ]; then msg "setting OS version to $THINGOS_VERSION" - sed -ri "s/os_version=\".*\"/os_version=\"$THINGOS_VERSION\"/" $ROOT/etc/version + sed -ri "s/OS_VERSION=\".*\"/OS_VERSION=\"$THINGOS_VERSION\"/" $ROOT/etc/version fi fi diff --git a/board/common/overlay/etc/init.d/S00datapart b/board/common/overlay/etc/init.d/S00datapart index f8b2747c07..7bf25bdc27 100755 --- a/board/common/overlay/etc/init.d/S00datapart +++ b/board/common/overlay/etc/init.d/S00datapart @@ -1,6 +1,6 @@ #!/bin/bash -test -n "$os_version" || source /etc/init.d/base +test -n "$OS_VERSION" || source /etc/init.d/base case "$1" in start) diff --git a/board/common/overlay/etc/init.d/S01mountall b/board/common/overlay/etc/init.d/S01mountall index ac987534aa..8354d3054c 100755 --- a/board/common/overlay/etc/init.d/S01mountall +++ b/board/common/overlay/etc/init.d/S01mountall @@ -1,6 +1,6 @@ #!/bin/bash -test -n "$os_version" || source /etc/init.d/base +test -n "$OS_VERSION" || source /etc/init.d/base mount_fs() { msg_begin "Mounting filesystems" @@ -22,8 +22,8 @@ remount_rw() { } mk_tty_login() { - test -z "$os_tty_login" && os_tty_login=tty1 - ln -sf /dev/$os_tty_login /dev/ttylogin + test -z "$OS_TTY_LOGIN" && OS_TTY_LOGIN=tty1 + ln -sf /dev/$OS_TTY_LOGIN /dev/ttylogin } case "$1" in @@ -31,8 +31,8 @@ case "$1" in mount_fs # we need to source conf again, now that /data is available - test -n "$os_debug" || source /etc/init.d/os_conf - test "$os_debug" == "true" && remount_rw + test -n "$OS_DEBUG" || source /etc/init.d/os_conf + test "$OS_DEBUG" == "true" && remount_rw mk_tty_login ;; diff --git a/board/common/overlay/etc/init.d/S02modules b/board/common/overlay/etc/init.d/S02modules index b667086346..4190059f95 100755 --- a/board/common/overlay/etc/init.d/S02modules +++ b/board/common/overlay/etc/init.d/S02modules @@ -5,7 +5,7 @@ BOOT_MODULES_FILE="/boot/modules" MODULES_FILE="/data/etc/modules" -test -n "$os_version" || source /etc/init.d/base +test -n "$OS_VERSION" || source /etc/init.d/base case "$1" in start) diff --git a/board/common/overlay/etc/init.d/S03hostname b/board/common/overlay/etc/init.d/S03hostname index f081363b86..5660423ad9 100755 --- a/board/common/overlay/etc/init.d/S03hostname +++ b/board/common/overlay/etc/init.d/S03hostname @@ -5,7 +5,7 @@ BOOT_HOSTNAME_FILE="/boot/hostname" HOSTNAME_FILE="/data/etc/hostname" -test -n "$os_version" || source /etc/init.d/base +test -n "$OS_VERSION" || source /etc/init.d/base case "$1" in start) @@ -16,7 +16,7 @@ case "$1" in if [[ -f $HOSTNAME_FILE ]]; then hostname=$(cat $HOSTNAME_FILE) else - hostname="$os_prefix-$board_sn" + hostname="$OS_PREFIX-$BOARD_SN" fi /bin/hostname $hostname diff --git a/board/common/overlay/etc/init.d/S04syslog b/board/common/overlay/etc/init.d/S04syslog index da74427391..7eba761d12 100755 --- a/board/common/overlay/etc/init.d/S04syslog +++ b/board/common/overlay/etc/init.d/S04syslog @@ -1,6 +1,6 @@ #!/bin/bash -test -n "$os_version" || source /etc/init.d/base +test -n "$OS_VERSION" || source /etc/init.d/base DMESG_LOG="/var/log/dmesg.log" @@ -10,7 +10,7 @@ case "$1" in msg_begin "Starting syslogd" syslogd test $? == 0 && msg_done || msg_fail - echo "---- booting $os_name $os_version ----" >> $DMESG_LOG + echo "---- booting $OS_NAME $OS_VERSION ----" >> $DMESG_LOG dmesg -T -w >> $DMESG_LOG & ;; diff --git a/board/common/overlay/etc/init.d/S12udev b/board/common/overlay/etc/init.d/S12udev index 2c2f20c4b1..73d187e397 100755 --- a/board/common/overlay/etc/init.d/S12udev +++ b/board/common/overlay/etc/init.d/S12udev @@ -5,7 +5,7 @@ CONF=/etc/udev/udev.conf test -f $CONF || exit 0 -test -n "$os_version" || source /etc/init.d/base +test -n "$OS_VERSION" || source /etc/init.d/base source $CONF diff --git a/board/common/overlay/etc/init.d/S13watchdog b/board/common/overlay/etc/init.d/S13watchdog index 2ef0f11278..3ffe16881a 100755 --- a/board/common/overlay/etc/init.d/S13watchdog +++ b/board/common/overlay/etc/init.d/S13watchdog @@ -2,7 +2,7 @@ test -c /dev/watchdog || exit 0 -test -n "$os_version" || source /etc/init.d/base +test -n "$OS_VERSION" || source /etc/init.d/base case "$1" in start) diff --git a/board/common/overlay/etc/init.d/S14postupgrade b/board/common/overlay/etc/init.d/S14postupgrade index 225c0f6c6e..4820f340af 100755 --- a/board/common/overlay/etc/init.d/S14postupgrade +++ b/board/common/overlay/etc/init.d/S14postupgrade @@ -5,7 +5,7 @@ VERSION_FILE="/data/etc/version" POST_UPGRADE_DIR="/usr/share/post-upgrade" -test -n "$os_version" || source /etc/init.d/base +test -n "$OS_VERSION" || source /etc/init.d/base hash=$(md5sum $VERSION_FILE 2>/dev/null | cut -d ' ' -f 1) sys_hash=$(md5sum $SYS_VERSION_FILE 2>/dev/null | cut -d ' ' -f 1) @@ -23,8 +23,8 @@ function version_gt() { } function run_post_upgrade() { - version="$(source $VERSION_FILE 2>/dev/null && echo $os_version)" - sys_version="$(source $SYS_VERSION_FILE 2>/dev/null && echo $os_version)" + version="$(source $VERSION_FILE 2>/dev/null && echo $OS_VERSION)" + sys_version="$(source $SYS_VERSION_FILE 2>/dev/null && echo $OS_VERSION)" versions=$(ls -1 $POST_UPGRADE_DIR | cut -d '.' -f 1) for v in $versions; do diff --git a/board/common/overlay/etc/init.d/S30dbus b/board/common/overlay/etc/init.d/S30dbus index 92fad2e731..c6391f624d 100755 --- a/board/common/overlay/etc/init.d/S30dbus +++ b/board/common/overlay/etc/init.d/S30dbus @@ -10,7 +10,7 @@ test -f $BTCONF || test -f $BOOT_BTCONF || test -f $SYS_BTCONF || exit 0 test -x /usr/bin/dbus-daemon || exit 0 -test -n "$os_version" || source /etc/init.d/base +test -n "$OS_VERSION" || source /etc/init.d/base start() { mkdir -p /tmp/dbus diff --git a/board/common/overlay/etc/init.d/S33hostapd b/board/common/overlay/etc/init.d/S33hostapd index d55dc040ae..7704e31ecc 100755 --- a/board/common/overlay/etc/init.d/S33hostapd +++ b/board/common/overlay/etc/init.d/S33hostapd @@ -13,7 +13,7 @@ link_watch=yes link_watch_timeout=20 -test -n "$os_version" || source /etc/init.d/base +test -n "$OS_VERSION" || source /etc/init.d/base prepare_conf $CONF $SYS_CONF $BOOT_CONF test -f $CONF || exit 0 diff --git a/board/common/overlay/etc/init.d/S35wifi b/board/common/overlay/etc/init.d/S35wifi index c89466b6ac..8dd54f2725 100755 --- a/board/common/overlay/etc/init.d/S35wifi +++ b/board/common/overlay/etc/init.d/S35wifi @@ -13,7 +13,7 @@ BOOT_WATCH_CONF="/boot/watch.conf" WATCH_CONF="/data/etc/watch.conf" -test -n "$os_version" || source /etc/init.d/base +test -n "$OS_VERSION" || source /etc/init.d/base prepare_conf $WATCH_CONF $SYS_WATCH_CONF $BOOT_WATCH_CONF source $WATCH_CONF @@ -25,11 +25,11 @@ ssid=$(cat $CONF | grep ssid | grep -v scan_ssid | cut -d '"' -f 2) test -n "$ssid" || exit 0 -test "$os_networkless" == "true" && exit 0 +test "$OS_NETWORKLESS" == "true" && exit 0 connected() { - ip link show dev $os_wlan 2>&1 | grep LOWER_UP &> /dev/null && return 0 || return 1 + ip link show dev $OS_WLAN 2>&1 | grep LOWER_UP &> /dev/null && return 0 || return 1 } watch() { @@ -51,13 +51,13 @@ watch() { } start() { - test -n "$os_country" && iw reg set $os_country + test -n "$OS_COUNTRY" && iw reg set $OS_COUNTRY msg_begin "Starting wpa_supplicant" # wait up to 5 seconds for interface count=0 - while ! ifconfig $os_wlan >/dev/null 2>&1; do + while ! ifconfig $OS_WLAN >/dev/null 2>&1; do sleep 1 count=$(($count + 1)) if [[ $count -ge 5 ]]; then @@ -66,11 +66,11 @@ start() { fi done - module=$(basename $(readlink /sys/class/net/$os_wlan/device/driver/module 2>/dev/null) 2>/dev/null) + module=$(basename $(readlink /sys/class/net/$OS_WLAN/device/driver/module 2>/dev/null) 2>/dev/null) - iwconfig $os_wlan power off &> /dev/null - iw $os_wlan set power_save off &> /dev/null - $PROG -i$os_wlan -c$CONF -D$DRIVER -B &> $LOG + iwconfig $OS_WLAN power off &> /dev/null + iw $OS_WLAN set power_save off &> /dev/null + $PROG -i$OS_WLAN -c$CONF -D$DRIVER -B &> $LOG count=0 while true; do sleep 1 diff --git a/board/common/overlay/etc/init.d/S36ppp b/board/common/overlay/etc/init.d/S36ppp index 03e21ee5ba..76a0484993 100755 --- a/board/common/overlay/etc/init.d/S36ppp +++ b/board/common/overlay/etc/init.d/S36ppp @@ -10,7 +10,7 @@ PROVIDER="mobile" WATCH_CONF="/data/etc/watch.conf" -test -n "$os_version" || source /etc/init.d/base +test -n "$OS_VERSION" || source /etc/init.d/base prepare_conf $CONF $SYS_CONF $BOOT_CONF @@ -19,11 +19,11 @@ test -e $CONF/apn || exit 0 source $WATCH_CONF -test "$os_networkless" == "true" && exit 0 +test "$OS_NETWORKLESS" == "true" && exit 0 connected() { - ifconfig | grep $os_ppp &>/dev/null && return 0 || return 1 + ifconfig | grep $OS_PPP &>/dev/null && return 0 || return 1 } watch() { diff --git a/board/common/overlay/etc/init.d/S37bluetooth b/board/common/overlay/etc/init.d/S37bluetooth index 13b61893be..7b1a1b56d9 100755 --- a/board/common/overlay/etc/init.d/S37bluetooth +++ b/board/common/overlay/etc/init.d/S37bluetooth @@ -5,7 +5,7 @@ BOOT_CONF="/boot/bluetooth.conf" CONF="/data/etc/bluetooth.conf" -test -n "$os_version" || source /etc/init.d/base +test -n "$OS_VERSION" || source /etc/init.d/base prepare_conf $CONF $SYS_CONF $BOOT_CONF test -f $CONF || exit 0 diff --git a/board/common/overlay/etc/init.d/S40network b/board/common/overlay/etc/init.d/S40network index df8d2b932d..060662bd86 100755 --- a/board/common/overlay/etc/init.d/S40network +++ b/board/common/overlay/etc/init.d/S40network @@ -9,7 +9,7 @@ WATCH_CONF="/data/etc/watch.conf" LINK_NEGO_TIMEOUT=10 -test -n "$os_version" || source /etc/init.d/base +test -n "$OS_VERSION" || source /etc/init.d/base source $WATCH_CONF @@ -23,7 +23,7 @@ watch_eth() { count=0 while true; do sleep 5 - if [[ "$(cat /sys/class/net/$os_eth/operstate 2>/dev/null)" == "up" ]]; then + if [[ "$(cat /sys/class/net/$OS_ETH/operstate 2>/dev/null)" == "up" ]]; then count=0 else if [[ $count -lt $link_watch_timeout ]]; then @@ -62,31 +62,31 @@ start_lo() { start_wlan() { msg_begin "Configuring wireless network" - if ! ifconfig $os_wlan &>/dev/null; then + if ! ifconfig $OS_WLAN &>/dev/null; then msg_fail "no device" return 1 fi - if [[ "$(cat /sys/class/net/$os_wlan/carrier 2>/dev/null)" != "1" ]]; then + if [[ "$(cat /sys/class/net/$OS_WLAN/carrier 2>/dev/null)" != "1" ]]; then msg_fail "no link" return 1 fi if [[ -n "$mtu" ]]; then - ip link set mtu $mtu dev $os_wlan + ip link set mtu $mtu dev $OS_WLAN fi if [[ -n "$static_ip" ]]; then msg_done $static_ip - ifconfig $os_wlan $static_ip up + ifconfig $OS_WLAN $static_ip up static_ip="" # won't be used again else msg_done dhcp - dhclient -cf "$DH_CONF" $os_wlan + dhclient -cf "$DH_CONF" $OS_WLAN fi - if [[ "$ip_watch" == "true" ]] && ip addr show dev $os_wlan | grep inet &>/dev/null; then - watch_ip $os_wlan & + if [[ "$ip_watch" == "true" ]] && ip addr show dev $OS_WLAN | grep inet &>/dev/null; then + watch_ip $OS_WLAN & fi } @@ -96,7 +96,7 @@ start_eth() { # wait for driver w=3 count=0 - while ! ifconfig $os_eth >/dev/null 2>&1; do + while ! ifconfig $OS_ETH >/dev/null 2>&1; do sleep 1 count=$(($count + 1)) if [[ $count -ge $w ]]; then @@ -106,12 +106,12 @@ start_eth() { done # bring it up - ifconfig $os_eth up + ifconfig $OS_ETH up # wait for operstate w=3 count=0 - while [[ "$(cat /sys/class/net/$os_eth/operstate 2>&1)" == "unknown" ]]; do + while [[ "$(cat /sys/class/net/$OS_ETH/operstate 2>&1)" == "unknown" ]]; do sleep 1 count=$(($count + 1)) if [[ $count -ge $w ]]; then @@ -123,7 +123,7 @@ start_eth() { # wait for link test "$link_watch" == "true" || LINK_NEGO_TIMEOUT=5 count=0 - while [[ "$(cat /sys/class/net/$os_eth/carrier 2>&1)" != "1" ]]; do + while [[ "$(cat /sys/class/net/$OS_ETH/carrier 2>&1)" != "1" ]]; do sleep 1 count=$(($count + 1)) if [[ $count -ge $LINK_NEGO_TIMEOUT ]]; then @@ -133,24 +133,24 @@ start_eth() { done if [[ -n "$mtu" ]]; then - ip link set mtu $mtu dev $os_eth + ip link set mtu $mtu dev $OS_ETH fi if [[ -n "$static_ip" ]]; then msg_done $static_ip - ifconfig $os_eth $static_ip up + ifconfig $OS_ETH $static_ip up static_ip="" # won't be used again else msg_done dhcp - dhclient -cf "$DH_CONF" $os_eth + dhclient -cf "$DH_CONF" $OS_ETH fi if [[ "$link_watch" == "true" ]]; then watch_eth & fi - if [[ "$ip_watch" == "true" ]] && ip addr show dev $os_eth | grep inet &>/dev/null; then - watch_ip $os_eth & + if [[ "$ip_watch" == "true" ]] && ip addr show dev $OS_ETH | grep inet &>/dev/null; then + watch_ip $OS_ETH & fi } @@ -160,12 +160,12 @@ start() { start_lo - test "$os_networkless" == "true" && return 0 + test "$OS_NETWORKLESS" == "true" && return 0 ssid=$(cat /data/etc/wpa_supplicant.conf 2>&1 | grep ssid | grep -v scan_ssid | cut -d '"' -f 2) test -n "$ssid" && start_wlan && wlan_ok="ok" - test -r /data/etc/ppp/modem && ifconfig | grep $os_ppp &>/dev/null && ppp_ok="ok" + test -r /data/etc/ppp/modem && ifconfig | grep $OS_PPP &>/dev/null && ppp_ok="ok" # if wifi or ppp link ok, start eth in background if [[ "$wlan_ok" == "ok" ]] || [[ "$ppp_ok" == "ok" ]]; then diff --git a/board/common/overlay/etc/init.d/S41netwatch b/board/common/overlay/etc/init.d/S41netwatch index f7cbbeb4b0..ef2d743d97 100755 --- a/board/common/overlay/etc/init.d/S41netwatch +++ b/board/common/overlay/etc/init.d/S41netwatch @@ -12,9 +12,9 @@ if [[ -z "$netwatch_host" || -z "$netwatch_port" ]]; then exit 0 fi -test -n "$os_version" || source /etc/init.d/base +test -n "$OS_VERSION" || source /etc/init.d/base -test "$os_networkless" == "true" && exit 0 +test "$OS_NETWORKLESS" == "true" && exit 0 watch() { diff --git a/board/common/overlay/etc/init.d/S43firewall b/board/common/overlay/etc/init.d/S43firewall index 0557ce5813..cdd700d9ad 100755 --- a/board/common/overlay/etc/init.d/S43firewall +++ b/board/common/overlay/etc/init.d/S43firewall @@ -5,7 +5,7 @@ BOOT_CONF="/boot/firewall.sh" CONF="/data/etc/firewall.sh" -test -n "$os_version" || source /etc/init.d/base +test -n "$OS_VERSION" || source /etc/init.d/base prepare_conf $CONF $SYS_CONF $BOOT_CONF test -f $CONF || exit 0 diff --git a/board/common/overlay/etc/init.d/S45dnsmasq b/board/common/overlay/etc/init.d/S45dnsmasq index 9d1f0326d5..419964cd49 100755 --- a/board/common/overlay/etc/init.d/S45dnsmasq +++ b/board/common/overlay/etc/init.d/S45dnsmasq @@ -8,7 +8,7 @@ LOG="/var/log/dnsmasq.log" PROG="/usr/sbin/dnsmasq" -test -n "$os_version" || source /etc/init.d/base +test -n "$OS_VERSION" || source /etc/init.d/base prepare_conf $CONF $SYS_CONF $BOOT_CONF test -f $CONF || exit 0 diff --git a/board/common/overlay/etc/init.d/S50date b/board/common/overlay/etc/init.d/S50date index 5393314d1b..941e741f4d 100755 --- a/board/common/overlay/etc/init.d/S50date +++ b/board/common/overlay/etc/init.d/S50date @@ -12,14 +12,14 @@ BOOT_NTP_CONF="/boot/ntp.conf" NTP_CONF="/data/etc/ntp.conf" -test -n "$os_version" || source /etc/init.d/base +test -n "$OS_VERSION" || source /etc/init.d/base prepare_conf $CONF $SYS_CONF $BOOT_CONF prepare_conf $NTP_CONF $SYS_NTP_CONF $BOOT_NTP_CONF test -f $CONF || exit 0 -test "$os_networkless" == "true" && exit 0 +test "$OS_NETWORKLESS" == "true" && exit 0 date_timeout=10 date_method=http diff --git a/board/common/overlay/etc/init.d/S51crond b/board/common/overlay/etc/init.d/S51crond index 5e464afc3f..b825a52453 100755 --- a/board/common/overlay/etc/init.d/S51crond +++ b/board/common/overlay/etc/init.d/S51crond @@ -3,7 +3,7 @@ SYS_CONF="/etc/crontabs" CONF="/data/etc/crontabs" -test -n "$os_version" || source /etc/init.d/base +test -n "$OS_VERSION" || source /etc/init.d/base start() { msg_begin "Starting crond" diff --git a/board/common/overlay/etc/init.d/S60sshd b/board/common/overlay/etc/init.d/S60sshd index 7acc266486..04db9febcd 100755 --- a/board/common/overlay/etc/init.d/S60sshd +++ b/board/common/overlay/etc/init.d/S60sshd @@ -4,9 +4,9 @@ CONF="/etc/sshd_config" test -f $CONF || exit 0 -test -n "$os_version" || source /etc/init.d/base +test -n "$OS_VERSION" || source /etc/init.d/base -test "$os_networkless" == "true" && exit 0 +test "$OS_NETWORKLESS" == "true" && exit 0 start() { msg_begin "Starting sshd" diff --git a/board/common/overlay/etc/init.d/S98userinit b/board/common/overlay/etc/init.d/S98userinit index 6dfcf08902..1b3f861e50 100755 --- a/board/common/overlay/etc/init.d/S98userinit +++ b/board/common/overlay/etc/init.d/S98userinit @@ -5,7 +5,7 @@ USERINIT="/data/etc/userinit.sh" test -f $USERINIT || exit 0 -test -n "$os_version" || source /etc/init.d/base +test -n "$OS_VERSION" || source /etc/init.d/base case "$1" in start) diff --git a/board/common/overlay/etc/init.d/S99showinfo b/board/common/overlay/etc/init.d/S99showinfo index fac00a387d..65862148da 100755 --- a/board/common/overlay/etc/init.d/S99showinfo +++ b/board/common/overlay/etc/init.d/S99showinfo @@ -1,6 +1,6 @@ #!/bin/bash -test -n "$os_version" || source /etc/init.d/base +test -n "$OS_VERSION" || source /etc/init.d/base msg_info() { echo " # $1" @@ -24,9 +24,9 @@ show_dns() { case "$1" in start) - show_iface_ip_addr $os_eth - show_iface_ip_addr $os_wlan - show_iface_ip_addr $os_ppp + show_iface_ip_addr $OS_ETH + show_iface_ip_addr $OS_WLAN + show_iface_ip_addr $OS_PPP show_gateway show_dns ;; diff --git a/board/common/overlay/etc/init.d/base b/board/common/overlay/etc/init.d/base index 852ca513a4..1d262a6e7c 100644 --- a/board/common/overlay/etc/init.d/base +++ b/board/common/overlay/etc/init.d/base @@ -1,9 +1,9 @@ source /etc/version -board_sn=$(/etc/init.d/boardsn) -board_name=$(cat /etc/board) +BOARD_SN=$(/etc/init.d/boardsn) +BOARD_NAME=$(cat /etc/board) -test -n "$os_debug" || source /etc/init.d/os_conf +test -n "$OS_DEBUG" || source /etc/init.d/os_conf source /etc/init.d/panic diff --git a/board/common/overlay/etc/init.d/rcK b/board/common/overlay/etc/init.d/rcK index 7d08910c5b..e56f000d5d 100755 --- a/board/common/overlay/etc/init.d/rcK +++ b/board/common/overlay/etc/init.d/rcK @@ -5,7 +5,7 @@ pid_file=/tmp/rc.pid source /etc/init.d/base -echo "---- shutting down $os_name $os_version ----" >> $boot_log +echo "---- shutting down $OS_NAME $OS_VERSION ----" >> $boot_log # stop all init scripts in /etc/init.d, # executing them in reverse numerical order. diff --git a/board/common/overlay/etc/init.d/rcS b/board/common/overlay/etc/init.d/rcS index d15157610f..f4b0dab1b6 100755 --- a/board/common/overlay/etc/init.d/rcS +++ b/board/common/overlay/etc/init.d/rcS @@ -6,7 +6,7 @@ pid_file=/tmp/rc.pid source /etc/init.d/base -echo "---- booting $os_name $os_version ----" >> $tmp_boot_log +echo "---- booting $OS_NAME $OS_VERSION ----" >> $tmp_boot_log # start all init scripts in /etc/init.d, # executing them in numerical order. diff --git a/board/common/overlay/etc/os.conf b/board/common/overlay/etc/os.conf index 96fff5eb4a..d9b0361c35 100644 --- a/board/common/overlay/etc/os.conf +++ b/board/common/overlay/etc/os.conf @@ -1,12 +1,13 @@ -os_debug="false" -os_prereleases="false" -os_tty_login="tty1" -os_eth="eth0" -os_wlan="wlan0" -os_ppp="ppp0" -os_networkless="false" -os_country="GB" -os_firmware_method="github" -os_firmware_repo="ccrisan/thingos" -os_firmware_username="" -os_firmware_password="" +OS_DEBUG="false" +OS_PRERELEASES="false" +OS_TTY_LOGIN="tty1" +OS_ETH="eth0" +OS_WLAN="wlan0" +OS_PPP="ppp0" +OS_NETWORKLESS="false" +OS_COUNTRY="GB" +OS_FIRMWARE_METHOD="github" +OS_FIRMWARE_REPO="ccrisan/thingos" +OS_FIRMWARE_USERNAME="" +OS_FIRMWARE_PASSWORD="" + diff --git a/board/common/overlay/etc/version b/board/common/overlay/etc/version index b42047004c..6921062dac 100644 --- a/board/common/overlay/etc/version +++ b/board/common/overlay/etc/version @@ -1,4 +1,4 @@ -os_name="thingOS" -os_short_name="thingos" -os_prefix="thing" -os_version="unknown" +OS_NAME="thingOS" +OS_SHORT_NAME="thingos" +OS_PREFIX="thing" +OS_VERSION="unknown" diff --git a/board/common/overlay/sbin/fwupdate b/board/common/overlay/sbin/fwupdate index 3dafd3b1db..a383615700 100755 --- a/board/common/overlay/sbin/fwupdate +++ b/board/common/overlay/sbin/fwupdate @@ -77,22 +77,22 @@ fi #### versions #### function show_versions() { - source /etc/init.d/os_conf # we need this for the os_ vars + source /etc/init.d/os_conf # we need this for the OS_ vars board=$(cat $SYS_BOARD_FILE) show_json=$1 # the /usr/libexec/list-versions-* helpers return a table with the following format: # |||| - versions=$(FW_USERNAME=$os_firmware_username FW_PASSWORD=$os_firmware_password \ - /usr/libexec/list-versions-$os_firmware_method $os_firmware_repo) + versions=$(FW_USERNAME=$OS_FIRMWARE_USERNAME FW_PASSWORD=$OS_FIRMWARE_PASSWORD \ + /usr/libexec/list-versions-$OS_FIRMWARE_METHOD $OS_FIRMWARE_REPO) for version in ${versions[@]}; do OIFS=$IFS IFS="|" varr=($version) IFS=$OIFS - if [ "$os_prereleases" == "false" ] && [ "${varr[1]}" == "true" ]; then + if [ "$OS_PRERELEASES" == "false" ] && [ "${varr[1]}" == "true" ]; then continue # skip prereleases fi if [ "$board" != "${varr[2]}" ]; then @@ -114,7 +114,7 @@ function show_versions() { function show_current() { source $SYS_VERSION_FILE - echo $os_version + echo $OS_VERSION } @@ -144,7 +144,7 @@ function do_download() { fi fi - source /etc/init.d/os_conf # we need this for the os_ vars + source /etc/init.d/os_conf # we need this for the OS_ vars board=$(cat $SYS_BOARD_FILE) url=$1 @@ -176,8 +176,8 @@ function do_download() { echo $version > $FW_DIR/$VER_FILE curl_opts="-S -f -L" - if [ -n "$os_firmware_username" ]; then - curl_opts+=" --user $os_firmware_username:$os_firmware_password" + if [ -n "$OS_FIRMWARE_USERNAME" ]; then + curl_opts+=" --user $OS_FIRMWARE_USERNAME:$OS_FIRMWARE_PASSWORD" fi curl $curl_opts -o $outfile "$url" &> $FW_DIR/$CURL_LOG_FILE & diff --git a/board/nanopineo/os.conf b/board/nanopineo/os.conf index dc77b07e6d..bbfeece44c 100644 --- a/board/nanopineo/os.conf +++ b/board/nanopineo/os.conf @@ -1,2 +1,2 @@ -os_tty_login="ttyS0" +OS_TTY_LOGIN="ttyS0" diff --git a/board/nanopineo2/os.conf b/board/nanopineo2/os.conf index dc77b07e6d..bbfeece44c 100644 --- a/board/nanopineo2/os.conf +++ b/board/nanopineo2/os.conf @@ -1,2 +1,2 @@ -os_tty_login="ttyS0" +OS_TTY_LOGIN="ttyS0" diff --git a/board/odroidc1/os.conf b/board/odroidc1/os.conf index dc77b07e6d..bbfeece44c 100644 --- a/board/odroidc1/os.conf +++ b/board/odroidc1/os.conf @@ -1,2 +1,2 @@ -os_tty_login="ttyS0" +OS_TTY_LOGIN="ttyS0" diff --git a/board/odroidc2/os.conf b/board/odroidc2/os.conf index dc77b07e6d..bbfeece44c 100644 --- a/board/odroidc2/os.conf +++ b/board/odroidc2/os.conf @@ -1,2 +1,2 @@ -os_tty_login="ttyS0" +OS_TTY_LOGIN="ttyS0" diff --git a/board/odroidxu4/overlay/etc/init.d/S02waiteth b/board/odroidxu4/overlay/etc/init.d/S02waiteth index 6873243889..4b891c7d71 100755 --- a/board/odroidxu4/overlay/etc/init.d/S02waiteth +++ b/board/odroidxu4/overlay/etc/init.d/S02waiteth @@ -1,6 +1,6 @@ #!/bin/bash -test -n "$os_version" || source /etc/init.d/base +test -n "$OS_VERSION" || source /etc/init.d/base case "$1" in start) diff --git a/board/raspberrypi/overlay/etc/init.d/S05cpufreq b/board/raspberrypi/overlay/etc/init.d/S05cpufreq index 6a9ff9ce85..0644c34e22 100755 --- a/board/raspberrypi/overlay/etc/init.d/S05cpufreq +++ b/board/raspberrypi/overlay/etc/init.d/S05cpufreq @@ -5,7 +5,7 @@ CPUFREQDIR="/sys/devices/system/cpu/cpu0/cpufreq" GOVDIR="/sys/devices/system/cpu/cpufreq/$GOV" -test -n "$os_version" || source /etc/init.d/base +test -n "$OS_VERSION" || source /etc/init.d/base configure() { echo $GOV > $CPUFREQDIR/scaling_governor diff --git a/board/raspberrypi/overlay/etc/init.d/S11throttlewatch b/board/raspberrypi/overlay/etc/init.d/S11throttlewatch index 116c3f30fc..b8ea3272f3 100755 --- a/board/raspberrypi/overlay/etc/init.d/S11throttlewatch +++ b/board/raspberrypi/overlay/etc/init.d/S11throttlewatch @@ -3,7 +3,7 @@ CHECK_INTERVAL=30 -test -n "$os_version" || source /etc/init.d/base +test -n "$OS_VERSION" || source /etc/init.d/base get_throttled_now() { t=$(vcgencmd get_throttled | cut -d '=' -f 2) diff --git a/board/raspberrypi/overlay/etc/init.d/S13btuart b/board/raspberrypi/overlay/etc/init.d/S13btuart index 27a92d3e3f..c874c8b9ef 100755 --- a/board/raspberrypi/overlay/etc/init.d/S13btuart +++ b/board/raspberrypi/overlay/etc/init.d/S13btuart @@ -9,7 +9,7 @@ test -f $CONF || test -f $BOOT_CONF || test -f $SYS_CONF || exit 0 test -d "/proc/device-tree/soc/gpio@7e200000/uart0_pins" || exit 0 # no rpi bluetooth detected -test -n "$os_version" || source /etc/init.d/base +test -n "$OS_VERSION" || source /etc/init.d/base function start() { if [[ "$(cat /proc/device-tree/aliases/uart0)" = "$(cat /proc/device-tree/aliases/serial1)" ]] ; then diff --git a/board/raspberrypi2/overlay/etc/init.d/S05cpufreq b/board/raspberrypi2/overlay/etc/init.d/S05cpufreq index 6a9ff9ce85..0644c34e22 100755 --- a/board/raspberrypi2/overlay/etc/init.d/S05cpufreq +++ b/board/raspberrypi2/overlay/etc/init.d/S05cpufreq @@ -5,7 +5,7 @@ CPUFREQDIR="/sys/devices/system/cpu/cpu0/cpufreq" GOVDIR="/sys/devices/system/cpu/cpufreq/$GOV" -test -n "$os_version" || source /etc/init.d/base +test -n "$OS_VERSION" || source /etc/init.d/base configure() { echo $GOV > $CPUFREQDIR/scaling_governor diff --git a/board/raspberrypi2/overlay/etc/init.d/S11throttlewatch b/board/raspberrypi2/overlay/etc/init.d/S11throttlewatch index 116c3f30fc..b8ea3272f3 100755 --- a/board/raspberrypi2/overlay/etc/init.d/S11throttlewatch +++ b/board/raspberrypi2/overlay/etc/init.d/S11throttlewatch @@ -3,7 +3,7 @@ CHECK_INTERVAL=30 -test -n "$os_version" || source /etc/init.d/base +test -n "$OS_VERSION" || source /etc/init.d/base get_throttled_now() { t=$(vcgencmd get_throttled | cut -d '=' -f 2) diff --git a/board/raspberrypi3/overlay/etc/init.d/S05cpufreq b/board/raspberrypi3/overlay/etc/init.d/S05cpufreq index 6a9ff9ce85..0644c34e22 100755 --- a/board/raspberrypi3/overlay/etc/init.d/S05cpufreq +++ b/board/raspberrypi3/overlay/etc/init.d/S05cpufreq @@ -5,7 +5,7 @@ CPUFREQDIR="/sys/devices/system/cpu/cpu0/cpufreq" GOVDIR="/sys/devices/system/cpu/cpufreq/$GOV" -test -n "$os_version" || source /etc/init.d/base +test -n "$OS_VERSION" || source /etc/init.d/base configure() { echo $GOV > $CPUFREQDIR/scaling_governor diff --git a/board/raspberrypi3/overlay/etc/init.d/S11throttlewatch b/board/raspberrypi3/overlay/etc/init.d/S11throttlewatch index 116c3f30fc..b8ea3272f3 100755 --- a/board/raspberrypi3/overlay/etc/init.d/S11throttlewatch +++ b/board/raspberrypi3/overlay/etc/init.d/S11throttlewatch @@ -3,7 +3,7 @@ CHECK_INTERVAL=30 -test -n "$os_version" || source /etc/init.d/base +test -n "$OS_VERSION" || source /etc/init.d/base get_throttled_now() { t=$(vcgencmd get_throttled | cut -d '=' -f 2) diff --git a/board/raspberrypi3/overlay/etc/init.d/S13btuart b/board/raspberrypi3/overlay/etc/init.d/S13btuart index 27a92d3e3f..c874c8b9ef 100755 --- a/board/raspberrypi3/overlay/etc/init.d/S13btuart +++ b/board/raspberrypi3/overlay/etc/init.d/S13btuart @@ -9,7 +9,7 @@ test -f $CONF || test -f $BOOT_CONF || test -f $SYS_CONF || exit 0 test -d "/proc/device-tree/soc/gpio@7e200000/uart0_pins" || exit 0 # no rpi bluetooth detected -test -n "$os_version" || source /etc/init.d/base +test -n "$OS_VERSION" || source /etc/init.d/base function start() { if [[ "$(cat /proc/device-tree/aliases/uart0)" = "$(cat /proc/device-tree/aliases/serial1)" ]] ; then