diff --git a/board/common/busybox.config b/board/common/busybox.config index c93a93c1ac..1a3a02eda5 100644 --- a/board/common/busybox.config +++ b/board/common/busybox.config @@ -1,7 +1,7 @@ # # Automatically generated make config: don't edit # Busybox version: 1.29.2 -# Wed Nov 14 23:22:52 2018 +# Fri Jan 25 20:24:12 2019 # CONFIG_HAVE_DOT_CONFIG=y @@ -525,7 +525,7 @@ CONFIG_FEATURE_NOLOGIN=y CONFIG_FEATURE_SECURETTY=y CONFIG_PASSWD=y # CONFIG_FEATURE_PASSWD_WEAK_CHECK is not set -# CONFIG_SU is not set +CONFIG_SU=y # CONFIG_FEATURE_SU_SYSLOG is not set # CONFIG_FEATURE_SU_CHECKS_SHELLS is not set # CONFIG_FEATURE_SU_BLANK_PW_NEEDS_SECURE_TTY is not set diff --git a/board/common/cleanups.sh b/board/common/cleanups.sh index d550a64522..6beafd3070 100755 --- a/board/common/cleanups.sh +++ b/board/common/cleanups.sh @@ -170,10 +170,17 @@ rm -f ${TARGET}/usr/bin/wbinfo rm -f ${TARGET}/usr/sbin/winbindd rm -rf ${TARGET}/usr/share/ctdb -# useless mongodb binaries +# unused mongodb binaries rm -f ${TARGET}/usr/bin/mongos rm -f ${TARGET}/usr/bin/mongoperf +# unused redis binaries +rm -f $TARGET/usr/bin/redis-check-aof +rm -f $TARGET/usr/bin/redis-check-rdb +rm -f $TARGET/usr/bin/redis-benchmark +rm -f $TARGET/usr/bin/redis-cli +rm -f $TARGET/usr/bin/redis-sentinel + # v4l-utils rm -f ${TARGET}/usr/bin/cec-compliance rm -f ${TARGET}/usr/bin/cec-ctl @@ -201,6 +208,8 @@ rm -f ${TARGET}/etc/init.d/S20urandom rm -f ${TARGET}/etc/init.d/S49ntp rm -f ${TARGET}/etc/init.d/S50sshd rm -f ${TARGET}/etc/init.d/S50proftpd +rm -f ${TARGET}/etc/init.d/S50postgresql +rm -f ${TARGET}/etc/init.d/S50redis rm -f ${TARGET}/etc/init.d/S80dhcp-relay rm -f ${TARGET}/etc/init.d/S80dhcp-server rm -f ${TARGET}/etc/init.d/S80dnsmasq diff --git a/board/common/overlay/etc/init.d/S04syslog b/board/common/overlay/etc/init.d/S04syslog index facaeedb98..78586fadf3 100755 --- a/board/common/overlay/etc/init.d/S04syslog +++ b/board/common/overlay/etc/init.d/S04syslog @@ -1,24 +1,28 @@ #!/bin/bash -test -n "${OS_VERSION}" || source /etc/init.d/base +PROG="/sbin/syslogd" +PROG_D="/bin/dmesg" DMESG_LOG="/var/log/dmesg.log" +test -n "${OS_VERSION}" || source /etc/init.d/base + + case "$1" in start) msg_begin "Starting syslogd" - syslogd + ${PROG} test $? == 0 && msg_done || msg_fail echo "---- booting ${OS_NAME} ${OS_VERSION} ----" >> ${DMESG_LOG} - dmesg -T -w >> ${DMESG_LOG} & + ${PROG_D} -T -w >> ${DMESG_LOG} & ;; stop) msg_begin "Stopping syslogd" - killall syslogd &>/dev/null + killall -q $(basename ${PROG}) test $? == 0 && msg_done || msg_fail - killall dmesg &>/dev/null + killall -q $(basename ${PROG_D}) ;; *) diff --git a/board/common/overlay/etc/init.d/S12udev b/board/common/overlay/etc/init.d/S12udev index 3228aefc17..fecf68e5cc 100755 --- a/board/common/overlay/etc/init.d/S12udev +++ b/board/common/overlay/etc/init.d/S12udev @@ -1,31 +1,35 @@ #!/bin/bash -CONF=/etc/udev/udev.conf +CONF="/etc/udev/udev.conf" +PROG="/sbin/udevd" +PROG_UA="/sbin/udevadm" +test -f ${PROG} || exit 0 test -f ${CONF} || exit 0 test -n "${OS_VERSION}" || source /etc/init.d/base source ${CONF} + start() { msg_begin "Starting eudev" echo '\000\000\000\000' > /proc/sys/kernel/hotplug - /sbin/udevd --daemon --resolve-names=never + ${PROG} --daemon --resolve-names=never test $? == 0 && msg_done || msg_fail - /sbin/udevadm trigger --type=subsystems --action=add - /sbin/udevadm trigger --type=devices --action=add - /sbin/udevadm settle --timeout=30 + ${PROG_UA} trigger --type=subsystems --action=add + ${PROG_UA} trigger --type=devices --action=add + ${PROG_UA} settle --timeout=30 return 0 } stop() { msg_begin "Stopping eudev" - udevadm control --stop-exec-queue - killall udevd &>/dev/null + ${PROG_UA} control --stop-exec-queue + killall -q $(basename ${PROG}) test $? == 0 && msg_done || msg_fail } diff --git a/board/common/overlay/etc/init.d/S13watchdog b/board/common/overlay/etc/init.d/S13watchdog index 331bdcfc66..4b5e686b6f 100755 --- a/board/common/overlay/etc/init.d/S13watchdog +++ b/board/common/overlay/etc/init.d/S13watchdog @@ -1,13 +1,20 @@ #!/bin/bash -test -c /dev/watchdog || exit 0 +DEV="/dev/watchdog" + +PROG="/sbin/watchdog" + + +test -c ${PROG} || exit 0 +test -c ${DEV} || exit 0 test -n "${OS_VERSION}" || source /etc/init.d/base + case "$1" in start) msg_begin "Starting watchdog" - watchdog -t 5 /dev/watchdog + ${PROG} -t 5 ${DEV} test $? == 0 && msg_done || msg_fail ;; @@ -17,7 +24,7 @@ case "$1" in reallystop) msg_begin "Stopping watchdog" - killall watchdog &>/dev/null + killall -q $(basename ${PROG}) test $? == 0 && msg_done || msg_fail ;; diff --git a/board/common/overlay/etc/init.d/S30dbus b/board/common/overlay/etc/init.d/S30dbus index 5f9bc53f4e..c239b80654 100755 --- a/board/common/overlay/etc/init.d/S30dbus +++ b/board/common/overlay/etc/init.d/S30dbus @@ -4,30 +4,35 @@ SYS_BTCONF="/etc/bluetooth.conf" BOOT_BTCONF="/boot/bluetooth.conf" BTCONF="/data/etc/bluetooth.conf" +PROG="/usr/bin/dbus-daemon" +PROG_UG="/usr/bin/dbus-uuidgen" +PROG_UA="/usr/bin/udevadm" + + +test -x ${PROG} || exit 0 # dbus is currently only used by bluez 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 + start() { mkdir -p /tmp/dbus mkdir -p /var/lib/dbus msg_begin "Starting dbus" - dbus-uuidgen --ensure - dbus-daemon --system + ${PROG_UG} --ensure + ${PROG} --system test $? == 0 && msg_done || msg_fail } stop() { msg_begin "Stopping dbus" - udevadm control --stop-exec-queue - killall dbus-daemon &>/dev/null + ${PROG_UA} control --stop-exec-queue + killall -q $(basename ${PROG}) test $? == 0 && msg_done || msg_fail rm -f /var/run/messagebus.pid diff --git a/board/common/overlay/etc/init.d/S33hostapd b/board/common/overlay/etc/init.d/S33hostapd index d25ffae608..e864dd0ff1 100755 --- a/board/common/overlay/etc/init.d/S33hostapd +++ b/board/common/overlay/etc/init.d/S33hostapd @@ -9,10 +9,12 @@ PROG="/usr/sbin/hostapd" WATCH_CONF="/data/etc/watch.conf" -link_watch=yes -link_watch_timeout=20 +LINK_WATCH=yes +LINK_WATCH_TIMEOUT=20 +test -x ${PROG} || exit 0 + test -n "${OS_VERSION}" || source /etc/init.d/base prepare_conf ${CONF} ${SYS_CONF} ${BOOT_CONF} diff --git a/board/common/overlay/etc/init.d/S35wifi b/board/common/overlay/etc/init.d/S35wifi index 93294aad89..d1b6a3901c 100755 --- a/board/common/overlay/etc/init.d/S35wifi +++ b/board/common/overlay/etc/init.d/S35wifi @@ -13,6 +13,8 @@ BOOT_WATCH_CONF="/boot/watch.conf" WATCH_CONF="/data/etc/watch.conf" +test -x ${PROG} || exit 0 + test -n "${OS_VERSION}" || source /etc/init.d/base prepare_conf ${WATCH_CONF} ${SYS_WATCH_CONF} ${BOOT_WATCH_CONF} @@ -24,7 +26,6 @@ test -f ${CONF} || exit 0 ssid=$(cat ${CONF} | grep ssid | grep -v scan_ssid | cut -d '"' -f 2) test -n "${ssid}" || exit 0 - test "${OS_NETWORKLESS}" == "true" && exit 0 diff --git a/board/common/overlay/etc/init.d/S36ppp b/board/common/overlay/etc/init.d/S36ppp index 14dbe7cd6c..9186e6e926 100755 --- a/board/common/overlay/etc/init.d/S36ppp +++ b/board/common/overlay/etc/init.d/S36ppp @@ -10,6 +10,8 @@ PROVIDER="mobile" WATCH_CONF="/data/etc/watch.conf" +test -x ${PROG} || exit 0 + test -n "${OS_VERSION}" || source /etc/init.d/base prepare_conf ${CONF} ${SYS_CONF} ${BOOT_CONF} @@ -88,7 +90,7 @@ start() { break fi - if [[ ${count} -gt ${LINK_WATCH_TIMEOUT} ]] || ! pidof pppd > /dev/null; then + if [[ ${count} -gt ${LINK_WATCH_TIMEOUT} ]] || ! pidof $(basename ${PROG}) > /dev/null; then msg_fail return fi @@ -105,7 +107,7 @@ start() { stop() { msg_begin "Stopping pppd" - killall pppd &>/dev/null + killall -q $(basename ${PROG}) ps | grep ppp | grep -v $$ | grep -v grep | tr -s ' ' | sed -e 's/^\s//' | cut -d ' ' -f 1 | xargs -r kill msg_done } diff --git a/board/common/overlay/etc/init.d/S37bluetooth b/board/common/overlay/etc/init.d/S37bluetooth index 8d2fde898d..16cc5eab45 100755 --- a/board/common/overlay/etc/init.d/S37bluetooth +++ b/board/common/overlay/etc/init.d/S37bluetooth @@ -3,34 +3,35 @@ SYS_CONF="/etc/bluetooth.conf" BOOT_CONF="/boot/bluetooth.conf" CONF="/data/etc/bluetooth.conf" +RUN_CONF="/var/lib/bluetooth.conf" +ADAPTER="hci0" +PROG="/usr/libexec/bluetooth/bluetoothd" +PROG_HC="/usr/bin/hciconfig" +DATA_DIR="/var/lib/bluetooth" +RUN_DATA_DIR="/data/bluetooth" + + +test -x ${PROG} || exit 0 test -n "${OS_VERSION}" || source /etc/init.d/base prepare_conf ${CONF} ${SYS_CONF} ${BOOT_CONF} test -f ${CONF} || exit 0 -hci=hci0 -bluetoothd=/usr/libexec/bluetooth/bluetoothd -data_dir=/var/lib/bluetooth -run_data_dir=/data/bluetooth -run_conf=/var/lib/bluetooth.conf - -test -x ${bluetoothd} || exit 0 - configure() { - mkdir -p ${run_data_dir} - ln -sf ${run_data_dir} ${data_dir} - cp ${CONF} ${run_conf} + mkdir -p ${RUN_DATA_DIR} + ln -sf ${RUN_DATA_DIR} ${DATA_DIR} + cp ${CONF} ${RUN_CONF} # if no specific name configured, use hostname - if ! grep -E 'Name\s*=' ${run_conf} &>/dev/null; then - sed -ri "s/(\[General\])/\1\nName = $(hostname)/" ${run_conf} + if ! grep -E 'Name\s*=' ${RUN_CONF} &>/dev/null; then + sed -ri "s/(\[General\])/\1\nName = $(hostname)/" ${RUN_CONF} fi # bring adapter up - hciconfig ${hci} up + ${PROG_HC} ${ADAPTER} up } start() { @@ -38,7 +39,7 @@ start() { # wait up to 10 seconds for device count=0 - while ! hciconfig ${hci} &>/dev/null; do + while ! ${PROG_HC} ${ADAPTER} &>/dev/null; do sleep 1 count=$((${count} + 1)) if [[ ${count} -ge 10 ]]; then @@ -57,19 +58,19 @@ start() { fi msg_begin "Starting bluetoothd" - ${bluetoothd} &>/dev/null & + ${PROG} &>/dev/null & msg_done # if DiscoverableTimeout is set to 0, make adapter discoverable from boot time - if grep -E '^DiscoverableTimeout\s*=\s*0$' ${run_conf} &>/dev/null; then + if grep -E '^DiscoverableTimeout\s*=\s*0$' ${RUN_CONF} &>/dev/null; then sleep 1 - hciconfig ${hci} piscan + ${PROG_HC} ${ADAPTER} piscan fi } stop() { msg_begin "Stopping bluetoothd" - killall bluetoothd &>/dev/null + killall -q $(basename ${PROG}) test $? == 0 && msg_done || msg_fail } diff --git a/board/common/overlay/etc/init.d/S41netwatch b/board/common/overlay/etc/init.d/S41netwatch index cfab7e3c91..f452c0bab8 100755 --- a/board/common/overlay/etc/init.d/S41netwatch +++ b/board/common/overlay/etc/init.d/S41netwatch @@ -1,16 +1,18 @@ #!/bin/bash -WATCH_CONF="/data/etc/watch.conf" +CONF="/data/etc/watch.conf" NETWATCH_RETRIES=3 NETWATCH_TIMEOUT=5 NETWATCH_INTERVAL=20 -test -f ${WATCH_CONF} && source ${WATCH_CONF} || exit 0 +# watch configuration is already prepared by wifi init script -if [[ -z "${NETWATCH_HOST}" || -z "${NETWATCH_PORT}" ]]; then - exit 0 -fi +test -f ${CONF} || exit 0 +source ${CONF} + +test -n "${NETWATCH_HOST}" || exit 0 +test -n "${NETWATCH_PORT}" || exit 0 test -n "${OS_VERSION}" || source /etc/init.d/base diff --git a/board/common/overlay/etc/init.d/S43firewall b/board/common/overlay/etc/init.d/S43firewall index c588fd0d6d..bab1a54053 100755 --- a/board/common/overlay/etc/init.d/S43firewall +++ b/board/common/overlay/etc/init.d/S43firewall @@ -10,6 +10,7 @@ test -n "${OS_VERSION}" || source /etc/init.d/base prepare_conf ${CONF} ${SYS_CONF} ${BOOT_CONF} test -f ${CONF} || exit 0 + start() { msg_begin "Starting firewall" diff --git a/board/common/overlay/etc/init.d/S45dnsmasq b/board/common/overlay/etc/init.d/S45dnsmasq index df0d849cbe..f178f84a3f 100755 --- a/board/common/overlay/etc/init.d/S45dnsmasq +++ b/board/common/overlay/etc/init.d/S45dnsmasq @@ -8,6 +8,8 @@ LOG="/var/log/dnsmasq.log" PROG="/usr/sbin/dnsmasq" +test -x ${PROG} || exit 0 + test -n "${OS_VERSION}" || source /etc/init.d/base prepare_conf ${CONF} ${SYS_CONF} ${BOOT_CONF} @@ -29,7 +31,7 @@ start() { stop() { msg_begin "Stopping dnsmasq" - killall dnsmasq &>/dev/null + killall -q $(basename ${PROG}) test $? == 0 && msg_done || msg_fail } diff --git a/board/common/overlay/etc/init.d/S51crond b/board/common/overlay/etc/init.d/S51crond index 7485031ef7..9529ee31d8 100755 --- a/board/common/overlay/etc/init.d/S51crond +++ b/board/common/overlay/etc/init.d/S51crond @@ -3,24 +3,30 @@ SYS_CONF="/etc/crontabs" CONF="/data/etc/crontabs" +PROG="/usr/sbin/crond" + + +test -x ${PROG} || exit 0 + test -n "${OS_VERSION}" || source /etc/init.d/base + start() { msg_begin "Starting crond" if [[ -d ${SYS_CONF} ]]; then - /usr/sbin/crond -c ${SYS_CONF} + ${PROG} -c ${SYS_CONF} fi mkdir -p ${CONF} - /usr/sbin/crond -c ${CONF} + ${PROG} -c ${CONF} test $? == 0 && msg_done || msg_fail } stop() { msg_begin "Stopping crond" - killall crond &>/dev/null + killall -q $(basename ${PROG}) test $? == 0 && msg_done || msg_fail } diff --git a/board/common/overlay/etc/init.d/S60sshd b/board/common/overlay/etc/init.d/S60sshd index 3d7f7620c2..0c68a5446a 100755 --- a/board/common/overlay/etc/init.d/S60sshd +++ b/board/common/overlay/etc/init.d/S60sshd @@ -2,17 +2,24 @@ CONF="/etc/sshd_config" -test -f ${CONF} || exit 0 +PROG="/usr/sbin/sshd" +PROG_KG="/usr/bin/ssh-keygen" + + +test -x ${PROG} || exit 0 test -n "${OS_VERSION}" || source /etc/init.d/base +test -f ${CONF} || exit 0 + test "${OS_NETWORKLESS}" == "true" && exit 0 + start() { msg_begin "Starting sshd" # create any missing keys - if ! /usr/bin/ssh-keygen -A >/dev/null; then + if ! ${PROG_KG} -A >/dev/null; then msg_fail return 1 fi @@ -22,13 +29,13 @@ start() { echo "Welcome to ${hostname}!" > /var/cache/sshd_banner sync - /usr/sbin/sshd -f ${CONF} + ${PROG} -f ${CONF} test $? == 0 && msg_done || msg_fail } stop() { msg_begin "Stopping sshd" - killall sshd &>/dev/null + killall -q $(basename ${PROG}) test $? == 0 && msg_done || msg_fail } diff --git a/board/common/overlay/etc/init.d/S61proftpd b/board/common/overlay/etc/init.d/S61proftpd index 0e11309a4a..9835df2fc3 100755 --- a/board/common/overlay/etc/init.d/S61proftpd +++ b/board/common/overlay/etc/init.d/S61proftpd @@ -1,23 +1,30 @@ #!/bin/bash -test -f /etc/proftpd.conf || exit 0 +CONF="/etc/proftpd.conf" +PROG="/usr/sbin/proftpd" + + +test -x ${PROG} || exit 0 test -n "${OS_VERSION}" || source /etc/init.d/base test -n "${OS_DEBUG}" || source /etc/init.d/conf +test -f ${CONF} || exit 0 + test "${OS_NETWORKLESS}" == "true" && exit 0 + start() { msg_begin "Starting proftpd" mkdir -p /var/run/proftpd touch /var/log/wtmp - /usr/sbin/proftpd &>/dev/null + ${PROG} &>/dev/null test $? == 0 && msg_done || msg_fail } stop() { msg_begin "Stopping proftpd" - killall proftpd &>/dev/null + killall -q $(basename ${PROG}) test $? == 0 && msg_done || msg_fail } diff --git a/board/common/overlay/etc/init.d/S62smb b/board/common/overlay/etc/init.d/S62smb index 3da2f532a9..e203b5556c 100755 --- a/board/common/overlay/etc/init.d/S62smb +++ b/board/common/overlay/etc/init.d/S62smb @@ -1,32 +1,41 @@ #!/bin/bash -test -f /etc/samba/smb.conf || exit 0 +CONF="/etc/samba/smb.conf" + +PROG="/usr/sbin/smbd" +PROG_N="/usr/sbin/nmbd" + + +test -x ${PROG} || exit 0 test -n "${OS_VERSION}" || source /etc/init.d/base test -n "${OS_DEBUG}" || source /etc/init.d/conf +test -f ${CONF} || exit 0 + test "${OS_NETWORKLESS}" == "true" && exit 0 + start() { mkdir -p /var/log/samba mkdir -p /var/lib/samba/private msg_begin "Starting smbd" - smbd -D + ${PROG} -D test $? == 0 && msg_done || msg_fail msg_begin "Starting nmbd" - nmbd -D + ${PROG_N} -D test $? == 0 && msg_done || msg_fail } stop() { msg_begin "Stopping smbd" - killall smbd &>/dev/null + killall -q $(basename ${PROG}) test $? == 0 && msg_done || msg_fail msg_begin "Stopping nmbd" - killall nmbd &>/dev/null + killall -q $(basename ${PROG_N}) test $? == 0 && msg_done || msg_fail } diff --git a/board/common/overlay/etc/init.d/S70mongod b/board/common/overlay/etc/init.d/S70mongod new file mode 100755 index 0000000000..0b9fbaea90 --- /dev/null +++ b/board/common/overlay/etc/init.d/S70mongod @@ -0,0 +1,50 @@ +#!/bin/bash + +SYS_CONF="/etc/mongodb.conf" +BOOT_CONF="/boot/mongodb.conf" +CONF="/data/etc/mongodb.conf" + +PROG="/usr/bin/mongod" + + +test -x ${PROG} || exit 0 + +test -n "${OS_VERSION}" || source /etc/init.d/base + +prepare_conf ${CONF} ${SYS_CONF} ${BOOT_CONF} +test -f ${CONF} || exit 0 + + +start() { + msg_begin "Starting mongod" + db_dir=$(cat ${CONF} | grep dbpath | cut -d '=' -f 2) + mkdir -p ${db_dir} + ${PROG} -f ${CONF} --fork > /dev/null + test $? == 0 && msg_done || msg_fail +} + +stop() { + msg_begin "Stopping mongod" + killall -q $(basename ${PROG}) + test $? == 0 && msg_done || msg_fail +} + +case "$1" in + start) + start + ;; + + stop) + stop + ;; + + restart) + stop + start + ;; + + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 +esac + diff --git a/board/common/overlay/etc/init.d/S71redis b/board/common/overlay/etc/init.d/S71redis new file mode 100755 index 0000000000..6ba7a1d0a6 --- /dev/null +++ b/board/common/overlay/etc/init.d/S71redis @@ -0,0 +1,50 @@ +#!/bin/bash + +SYS_CONF="/etc/redis.conf" +BOOT_CONF="/boot/redis.conf" +CONF="/data/etc/redis.conf" + +PROG="/usr/bin/redis-server" + + +test -x ${PROG} || exit 0 + +test -n "${OS_VERSION}" || source /etc/init.d/base + +prepare_conf ${CONF} ${SYS_CONF} ${BOOT_CONF} +test -f ${CONF} || exit 0 + + +start() { + msg_begin "Starting redis" + db_dir=$(cat ${CONF} | grep -E '^dir' | cut -d ' ' -f 2) + mkdir -p ${db_dir} + ${PROG} ${CONF} + test $? == 0 && msg_done || msg_fail +} + +stop() { + msg_begin "Stopping redis" + killall -q $(basename ${PROG}) + test $? == 0 && msg_done || msg_fail +} + +case "$1" in + start) + start + ;; + + stop) + stop + ;; + + restart) + stop + start + ;; + + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 +esac + diff --git a/board/common/overlay/etc/init.d/S72postgresql b/board/common/overlay/etc/init.d/S72postgresql new file mode 100755 index 0000000000..b6b61b82ce --- /dev/null +++ b/board/common/overlay/etc/init.d/S72postgresql @@ -0,0 +1,70 @@ +#!/bin/bash + +BOOT_CONF="/boot/postgresql.conf" +SYS_CONF="/etc/postgresql.conf" +CONF="/data/etc/postgresql.conf" + +PROG="/usr/bin/pg_ctl" + +DB_DIR="/var/lib/postgresql" +USER="postgres" +LOG="/var/log/postgresql.log" + + +function run_pg_ctl() { + su ${USER} -c "pg_ctl $*" +} + + +test -x ${PROG} || exit 0 + +test -n "${OS_VERSION}" || source /etc/init.d/base + +prepare_conf ${CONF} ${SYS_CONF} ${BOOT_CONF} + + +start() { + mkdir -p ${DB_DIR} + chown -R ${USER} ${DB_DIR} + touch ${LOG} + chown ${USER} ${LOG} + cd ${DB_DIR} + + if [[ ! -f ${DB_DIR}/PG_VERSION ]]; then + msg_begin "Initializing postgresql db" + run_pg_ctl initdb -s -D ${DB_DIR} &>> ${LOG} + test $? == 0 && msg_done || msg_fail + + echo "include_if_exists = '/data/etc/postgresql.conf'" >> ${DB_DIR}/postgresql.conf + fi + + msg_begin "Starting postgresql" + run_pg_ctl start -s -D ${DB_DIR} -l ${LOG} + test $? == 0 && msg_done || msg_fail +} + +stop() { + msg_begin "Stopping postgresql" + run_pg_ctl stop -s -D ${DB_DIR} -m fast &>> ${LOG} + test $? == 0 && msg_done || msg_fail +} + +case "$1" in + start) + start + ;; + + stop) + stop + ;; + + restart) + stop + start + ;; + + *) + echo "Usage: $0 {start|stop|restart}" + exit 1 +esac + diff --git a/board/common/postscript.sh b/board/common/postscript.sh index a10cee1305..10c18e9194 100755 --- a/board/common/postscript.sh +++ b/board/common/postscript.sh @@ -48,5 +48,7 @@ if [ -r ${BOARD_DIR}/os.conf ]; then fi # add admin user alias -echo "admin:x:0:0:root:/root:/bin/sh" >> ${TARGET}/etc/passwd +if ! grep -E '^admin:' ${TARGET}/etc/passwd &> /dev/null; then + echo "admin:x:0:0:root:/root:/bin/sh" >> ${TARGET}/etc/passwd +fi diff --git a/board/tinkerboard/linux-fix-ethernet-operstate.patch b/board/tinkerboard/linux-fix-ethernet-operstate.patch deleted file mode 100644 index b066366422..0000000000 --- a/board/tinkerboard/linux-fix-ethernet-operstate.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c -index 2844b497464d..a4b0bb432368 100644 ---- a/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c -+++ b/drivers/net/ethernet/stmicro/stmmac/stmmac_main.c -@@ -3060,6 +3060,8 @@ int stmmac_dvr_probe(struct device *device, - goto error_netdev_register; - } - -+ netif_carrier_off(ndev); -+ - wake_lock_init(&priv->plat->wol_wake_lock, WAKE_LOCK_SUSPEND, "wol_wake_lock"); - - return ret; diff --git a/build.sh b/build.sh index d1d3a4866a..a63b327624 100755 --- a/build.sh +++ b/build.sh @@ -66,6 +66,13 @@ if ! [ -f $basedir/configs/${board}_defconfig ]; then exit 1 fi +function prepare_target_dir() { + if [ -L $outputdir/target/var/lib ]; then + rm $outputdir/target/var/lib + mkdir $outputdir/target/var/lib + fi +} + mkdir -p $outputdir if ! [ -f $outputdir/.config ]; then @@ -135,9 +142,11 @@ elif [[ "$target" == initramfs* ]]; then fi elif [ "$target" == "all" ]; then + prepare_target_dir make O=$outputdir all elif [ -n "$target" ]; then + prepare_target_dir make O=$outputdir $target else # if [ -z "$target ] diff --git a/configs/tinkerboard_defconfig b/configs/tinkerboard_defconfig index db9ee4a4d2..e7c8d39272 100644 --- a/configs/tinkerboard_defconfig +++ b/configs/tinkerboard_defconfig @@ -2,17 +2,17 @@ BR2_arm=y BR2_cortex_a17=y BR2_ARM_FPU_NEON_VFPV4=y BR2_CCACHE=y -BR2_CCACHE_DIR="$(TOPDIR)/.buildroot-ccache-bananapim1" +BR2_CCACHE_DIR="$(TOPDIR)/.buildroot-ccache-tinkerboard" BR2_OPTIMIZE_2=y BR2_TOOLCHAIN_EXTERNAL=y BR2_TARGET_OPTIMIZATION="-pipe" BR2_ROOTFS_DEVICE_CREATION_DYNAMIC_EUDEV=y BR2_TARGET_TZ_INFO=y -BR2_ROOTFS_OVERLAY="board/common/overlay board/bananapim1/overlay" +BR2_ROOTFS_OVERLAY="board/common/overlay board/tinkerboard/overlay" BR2_ROOTFS_POST_BUILD_SCRIPT="board/common/postscript.sh" BR2_LINUX_KERNEL=y BR2_LINUX_KERNEL_CUSTOM_TARBALL=y -BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/TinkerBoard/debian_kernel/archive/4cf992a71ecfed2a817219cf83aba5bf8c5d1d69.tar.gz" +BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/TinkerBoard/debian_kernel/archive/1a0fdafdf55afa88272fb61c8b910ed885d7fada.tar.gz" BR2_LINUX_KERNEL_DEFCONFIG="miniarm-rk3288" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="rk3288-miniarm" diff --git a/package/python-apispec/0001-fix-setup-encoding.patch b/package/python-apispec/0001-fix-setup-encoding.patch new file mode 100644 index 0000000000..835b114f7d --- /dev/null +++ b/package/python-apispec/0001-fix-setup-encoding.patch @@ -0,0 +1,12 @@ +diff -uNr apispec-0.39.0-orig/setup.py apispec-0.39.0-patched/setup.py +--- apispec-0.39.0-orig/setup.py 2018-06-29 05:50:26.000000000 +0300 ++++ apispec-0.39.0-patched/setup.py 2019-01-24 23:36:41.947206745 +0200 +@@ -13,7 +13,7 @@ + Raises RuntimeError if not found. + """ + version = '' +- with open(fname, 'r') as fp: ++ with open(fname, 'r', encoding='utf-8') as fp: + reg = re.compile(r'__version__ = [\'"]([^\'"]*)[\'"]') + for line in fp: + m = reg.match(line) diff --git a/package/python-mock/Config.in b/package/python-mock/Config.in index 0b6a3bd1a3..5292a26a22 100644 --- a/package/python-mock/Config.in +++ b/package/python-mock/Config.in @@ -1,7 +1,6 @@ config BR2_PACKAGE_PYTHON_MOCK bool "python-mock" depends on BR2_PACKAGE_PYTHON || BR2_PACKAGE_PYTHON3 - depends on BR2_PACKAGE_PYTHON_PBR help mock is a library for testing in Python. It allows you to replace parts of your system under test with mock objects and make assertions about how they have been used. diff --git a/package/python-mock/python-mock.mk b/package/python-mock/python-mock.mk index 564e11c68d..60791d2dd6 100644 --- a/package/python-mock/python-mock.mk +++ b/package/python-mock/python-mock.mk @@ -10,5 +10,6 @@ PYTHON_MOCK_SITE = https://files.pythonhosted.org/packages/0c/53/014354fc93c591c PYTHON_MOCK_SETUP_TYPE = setuptools PYTHON_MOCK_LICENSE = Apache-2.0 PYTHON_MOCK_LICENSE_FILES = LICENSE.txt +PYTHON_MOCK_DEPENDENCIES = host-python-pbr $(eval $(python-package))