From aeae7b8956cf97b5a3d920fd96494025c5e52fc2 Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Mon, 28 Oct 2019 23:57:09 +0200 Subject: [PATCH 01/24] list-versions-s3: improve performance by using bash regex --- .../overlay/usr/libexec/list-versions-s3 | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/board/common/overlay/usr/libexec/list-versions-s3 b/board/common/overlay/usr/libexec/list-versions-s3 index 359c07067d..eb69999dcd 100755 --- a/board/common/overlay/usr/libexec/list-versions-s3 +++ b/board/common/overlay/usr/libexec/list-versions-s3 @@ -24,12 +24,9 @@ files=(${keys}) i=0 for file in ${files[*]}; do - version=$(echo ${file:${#path} + 1} | cut -d '/' -f 1) - fname=$(basename ${file}) - i=$((i + 1)) - if [[ -z "${fname}" ]]; then - continue - fi + [[ "${file}" =~ ^${path}/(.+)/(.+)$ ]] || continue + version="${BASH_REMATCH[1]}" + fname="${BASH_REMATCH[2]}" prerelease=false if [[ "${version}" =~ ^.*[abc]\.?[0-9]+$ ]] || # e.g. 0.4.1b2, 0.4.1b.2, 0.4.1-b.2 @@ -38,9 +35,11 @@ for file in ${files[*]}; do prerelease=true fi - final_url=${url}/${path}/${version}/${fname} - board=$(echo ${fname} | cut -d '-' -f 2) - date=$(echo ${dates[${i}]} | cut -d 'T' -f 1) - + [[ "${fname}" =~ ^([^-]+)-([^-]+)-(.+)$ ]] || continue + board="${BASH_REMATCH[2]}" + final_url="${url}/${path}/${version}/${fname}" + date="${dates[${i}]:0:10}" + echo "${version}|${prerelease}|${board}|${final_url}|${date}" + i=$((i + 1)) done | sort -t '|' -k 5,3 -r From 120874af757a7d2a0bc904c144eac4634b8c2713 Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Thu, 31 Oct 2019 23:23:20 +0200 Subject: [PATCH 02/24] Busybox: enable mktemp applet --- board/common/busybox.config | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/board/common/busybox.config b/board/common/busybox.config index f70c01fc58..5e4ecca396 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 -# Fri Feb 1 22:19:53 2019 +# Busybox version: 1.29.3 +# Thu Oct 31 23:22:38 2019 # CONFIG_HAVE_DOT_CONFIG=y @@ -266,7 +266,7 @@ CONFIG_FEATURE_MD5_SHA1_SUM_CHECK=y CONFIG_MKDIR=y CONFIG_MKFIFO=y CONFIG_MKNOD=y -# CONFIG_MKTEMP is not set +CONFIG_MKTEMP=y CONFIG_MV=y CONFIG_NICE=y CONFIG_NL=y @@ -500,7 +500,7 @@ CONFIG_FEATURE_SHADOWPASSWDS=y # CONFIG_USE_BB_PWD_GRP is not set # CONFIG_USE_BB_SHADOW is not set CONFIG_USE_BB_CRYPT=y -# CONFIG_USE_BB_CRYPT_SHA is not set +CONFIG_USE_BB_CRYPT_SHA=y # CONFIG_ADDGROUP is not set # CONFIG_FEATURE_ADDUSER_TO_GROUP is not set # CONFIG_ADD_SHELL is not set From 24200be6a255bfb6947c23bf6f9188a857efe72e Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Thu, 31 Oct 2019 23:57:44 +0200 Subject: [PATCH 03/24] Add /etc/dehydrated/config --- board/common/overlay/etc/dehydrated/config | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 board/common/overlay/etc/dehydrated/config diff --git a/board/common/overlay/etc/dehydrated/config b/board/common/overlay/etc/dehydrated/config new file mode 100644 index 0000000000..fa322f8dd2 --- /dev/null +++ b/board/common/overlay/etc/dehydrated/config @@ -0,0 +1,6 @@ +BASEDIR="/var/lib/dehydrated" +DOMAINS_TXT="/data/etc/ssl/domain" +WELLKNOWN="/tmp/dehydrated" +HOOK="/usr/libexec/dehydrated-hook" +CONTACT_EMAIL="$( Date: Thu, 31 Oct 2019 23:58:11 +0200 Subject: [PATCH 04/24] Dehydrated: add libexec helpers --- .../overlay/usr/libexec/dehydrated-dumb-httpd | 27 +++++++++++++++++++ .../overlay/usr/libexec/dehydrated-hook | 15 +++++++++++ 2 files changed, 42 insertions(+) create mode 100755 board/common/overlay/usr/libexec/dehydrated-dumb-httpd create mode 100755 board/common/overlay/usr/libexec/dehydrated-hook diff --git a/board/common/overlay/usr/libexec/dehydrated-dumb-httpd b/board/common/overlay/usr/libexec/dehydrated-dumb-httpd new file mode 100755 index 0000000000..9130f7a7a4 --- /dev/null +++ b/board/common/overlay/usr/libexec/dehydrated-dumb-httpd @@ -0,0 +1,27 @@ +#!/bin/bash + +CHALLENGE="$1" +PORT=80 +LIFETIME=10 + +if [[ -z "${CHALLENGE}" ]]; then + echo "Usage $0 " + exit 1 +fi + +function make_response() { + echo -en "HTTP/1.1 200 OK\r\n" + echo -en "Content-Length: ${#CHALLENGE}\r\n" + echo -en "Content-Type: text/plain\r\n" + echo -en "Connection: close\r\n\r\n${CHALLENGE}" +} + +start_time=$(date +%s) +echo "Dumb httpd started" +while true; do + make_response | nc -l -w "${LIFETIME}" -p ${PORT} >/dev/null + if (( $(date +%s) - ${start_time} > ${LIFETIME} )); then + break + fi +done +echo "Dumb httpd exit" diff --git a/board/common/overlay/usr/libexec/dehydrated-hook b/board/common/overlay/usr/libexec/dehydrated-hook new file mode 100755 index 0000000000..020150f294 --- /dev/null +++ b/board/common/overlay/usr/libexec/dehydrated-hook @@ -0,0 +1,15 @@ +#!/bin/bash + +SSL_DIR="/data/etc/ssl" +CERT_FILE="${SSL_DIR}/cert.pem" +KEY_FILE="${SSL_DIR}/privkey.pem" + +if [[ "$1" == "deploy_challenge" ]]; then + /usr/libexec/dehydrated-dumb-httpd "$4" & +elif [[ "$1" == "deploy_cert" ]]; then + logger -t dehydrated "deploying certificate & rebooting" + mkdir -p "${SSL_DIR}" + cp "$3" "${KEY_FILE}" + cp "$4" "${CERT_FILE}" + reboot +fi From 250857f10f52c2f5b0d427adc2c7ad3eb60bc7ad Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Thu, 31 Oct 2019 23:58:29 +0200 Subject: [PATCH 05/24] Dehydrated: add cron helper --- board/common/overlay/etc/crontabs/root | 2 +- board/common/overlay/usr/sbin/dehydrated-wrapper | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100755 board/common/overlay/usr/sbin/dehydrated-wrapper diff --git a/board/common/overlay/etc/crontabs/root b/board/common/overlay/etc/crontabs/root index b106e1c3a3..bf0d404956 100644 --- a/board/common/overlay/etc/crontabs/root +++ b/board/common/overlay/etc/crontabs/root @@ -1,2 +1,2 @@ 14 3 * * * /usr/sbin/logrotate /etc/logrotate.conf - +0 2 * * 0 /usr/sbin/dehydrated-wrapper diff --git a/board/common/overlay/usr/sbin/dehydrated-wrapper b/board/common/overlay/usr/sbin/dehydrated-wrapper new file mode 100755 index 0000000000..2d31c273af --- /dev/null +++ b/board/common/overlay/usr/sbin/dehydrated-wrapper @@ -0,0 +1,16 @@ +#!/bin/bash + +PROG="/usr/bin/dehydrated" +BASE_DIR="/var/lib/dehydrated" +TMP_DIR="/tmp/dehydrated" +SSL_DIR="/data/etc/ssl" + +if ! [[ -x "${PROG}" && -r "${SSL_DIR}/domain" && -r "${SSL_DIR}/email" ]]; then + exit 0 # not installed or not configured +fi + +mkdir -p "${BASE_DIR}" +mkdir -p "${TMP_DIR}" + +logger -t dehydrated "checking for certificate renewal" +dehydrated -c From 354c7872ff5bca6df705199aa9bc9b70ce6a803b Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Fri, 1 Nov 2019 19:54:34 +0200 Subject: [PATCH 06/24] Add dynamic DNS update helper --- board/common/overlay/etc/crontabs/root | 1 + board/common/overlay/usr/sbin/dyndns-update | 10 ++++++++++ 2 files changed, 11 insertions(+) create mode 100644 board/common/overlay/usr/sbin/dyndns-update diff --git a/board/common/overlay/etc/crontabs/root b/board/common/overlay/etc/crontabs/root index bf0d404956..9572f6559f 100644 --- a/board/common/overlay/etc/crontabs/root +++ b/board/common/overlay/etc/crontabs/root @@ -1,2 +1,3 @@ 14 3 * * * /usr/sbin/logrotate /etc/logrotate.conf 0 2 * * 0 /usr/sbin/dehydrated-wrapper +*/15 * * * * /usr/sbin/dyndns-update diff --git a/board/common/overlay/usr/sbin/dyndns-update b/board/common/overlay/usr/sbin/dyndns-update new file mode 100644 index 0000000000..d44c23ecb3 --- /dev/null +++ b/board/common/overlay/usr/sbin/dyndns-update @@ -0,0 +1,10 @@ +#!/bin/bash + +SCRIPT="/data/etc/dyndns-update.sh" + +if ! [[ -f "${SCRIPT}" ]]; then + exit 0 +fi + +logger -t dyndns "updating dynamic DNS" +bash "${SCRIPT}" 2>&1 | logger -t dyndns From 0d9d4089e4bc062660e86022d6ef9162e479dbb2 Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Fri, 1 Nov 2019 20:04:23 +0200 Subject: [PATCH 07/24] Add S97dyndns init script --- board/common/overlay/etc/init.d/S97dyndns | 27 +++++++++++++++++++++ board/common/overlay/usr/sbin/dyndns-update | 1 + 2 files changed, 28 insertions(+) create mode 100755 board/common/overlay/etc/init.d/S97dyndns diff --git a/board/common/overlay/etc/init.d/S97dyndns b/board/common/overlay/etc/init.d/S97dyndns new file mode 100755 index 0000000000..4b8e515315 --- /dev/null +++ b/board/common/overlay/etc/init.d/S97dyndns @@ -0,0 +1,27 @@ +#!/bin/bash + +PROG="/usr/sbin/dyndns-update" +SCRIPT="/data/etc/dyndns-update.sh" + + +test -s ${SCRIPT} || exit 0 + +test -n "${OS_VERSION}" || source /etc/init.d/base + +case "$1" in + start) + msg_begin "Updating dynamic DNS" + ${PROG} &>/dev/null + test $? == 0 && msg_done || msg_fail + ;; + + stop) + true + ;; + + *) + echo "Usage: $0 {start}" + exit 1 +esac + +exit $? diff --git a/board/common/overlay/usr/sbin/dyndns-update b/board/common/overlay/usr/sbin/dyndns-update index d44c23ecb3..dde7a7e8b7 100644 --- a/board/common/overlay/usr/sbin/dyndns-update +++ b/board/common/overlay/usr/sbin/dyndns-update @@ -8,3 +8,4 @@ fi logger -t dyndns "updating dynamic DNS" bash "${SCRIPT}" 2>&1 | logger -t dyndns +exit ${PIPESTATUS[0]} From 02aa7aa1912af8e14c18de3e588773d82a46d1bc Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Sun, 3 Nov 2019 11:04:34 +0200 Subject: [PATCH 08/24] dehydrated: update to 0.6.5 --- package/dehydrated/dehydrated.hash | 4 ++-- package/dehydrated/dehydrated.mk | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package/dehydrated/dehydrated.hash b/package/dehydrated/dehydrated.hash index 1d194e5a7d..388dd24749 100644 --- a/package/dehydrated/dehydrated.hash +++ b/package/dehydrated/dehydrated.hash @@ -1,6 +1,6 @@ # Locally computed after verifying -# https://github.com/lukas2511/dehydrated/releases/download/v0.6.2/dehydrated-0.6.2.tar.gz.asc +# https://github.com/lukas2511/dehydrated/releases/download/v0.6.5/dehydrated-0.6.5.tar.gz.asc # with key 3C2F2605E078A1E18F4793909C4DBE6CF438F333 from https://keybase.io/lukas2511 -sha256 163384479199f06f59382ceb6291a299567a2f4f0b963b9b61f2db65a407e80e dehydrated-0.6.2.tar.gz +sha256 10aabd0027450bc70a18e49acaca7a9697e0cfb92368d3e508b7a4d6d69bfa35 dehydrated-0.6.5.tar.gz # License, locally computed sha256 b4583b7dd07e3e2a08906de38e7e329d41f921ed9dcb6310b3886e013a6b8723 LICENSE diff --git a/package/dehydrated/dehydrated.mk b/package/dehydrated/dehydrated.mk index b7de27a407..17c67b8478 100644 --- a/package/dehydrated/dehydrated.mk +++ b/package/dehydrated/dehydrated.mk @@ -4,7 +4,7 @@ # ################################################################################ -DEHYDRATED_VERSION = 0.6.2 +DEHYDRATED_VERSION = 0.6.5 DEHYDRATED_SITE = https://github.com/lukas2511/dehydrated/releases/download/v$(DEHYDRATED_VERSION) DEHYDRATED_LICENSE = MIT From 9f02ffd3abcccea0d055bf5f07b513fbb86ba76e Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Sun, 3 Nov 2019 14:07:48 +0200 Subject: [PATCH 09/24] dyndns-update: make executable --- board/common/overlay/usr/sbin/dyndns-update | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 board/common/overlay/usr/sbin/dyndns-update diff --git a/board/common/overlay/usr/sbin/dyndns-update b/board/common/overlay/usr/sbin/dyndns-update old mode 100644 new mode 100755 From b80d80a11136cb8c4bce6d468e3f74d7ef467f1e Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Sun, 3 Nov 2019 14:35:54 +0200 Subject: [PATCH 10/24] Update SSL certificates via an https-update script --- board/common/overlay/etc/crontabs/root | 2 +- board/common/overlay/usr/sbin/dehydrated-wrapper | 2 +- board/common/overlay/usr/sbin/https-update | 12 ++++++++++++ 3 files changed, 14 insertions(+), 2 deletions(-) create mode 100755 board/common/overlay/usr/sbin/https-update diff --git a/board/common/overlay/etc/crontabs/root b/board/common/overlay/etc/crontabs/root index 9572f6559f..b67d28d62d 100644 --- a/board/common/overlay/etc/crontabs/root +++ b/board/common/overlay/etc/crontabs/root @@ -1,3 +1,3 @@ 14 3 * * * /usr/sbin/logrotate /etc/logrotate.conf -0 2 * * 0 /usr/sbin/dehydrated-wrapper +0 2 * * 0 /usr/sbin/https-update */15 * * * * /usr/sbin/dyndns-update diff --git a/board/common/overlay/usr/sbin/dehydrated-wrapper b/board/common/overlay/usr/sbin/dehydrated-wrapper index 2d31c273af..531cc23772 100755 --- a/board/common/overlay/usr/sbin/dehydrated-wrapper +++ b/board/common/overlay/usr/sbin/dehydrated-wrapper @@ -13,4 +13,4 @@ mkdir -p "${BASE_DIR}" mkdir -p "${TMP_DIR}" logger -t dehydrated "checking for certificate renewal" -dehydrated -c +dehydrated "$@" diff --git a/board/common/overlay/usr/sbin/https-update b/board/common/overlay/usr/sbin/https-update new file mode 100755 index 0000000000..8c1ac1ddaf --- /dev/null +++ b/board/common/overlay/usr/sbin/https-update @@ -0,0 +1,12 @@ +#!/bin/bash + +PROG="/usr/sbin/dehydrated-wrapper" +SSL_DIR="/data/etc/ssl" + +if ! [[ -d "${SSL_DIR}" ]]; then + exit 0 +fi + +logger -t dehydrated "updating SSL certificates" +${PROG} -c 2>&1 | logger -t dehydrated +exit ${PIPESTATUS[0]} From 230eda0b71ee94891be165268aa634c8c34a3693 Mon Sep 17 00:00:00 2001 From: Bo Rydberg <2945606+bolry@users.noreply.github.com> Date: Fri, 8 Nov 2019 20:37:19 +0100 Subject: [PATCH 11/24] Robustify writeimage.sh --- writeimage.sh | 100 +++++++++++++++++++++++++++----------------------- 1 file changed, 54 insertions(+), 46 deletions(-) diff --git a/writeimage.sh b/writeimage.sh index 665df07481..6531da7d40 100755 --- a/writeimage.sh +++ b/writeimage.sh @@ -2,14 +2,16 @@ function usage() { - echo "Usage: $0 [options...]" - echo "" - echo "Available options:" - echo " <-i image_file> - indicates the path to the image file (e.g. -i /home/user/Download/file.img.gz)" - echo " <-d sdcard_dev> - indicates the path to the sdcard block device (e.g. -d /dev/mmcblk0)" - echo " [-m modem:apn:user:pwd:pin] - configures the mobile network modem (e.g. -m ttyUSB0:internet)" - echo " [-n ssid:psk] - sets the wireless network name and key (e.g. -n mynet:mykey1234)" - echo " [-s ip/cidr:gw:dns] - sets a static IP configuration instead of DHCP (e.g. -s 192.168.1.101/24:192.168.1.1:8.8.8.8)" + cat < - indicates the path to the image file (e.g. -i /home/user/Download/file.img.gz) + <-d sdcard_dev> - indicates the path to the sdcard block device (e.g. -d /dev/mmcblk0) + [-m modem:apn:user:pwd:pin] - configures the mobile network modem (e.g. -m ttyUSB0:internet) + [-n ssid:psk] - sets the wireless network name and key (e.g. -n mynet:mykey1234) + [-s ip/cidr:gw:dns] - sets a static IP configuration instead of DHCP (e.g. -s 192.168.1.101/24:192.168.1.1:8.8.8.8) +END_USAGE exit 1 } @@ -64,14 +66,14 @@ function cleanup { set +e # unmount sdcard - umount ${SDCARD_DEV}* >/dev/null 2>&1 + umount "${SDCARD_DEV}"* >/dev/null 2>&1 } trap cleanup EXIT -BOOT=$(dirname $0)/.boot +BOOT=$(dirname "$0")/.boot -if ! [ -f $DISK_IMG ]; then +if ! [ -f "$DISK_IMG" ]; then echo "could not find image file $DISK_IMG" exit 1 fi @@ -85,7 +87,7 @@ if [[ $DISK_IMG == *.gz ]]; then exit 1 fi msg "decompressing the .gz compressed image" - $gunzip -c $DISK_IMG > ${DISK_IMG%???} + $gunzip -c "$DISK_IMG" > "${DISK_IMG%???}" DISK_IMG=${DISK_IMG%???} elif [[ $DISK_IMG == *.xz ]]; then if [ -z "$unxz" ]; then @@ -93,84 +95,90 @@ elif [[ $DISK_IMG == *.xz ]]; then exit 1 fi msg "decompressing the .xz compressed image" - $unxz -T 0 -c $DISK_IMG > ${DISK_IMG%???} + $unxz -T 0 -c "$DISK_IMG" > "${DISK_IMG%???}" DISK_IMG=${DISK_IMG%???} fi -umount ${SDCARD_DEV}* 2>/dev/null || true +umount "${SDCARD_DEV}"* 2>/dev/null || true msg "writing disk image to sdcard" -dd if=$DISK_IMG of=$SDCARD_DEV bs=1048576 +dd if="$DISK_IMG" of="$SDCARD_DEV" bs=1048576 sync if which partprobe > /dev/null 2>&1; then msg "re-reading sdcard partition table" - partprobe ${SDCARD_DEV} + partprobe "${SDCARD_DEV}" sleep 1 fi msg "mounting sdcard" -mkdir -p $BOOT +mkdir -p "$BOOT" -if [ `uname` == "Darwin" ]; then +if [ "$(uname)" == "Darwin" ]; then BOOT_DEV=${SDCARD_DEV}s1 # e.g. /dev/disk4s1 - diskutil unmountDisk ${SDCARD_DEV} - mount -ft msdos $BOOT_DEV $BOOT + diskutil unmountDisk "${SDCARD_DEV}" + mount -ft msdos "$BOOT_DEV" "$BOOT" else # assuming Linux BOOT_DEV=${SDCARD_DEV}p1 # e.g. /dev/mmcblk0p1 - if ! [ -e ${SDCARD_DEV}p1 ]; then + if ! [ -e "${SDCARD_DEV}p1" ]; then BOOT_DEV=${SDCARD_DEV}1 # e.g. /dev/sdc1 fi - mount $BOOT_DEV $BOOT + mount "$BOOT_DEV" "$BOOT" fi # wifi if [ -n "$SSID" ]; then msg "creating wireless configuration" conf=$BOOT/wpa_supplicant.conf - echo "update_config=1" > $conf - echo "ctrl_interface=/var/run/wpa_supplicant" >> $conf - echo "network={" >> $conf - echo " scan_ssid=1" >> $conf - echo " ssid=\"$SSID\"" >> $conf + { + echo "update_config=1" + echo "ctrl_interface=/var/run/wpa_supplicant" + echo "network={" + echo " scan_ssid=1" + echo " ssid=\"$SSID\"" if [ -n "$PSK" ]; then - echo " psk=\"$PSK\"" >> $conf + echo " psk=\"$PSK\"" fi - echo "}" >> $conf - echo "" >> $conf + echo "}" + echo "" + } > "$conf" fi # modem if [ -n "$MODEM" ]; then msg "creating mobile network configuration" conf=$BOOT/ppp - mkdir -p $conf - echo $MODEM > $conf/modem - echo "AT+CGDCONT=1,\"IP\",\"$APN\"" > $conf/apn - echo > $conf/extra - echo > $conf/auth - echo > $conf/pin + mkdir -p "$conf" + echo "$MODEM" > "$conf/modem" + echo "AT+CGDCONT=1,\"IP\",\"$APN\"" > "$conf/apn" + echo > "$conf/extra" if [ -n "$MUSER" ]; then - echo "user \"$MUSER\"" > $conf/auth - echo "password \"$MPWD\"" >> $conf/auth - fi + echo "user \"$MUSER\"" + echo "password \"$MPWD\"" + else + echo + fi > "$conf/auth" if [ -n "$PIN" ]; then - echo "AT+CPIN=$PIN" > $conf/pin - fi + echo "AT+CPIN=$PIN" + else + echo + fi > "$conf/pin" fi # static ip if [ -n "$IP" ] && [ -n "$GW" ] && [ -n "$DNS" ]; then msg "setting static IP configuration" conf=$BOOT/static_ip.conf - echo "STATIC_IP=\"$IP\"" > $conf - echo "STATIC_GW=\"$GW\"" >> $conf - echo "STATIC_DNS=\"$DNS\"" >> $conf + { + echo "STATIC_IP=\"$IP\"" + echo "STATIC_GW=\"$GW\"" + echo "STATIC_DNS=\"$DNS\"" + } > "$conf" fi msg "unmounting sdcard" sync -umount $BOOT -rmdir $BOOT +umount "$BOOT" +rmdir "$BOOT" msg "you can now remove the sdcard" From 881e88e881b44506a84942f163c2628c95395915 Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Sat, 9 Nov 2019 22:39:34 +0200 Subject: [PATCH 12/24] Add python-jsonpointer package --- package/Config.in | 1 + package/python-jsonpointer/Config.in | 7 +++++++ package/python-jsonpointer/python-jsonpointer.hash | 1 + package/python-jsonpointer/python-jsonpointer.mk | 14 ++++++++++++++ 4 files changed, 23 insertions(+) create mode 100644 package/python-jsonpointer/Config.in create mode 100644 package/python-jsonpointer/python-jsonpointer.hash create mode 100644 package/python-jsonpointer/python-jsonpointer.mk diff --git a/package/Config.in b/package/Config.in index 17bfd37c6d..d5bbe51f8f 100644 --- a/package/Config.in +++ b/package/Config.in @@ -917,6 +917,7 @@ menu "External python modules" source "package/python-jaraco-classes/Config.in" source "package/python-jinja2/Config.in" source "package/python-jsonmodels/Config.in" + source "package/python-jsonpointer/Config.in" source "package/python-jsonschema/Config.in" source "package/python-json-schema-validator/Config.in" source "package/python-keyring/Config.in" diff --git a/package/python-jsonpointer/Config.in b/package/python-jsonpointer/Config.in new file mode 100644 index 0000000000..0895f7e032 --- /dev/null +++ b/package/python-jsonpointer/Config.in @@ -0,0 +1,7 @@ +config BR2_PACKAGE_PYTHON_JSONPOINTER + bool "python-jsonpointer" + depends on BR2_PACKAGE_PYTHON3 + help + Resolve JSON Pointers in Python. + + https://github.com/stefankoegl/python-json-pointer diff --git a/package/python-jsonpointer/python-jsonpointer.hash b/package/python-jsonpointer/python-jsonpointer.hash new file mode 100644 index 0000000000..b84e0cce71 --- /dev/null +++ b/package/python-jsonpointer/python-jsonpointer.hash @@ -0,0 +1 @@ +sha256 c192ba86648e05fdae4f08a17ec25180a9aef5008d973407b581798a83975362 jsonpointer-2.0.tar.gz diff --git a/package/python-jsonpointer/python-jsonpointer.mk b/package/python-jsonpointer/python-jsonpointer.mk new file mode 100644 index 0000000000..6e22ec29f7 --- /dev/null +++ b/package/python-jsonpointer/python-jsonpointer.mk @@ -0,0 +1,14 @@ +################################################################################ +# +# python-jsonpointer +# +################################################################################ + +PYTHON_JSONPOINTER_VERSION = 2.0 +PYTHON_JSONPOINTER_SOURCE = jsonpointer-$(PYTHON_JSONPOINTER_VERSION).tar.gz +PYTHON_JSONPOINTER_SITE = https://files.pythonhosted.org/packages/52/e7/246d9ef2366d430f0ce7bdc494ea2df8b49d7a2a41ba51f5655f68cfe85f +PYTHON_JSONPOINTER_SETUP_TYPE = setuptools +PYTHON_JSONPOINTER_LICENSE = BSD +PYTHON_JSONPOINTER_LICENSE_FILES = LICENSE.txt + +$(eval $(python-package)) From 64d86af807cb5cf41324c1435bc13752d282b1b7 Mon Sep 17 00:00:00 2001 From: Bo Rydberg <2945606+bolry@users.noreply.github.com> Date: Mon, 11 Nov 2019 22:55:43 +0100 Subject: [PATCH 13/24] Robustify build.sh --- build.sh | 82 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/build.sh b/build.sh index a63b327624..bf3c3c15a9 100755 --- a/build.sh +++ b/build.sh @@ -15,32 +15,32 @@ set -e # exit at first error board=$1 target=${*:2} -cd $(dirname $0) +cd "$(dirname "$0")" basedir=$(pwd) gzip=$(which pigz 2> /dev/null || which gzip 2> /dev/null) # extra environment from local file -test -f $basedir/.build-env && source $basedir/.build-env +test -f "$basedir/.build-env" && source "$basedir/.build-env" # OS name if [ -n "$THINGOS_SHORT_NAME" ]; then osname=$THINGOS_SHORT_NAME else - osname=$(source $basedir/board/common/overlay/etc/version && echo $OS_SHORT_NAME) + osname=$(source "$basedir/board/common/overlay/etc/version" && echo "$OS_SHORT_NAME") fi # OS version if [ -n "$THINGOS_VERSION" ]; then osversion=$THINGOS_VERSION else - osversion=$(source $basedir/board/common/overlay/etc/version && echo $OS_VERSION) + osversion=$(source "$basedir/board/common/overlay/etc/version" && echo "$OS_VERSION") fi # when the special "boards" keyword is used for board, simply list all known boards if [ "$board" == "boards" ]; then - boards=$(ls $basedir/configs/*_defconfig | grep -v initramfs | grep -oE '\w+_defconfig$' | cut -d '_' -f 1) + boards=$(ls "$basedir"/configs/*_defconfig | grep -v initramfs | grep -oE '\w+_defconfig$' | cut -d '_' -f 1) for b in $boards; do - echo $b + echo "$b" done exit 0 @@ -48,9 +48,9 @@ fi # when the special "all" keyword is used for board, all boards are processed, in turn if [ "$board" == "all" ]; then - boards=$(ls $basedir/configs/*_defconfig | grep -v initramfs | grep -oE '\w+_defconfig$' | cut -d '_' -f 1) + boards=$(ls "$basedir"/configs/*_defconfig | grep -v initramfs | grep -oE '\w+_defconfig$' | cut -d '_' -f 1) for b in $boards; do - if ! $0 $b $target; then + if ! $0 "$b" "$target"; then exit 1 fi done @@ -61,96 +61,96 @@ fi outputdir=$basedir/output/$board boarddir=$basedir/board/$board -if ! [ -f $basedir/configs/${board}_defconfig ]; then +if ! [ -f "$basedir/configs/${board}_defconfig" ]; then echo "unknown board: $board" exit 1 fi function prepare_target_dir() { - if [ -L $outputdir/target/var/lib ]; then - rm $outputdir/target/var/lib - mkdir $outputdir/target/var/lib + if [ -L "$outputdir/target/var/lib" ]; then + rm "$outputdir/target/var/lib" + mkdir "$outputdir/target/var/lib" fi } -mkdir -p $outputdir +mkdir -p "$outputdir" -if ! [ -f $outputdir/.config ]; then - make O=$outputdir ${board}_defconfig +if ! [ -f "$outputdir/.config" ]; then + make O="$outputdir" "${board}_defconfig" fi if [ "$target" == "mkimage" ]; then - $boarddir/mkimage.sh + "$boarddir/mkimage.sh" elif [ "$target" == "mkrelease" ]; then - test -f $outputdir/images/$osname-$board.img || $boarddir/mkimage.sh - cp $outputdir/images/$osname-$board.img $outputdir/images/$osname-$board-$osversion.img + test -f "$outputdir/images/$osname-$board.img" || "$boarddir/mkimage.sh" + cp "$outputdir/images/$osname-$board.img" "$outputdir/images/$osname-$board-$osversion.img" echo "preparing compressed xz image" - rm -f $outputdir/images/$osname-$board-$osversion.img.xz - xz -6ek -T 0 $outputdir/images/$osname-$board-$osversion.img + rm -f "$outputdir/images/$osname-$board-$osversion.img.xz" + xz -6ek -T 0 "$outputdir/images/$osname-$board-$osversion.img" echo "your xz image is ready at $outputdir/images/$osname-$board-$osversion.img.xz" echo "preparing compressed gz image" - rm -f $outputdir/images/$osname-$board-$osversion.img.gz - $gzip $outputdir/images/$osname-$board-$osversion.img + rm -f "$outputdir/images/$osname-$board-$osversion.img.gz" + $gzip "$outputdir/images/$osname-$board-$osversion.img" echo "your gz image is ready at $outputdir/images/$osname-$board-$osversion.img.gz" - rm -f $outputdir/images/$osname-$board-$osversion.img + rm -f "$outputdir/images/$osname-$board-$osversion.img" elif [ "$target" == "clean-target" ]; then - if [ -d $outputdir/target ]; then + if [ -d "$outputdir/target" ]; then echo "removing target directory" - rm -rf $outputdir/target/* + rm -rf "$outputdir/target/"* echo "removing staging directory" - rm -rf $outputdir/staging/* + rm -rf "$outputdir/staging/"* echo "removing images directory" - rm -rf $outputdir/images/* + rm -rf "$outputdir/images/"* fi - if [ -d $outputdir/build ]; then + if [ -d "$outputdir/build" ]; then echo "removing .stamp_target_installed files" - find $outputdir/build -name .stamp_target_installed | xargs -r rm + find "$outputdir/build" -name .stamp_target_installed -print0 | xargs -0 -r rm echo "removing .stamp_staging_installed files" - find $outputdir/build -name .stamp_staging_installed | xargs -r rm + find "$outputdir/build" -name .stamp_staging_installed -print0 | xargs -0 -r rm echo "removing .stamp_host_installed files" - find $outputdir/build -name .stamp_host_installed | xargs -r rm + find "$outputdir/build" -name .stamp_host_installed -print0 | xargs -0 -r rm echo "removing .stamp_images_installed files" - find $outputdir/build -name .stamp_images_installed | xargs -r rm + find "$outputdir/build" -name .stamp_images_installed -print0 | xargs -0 -r rm echo "removing linux kernel build dir" - make O=$outputdir linux-dirclean + make O="$outputdir" linux-dirclean fi - if [ -f $outputdir/.config ]; then + if [ -f "$outputdir/.config" ]; then echo "removing .config file" - rm -f $outputdir/.config + rm -f "$outputdir/.config" fi echo "target is clean" elif [[ "$target" == initramfs* ]]; then extra_args=${target:10} - $0 ${board}_initramfs $extra_args - if [ -z "$extra_args" ] && [ -x $boarddir/cpinitramfs.sh ]; then - IMG_DIR=$basedir/output/${board}_initramfs/images/ BOARD_DIR=$boarddir $boarddir/cpinitramfs.sh + $0 "${board}_initramfs" "$extra_args" + if [ -z "$extra_args" ] && [ -x "$boarddir/cpinitramfs.sh" ]; then + IMG_DIR=$basedir/output/${board}_initramfs/images/ BOARD_DIR=$boarddir "$boarddir/cpinitramfs.sh" fi elif [ "$target" == "all" ]; then prepare_target_dir - make O=$outputdir all + make O="$outputdir" all elif [ -n "$target" ]; then prepare_target_dir - make O=$outputdir $target + make O="$outputdir" "$target" else # if [ -z "$target ] - $0 $board all + $0 "$board" all echo "build successful" fi From ea5f47660c9db34ba991330ba77ea5d57c6b49f1 Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Sat, 16 Nov 2019 12:28:19 +0200 Subject: [PATCH 14/24] list-versions-s3: fix version sort --- board/common/overlay/usr/libexec/list-versions-s3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/common/overlay/usr/libexec/list-versions-s3 b/board/common/overlay/usr/libexec/list-versions-s3 index eb69999dcd..1f94715990 100755 --- a/board/common/overlay/usr/libexec/list-versions-s3 +++ b/board/common/overlay/usr/libexec/list-versions-s3 @@ -42,4 +42,4 @@ for file in ${files[*]}; do echo "${version}|${prerelease}|${board}|${final_url}|${date}" i=$((i + 1)) -done | sort -t '|' -k 5,3 -r +done | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n From 9817f83d69c40faf2f528adfd8faa296211f5563 Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Sun, 17 Nov 2019 19:34:45 +0200 Subject: [PATCH 15/24] /etc/ntp.conf: add tinker panic 0 --- board/common/overlay/etc/ntp.conf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/board/common/overlay/etc/ntp.conf b/board/common/overlay/etc/ntp.conf index 1e0978560e..55e387c0a8 100644 --- a/board/common/overlay/etc/ntp.conf +++ b/board/common/overlay/etc/ntp.conf @@ -1,3 +1,5 @@ +tinker panic 0 + server 0.pool.ntp.org iburst server 1.pool.ntp.org iburst server 2.pool.ntp.org iburst @@ -10,4 +12,3 @@ restrict 127.0.0.1 restrict ::1 driftfile /var/lib/ntp/ntp.drift - From 16a17ec1580596aac118bb075b5a59bea2afa781 Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Sun, 17 Nov 2019 23:02:16 +0200 Subject: [PATCH 16/24] fwupdate: remove downloaded flag file upon error --- board/common/overlay/sbin/fwupdate | 3 +++ 1 file changed, 3 insertions(+) diff --git a/board/common/overlay/sbin/fwupdate b/board/common/overlay/sbin/fwupdate index a1674df615..6e72dd8430 100755 --- a/board/common/overlay/sbin/fwupdate +++ b/board/common/overlay/sbin/fwupdate @@ -289,12 +289,14 @@ function do_download() { if [[ -z "${url}" ]]; then echo "no such version" 1>&2 + rm ${DOWNLOAD_STARTED_FILE} exit 1 fi free_disk=$(df /data | tail -n 1 | tr -s ' ' | cut -d ' ' -f 4) if [[ "${free_disk}" -lt $((MIN_FREE_DISK * 1024)) ]]; then echo "not enough disk space" 1>&2 + rm ${DOWNLOAD_STARTED_FILE} exit 1 fi @@ -320,6 +322,7 @@ function do_download() { if [[ "$?" != 0 ]]; then cat ${CURL_LOG_FILE} + rm ${DOWNLOAD_STARTED_FILE} exit 1 fi From 875c05ac1aa7f9ad7c497a7f1829b793ec6cb50c Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Mon, 18 Nov 2019 00:00:21 +0200 Subject: [PATCH 17/24] fwupdate: add an error status --- board/common/overlay/sbin/fwupdate | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/board/common/overlay/sbin/fwupdate b/board/common/overlay/sbin/fwupdate index 6e72dd8430..a5c8afd63e 100755 --- a/board/common/overlay/sbin/fwupdate +++ b/board/common/overlay/sbin/fwupdate @@ -60,6 +60,7 @@ EXTRACT_DONE_FILE=${FW_DIR}/extract_done FLASH_BOOT_STARTED_FILE=${FW_DIR}/flash_boot_started FLASH_BOOT_DONE_FILE=${FW_DIR}/flash_boot_done FLASH_REBOOT_STARTED_FILE=${FW_DIR}/flash_reboot_started +ERROR_FILE=${FW_DIR}/error TMP_BOOT_DIR=/tmp/fwupdate_boot TMP_ROOT_DIR=/tmp/fwupdate_root @@ -255,6 +256,7 @@ function do_download() { rm -f ${FLASH_BOOT_STARTED_FILE} rm -f ${FLASH_BOOT_DONE_FILE} rm -f ${FLASH_REBOOT_STARTED_FILE} + rm -f ${ERROR_FILE} touch ${DOWNLOAD_STARTED_FILE} echo "downloading..." @@ -288,14 +290,14 @@ function do_download() { fi if [[ -z "${url}" ]]; then - echo "no such version" 1>&2 + echo "no such version" | tee 1>&2 ${ERROR_FILE} rm ${DOWNLOAD_STARTED_FILE} exit 1 fi free_disk=$(df /data | tail -n 1 | tr -s ' ' | cut -d ' ' -f 4) if [[ "${free_disk}" -lt $((MIN_FREE_DISK * 1024)) ]]; then - echo "not enough disk space" 1>&2 + echo "not enough disk space" | tee 1>&2 ${ERROR_FILE} rm ${DOWNLOAD_STARTED_FILE} exit 1 fi @@ -321,7 +323,7 @@ function do_download() { wait ${pid} if [[ "$?" != 0 ]]; then - cat ${CURL_LOG_FILE} + echo "download failed" | tee 1>&2 ${ERROR_FILE} rm ${DOWNLOAD_STARTED_FILE} exit 1 fi @@ -354,7 +356,7 @@ function run_pre_upgrade() { # non-zero exit status of pre-upgrade script indicates that # the upgrade process must not be continued - echo "aborted by pre-upgrade script" + echo "aborted by pre-upgrade script" | tee 1>&2 ${ERROR_FILE} return 1 fi done @@ -368,7 +370,7 @@ function run_pre_upgrade() { function do_extract() { if ! [[ -f ${FW_FILE_GZ} || -f ${FW_FILE_XZ} ]] || ! [[ -f ${DOWNLOAD_DONE_FILE} ]]; then - echo "firmware file not downloaded" 1>&2 + echo "firmware file not downloaded" | tee 1>&2 ${ERROR_FILE} exit 1 fi @@ -376,6 +378,7 @@ function do_extract() { rm -f ${FLASH_BOOT_STARTED_FILE} rm -f ${FLASH_BOOT_DONE_FILE} rm -f ${FLASH_REBOOT_STARTED_FILE} + rm -f ${ERROR_FILE} rm -f ${FW_FILE_EXTR} touch ${EXTRACT_STARTED_FILE} @@ -400,7 +403,7 @@ function do_extract() { DECOMPRESS_PID_FILE=${GUNZIP_PID_FILE} gunzip -k -c ${FW_FILE_GZ} > ${FW_FILE_EXTR} 2>${GUNZIP_LOG_FILE} & else - echo "firmware compression format ${format} not supported" 1>&2 + echo "firmware compression format ${format} not supported" 1>&2 | tee 1>&2 ${ERROR_FILE} exit 1 fi @@ -440,12 +443,13 @@ function do_extract() { function do_flash_boot() { if ! [[ -f ${FW_FILE_EXTR} ]] || ! [[ -f ${EXTRACT_DONE_FILE} ]]; then - echo "extracted firmware not present" + echo "extracted firmware not present" | tee 1>&2 ${ERROR_FILE} return 1 fi rm -f ${FLASH_BOOT_DONE_FILE} rm -f ${FLASH_REBOOT_STARTED_FILE} + rm -f ${ERROR_FILE} touch ${FLASH_BOOT_STARTED_FILE} echo "flashing boot..." @@ -490,10 +494,11 @@ function do_flash_boot() { function do_flash_reboot() { if ! [[ -f ${ROOT_INFO_FILE} ]] || ! [[ -f ${FLASH_BOOT_DONE_FILE} ]]; then - echo "root partition info file not present" + echo "root partition info file not present" | tee 1>&2 ${ERROR_FILE} return 1 fi + rm -f ${ERROR_FILE} touch ${FLASH_REBOOT_STARTED_FILE} echo "preparing for reboot..." @@ -528,7 +533,10 @@ function show_status() { new_version=$(cat ${VER_FILE}) fi - if [[ -f ${FLASH_REBOOT_STARTED_FILE} ]]; then + if [[ -f ${ERROR_FILE} ]]; then + echo -n "error: " + cat ${ERROR_FILE} + elif [[ -f ${FLASH_REBOOT_STARTED_FILE} ]]; then echo "rebooting [${new_version}]" elif [[ -f ${FLASH_BOOT_DONE_FILE} ]]; then echo "boot flashed [${new_version}]" From 10ce67c0acbeb3445d343867c5f595a7b669b7e5 Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Mon, 18 Nov 2019 18:30:06 +0200 Subject: [PATCH 18/24] list-versions-s3: use reverse sort of versions --- board/common/overlay/usr/libexec/list-versions-s3 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/board/common/overlay/usr/libexec/list-versions-s3 b/board/common/overlay/usr/libexec/list-versions-s3 index 1f94715990..70ae0eac96 100755 --- a/board/common/overlay/usr/libexec/list-versions-s3 +++ b/board/common/overlay/usr/libexec/list-versions-s3 @@ -42,4 +42,4 @@ for file in ${files[*]}; do echo "${version}|${prerelease}|${board}|${final_url}|${date}" i=$((i + 1)) -done | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n +done | sort -t. -k 1,1rn -k 2,2rn -k 3,3rn -k 4,4rn -k 5,5rn From b08f8cfcdb02fff081b8ebc77ce13e9b2c1ab89d Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Sat, 23 Nov 2019 19:21:43 +0200 Subject: [PATCH 19/24] dehydrated-dumb-httpd: use socat --- .../overlay/usr/libexec/dehydrated-dumb-httpd | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/board/common/overlay/usr/libexec/dehydrated-dumb-httpd b/board/common/overlay/usr/libexec/dehydrated-dumb-httpd index 9130f7a7a4..25ad5b9432 100755 --- a/board/common/overlay/usr/libexec/dehydrated-dumb-httpd +++ b/board/common/overlay/usr/libexec/dehydrated-dumb-httpd @@ -3,25 +3,24 @@ CHALLENGE="$1" PORT=80 LIFETIME=10 +TMP_RESPONSE="/tmp/dehydrated-response" +LOG="/var/log/dehydrated-dumb-httpd.log" if [[ -z "${CHALLENGE}" ]]; then echo "Usage $0 " exit 1 fi -function make_response() { +{ echo -en "HTTP/1.1 200 OK\r\n" echo -en "Content-Length: ${#CHALLENGE}\r\n" echo -en "Content-Type: text/plain\r\n" echo -en "Connection: close\r\n\r\n${CHALLENGE}" -} +} > "${TMP_RESPONSE}" -start_time=$(date +%s) -echo "Dumb httpd started" -while true; do - make_response | nc -l -w "${LIFETIME}" -p ${PORT} >/dev/null - if (( $(date +%s) - ${start_time} > ${LIFETIME} )); then - break - fi -done -echo "Dumb httpd exit" +echo "Dumb httpd started" > ${LOG} +socat -d TCP4-LISTEN:80,reuseaddr,fork EXEC:"/bin/cat ${TMP_RESPONSE}" &>>${LOG} & +pid=$! +sleep ${LIFETIME} +kill ${pid} +echo "Dumb httpd exit" >> ${LOG} From 2d052bdbe15cbcb70a2cc781855b845b47178130 Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Sun, 1 Dec 2019 19:02:15 +0200 Subject: [PATCH 20/24] semver-sort: add new package --- package/Config.in | 1 + package/semver-sort/Config.in | 2 ++ package/semver-sort/semver-sort.mk | 19 +++++++++++++++++++ 3 files changed, 22 insertions(+) create mode 100644 package/semver-sort/Config.in create mode 100644 package/semver-sort/semver-sort.mk diff --git a/package/Config.in b/package/Config.in index d5bbe51f8f..7df4047211 100644 --- a/package/Config.in +++ b/package/Config.in @@ -1821,6 +1821,7 @@ menu "Miscellaneous" source "package/proj/Config.in" source "package/qemu/Config.in" source "package/qpdf/Config.in" + source "package/semver-sort/Config.in" source "package/shared-mime-info/Config.in" source "package/taskd/Config.in" source "package/wine/Config.in" diff --git a/package/semver-sort/Config.in b/package/semver-sort/Config.in new file mode 100644 index 0000000000..1e0c85000c --- /dev/null +++ b/package/semver-sort/Config.in @@ -0,0 +1,2 @@ +config BR2_PACKAGE_SEMVER_SORT + bool "semver-sort" diff --git a/package/semver-sort/semver-sort.mk b/package/semver-sort/semver-sort.mk new file mode 100644 index 0000000000..84b9bcd730 --- /dev/null +++ b/package/semver-sort/semver-sort.mk @@ -0,0 +1,19 @@ +################################################################################ +# +# semver-sort +# +################################################################################ + +SEMVER_SORT_VERSION = 7cf3c5c783aeea6c2b8673c92b76cc51a1ec7ad5 +SEMVER_SORT_SITE = $(call github,ccrisan,semver-sort,$(SEMVER_SORT_VERSION)) +SEMVER_SORT_LICENSE = MIT + +define SEMVER_SORT_BUILD_CMDS + make CC="$(TARGET_CC)" -C "$(@D)" semver-sort +endef + +define SEMVER_SORT_INSTALL_TARGET_CMDS + cp $(@D)/semver-sort $(TARGET_DIR)/usr/bin/ +endef + +$(eval $(generic-package)) From 4a433c2ab9cc18c5b515b5e89f4496cf9f16560c Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Sun, 1 Dec 2019 20:13:25 +0200 Subject: [PATCH 21/24] list-versions-s3: use semver-sort for proper version sort --- board/common/overlay/usr/libexec/list-versions-s3 | 2 +- configs/bananapim1_defconfig | 1 + configs/nanopineo2_defconfig | 1 + configs/nanopineo_defconfig | 1 + configs/odroidc1_defconfig | 1 + configs/odroidc2_defconfig | 1 + configs/odroidxu4_defconfig | 1 + configs/orangepione_defconfig | 1 + configs/orangepizero_defconfig | 1 + configs/pine64_defconfig | 1 + configs/raspberrypi2_defconfig | 1 + configs/raspberrypi3_defconfig | 2 ++ configs/raspberrypi4_defconfig | 1 + configs/raspberrypi_defconfig | 1 + configs/tinkerboard_defconfig | 1 + package/semver-sort/semver-sort.mk | 2 +- 16 files changed, 17 insertions(+), 2 deletions(-) diff --git a/board/common/overlay/usr/libexec/list-versions-s3 b/board/common/overlay/usr/libexec/list-versions-s3 index 70ae0eac96..b8801359e5 100755 --- a/board/common/overlay/usr/libexec/list-versions-s3 +++ b/board/common/overlay/usr/libexec/list-versions-s3 @@ -42,4 +42,4 @@ for file in ${files[*]}; do echo "${version}|${prerelease}|${board}|${final_url}|${date}" i=$((i + 1)) -done | sort -t. -k 1,1rn -k 2,2rn -k 3,3rn -k 4,4rn -k 5,5rn +done | semver-sort -r -t '|' -k 1 diff --git a/configs/bananapim1_defconfig b/configs/bananapim1_defconfig index 3e29136041..7f19f87bf9 100644 --- a/configs/bananapim1_defconfig +++ b/configs/bananapim1_defconfig @@ -56,6 +56,7 @@ BR2_PACKAGE_CURL=y BR2_PACKAGE_LIBCAP=y BR2_PACKAGE_PCRE=y BR2_PACKAGE_PCRE_UCP=y +BR2_PACKAGE_SEMVER_SORT=y BR2_PACKAGE_AUTOSSH=y BR2_PACKAGE_CRDA=y BR2_PACKAGE_DHCP=y diff --git a/configs/nanopineo2_defconfig b/configs/nanopineo2_defconfig index b117b6ff0b..992d425ca7 100644 --- a/configs/nanopineo2_defconfig +++ b/configs/nanopineo2_defconfig @@ -48,6 +48,7 @@ BR2_PACKAGE_CURL=y BR2_PACKAGE_LIBCAP=y BR2_PACKAGE_PCRE=y BR2_PACKAGE_PCRE_UCP=y +BR2_PACKAGE_SEMVER_SORT=y BR2_PACKAGE_AUTOSSH=y BR2_PACKAGE_CRDA=y BR2_PACKAGE_DHCP=y diff --git a/configs/nanopineo_defconfig b/configs/nanopineo_defconfig index d3bf640f70..c6697604bf 100644 --- a/configs/nanopineo_defconfig +++ b/configs/nanopineo_defconfig @@ -48,6 +48,7 @@ BR2_PACKAGE_CURL=y BR2_PACKAGE_LIBCAP=y BR2_PACKAGE_PCRE=y BR2_PACKAGE_PCRE_UCP=y +BR2_PACKAGE_SEMVER_SORT=y BR2_PACKAGE_AUTOSSH=y BR2_PACKAGE_CRDA=y BR2_PACKAGE_DHCP=y diff --git a/configs/odroidc1_defconfig b/configs/odroidc1_defconfig index f5b70a4981..2a9000ec43 100644 --- a/configs/odroidc1_defconfig +++ b/configs/odroidc1_defconfig @@ -60,6 +60,7 @@ BR2_PACKAGE_LIBCURL=y BR2_PACKAGE_CURL=y BR2_PACKAGE_LIBCAP=y BR2_PACKAGE_PCRE=y +BR2_PACKAGE_SEMVER_SORT=y BR2_PACKAGE_AUTOSSH=y BR2_PACKAGE_CRDA=y BR2_PACKAGE_DHCP=y diff --git a/configs/odroidc2_defconfig b/configs/odroidc2_defconfig index 203ac0cc42..dae8341881 100644 --- a/configs/odroidc2_defconfig +++ b/configs/odroidc2_defconfig @@ -48,6 +48,7 @@ BR2_PACKAGE_CURL=y BR2_PACKAGE_LIBCAP=y BR2_PACKAGE_PCRE=y BR2_PACKAGE_PCRE_UCP=y +BR2_PACKAGE_SEMVER_SORT=y BR2_PACKAGE_AUTOSSH=y BR2_PACKAGE_CRDA=y BR2_PACKAGE_DHCP=y diff --git a/configs/odroidxu4_defconfig b/configs/odroidxu4_defconfig index ddbb9f801c..7ac36ba65d 100644 --- a/configs/odroidxu4_defconfig +++ b/configs/odroidxu4_defconfig @@ -51,6 +51,7 @@ BR2_PACKAGE_CURL=y BR2_PACKAGE_LIBCAP=y BR2_PACKAGE_PCRE=y BR2_PACKAGE_PCRE_UCP=y +BR2_PACKAGE_SEMVER_SORT=y BR2_PACKAGE_AUTOSSH=y BR2_PACKAGE_CRDA=y BR2_PACKAGE_DHCP=y diff --git a/configs/orangepione_defconfig b/configs/orangepione_defconfig index 24ea3e86eb..799d726bf1 100644 --- a/configs/orangepione_defconfig +++ b/configs/orangepione_defconfig @@ -51,6 +51,7 @@ BR2_PACKAGE_CURL=y BR2_PACKAGE_LIBCAP=y BR2_PACKAGE_PCRE=y BR2_PACKAGE_PCRE_UCP=y +BR2_PACKAGE_SEMVER_SORT=y BR2_PACKAGE_AUTOSSH=y BR2_PACKAGE_CRDA=y BR2_PACKAGE_DHCP=y diff --git a/configs/orangepizero_defconfig b/configs/orangepizero_defconfig index 94ccba49dd..6340709e0f 100644 --- a/configs/orangepizero_defconfig +++ b/configs/orangepizero_defconfig @@ -51,6 +51,7 @@ BR2_PACKAGE_CURL=y BR2_PACKAGE_LIBCAP=y BR2_PACKAGE_PCRE=y BR2_PACKAGE_PCRE_UCP=y +BR2_PACKAGE_SEMVER_SORT=y BR2_PACKAGE_AUTOSSH=y BR2_PACKAGE_CRDA=y BR2_PACKAGE_DHCP=y diff --git a/configs/pine64_defconfig b/configs/pine64_defconfig index bb394ba838..08b43aeab4 100644 --- a/configs/pine64_defconfig +++ b/configs/pine64_defconfig @@ -47,6 +47,7 @@ BR2_PACKAGE_CURL=y BR2_PACKAGE_LIBCAP=y BR2_PACKAGE_PCRE=y BR2_PACKAGE_PCRE_UCP=y +BR2_PACKAGE_SEMVER_SORT=y BR2_PACKAGE_AUTOSSH=y BR2_PACKAGE_CRDA=y BR2_PACKAGE_DHCP=y diff --git a/configs/raspberrypi2_defconfig b/configs/raspberrypi2_defconfig index 4773ee5e64..400bdbecb3 100644 --- a/configs/raspberrypi2_defconfig +++ b/configs/raspberrypi2_defconfig @@ -54,6 +54,7 @@ BR2_PACKAGE_CURL=y BR2_PACKAGE_LIBCAP=y BR2_PACKAGE_PCRE=y BR2_PACKAGE_PCRE_UCP=y +BR2_PACKAGE_SEMVER_SORT=y BR2_PACKAGE_AUTOSSH=y BR2_PACKAGE_CRDA=y BR2_PACKAGE_DHCP=y diff --git a/configs/raspberrypi3_defconfig b/configs/raspberrypi3_defconfig index 7ad09932b5..c2e633fa5f 100644 --- a/configs/raspberrypi3_defconfig +++ b/configs/raspberrypi3_defconfig @@ -54,6 +54,8 @@ BR2_PACKAGE_CURL=y BR2_PACKAGE_LIBCAP=y BR2_PACKAGE_PCRE=y BR2_PACKAGE_PCRE_UCP=y +BR2_PACKAGE_SEMVER_SORT=y +BR2_PACKAGE_SEMVER_SORT=y BR2_PACKAGE_AUTOSSH=y BR2_PACKAGE_CRDA=y BR2_PACKAGE_DHCP=y diff --git a/configs/raspberrypi4_defconfig b/configs/raspberrypi4_defconfig index 24925440a7..7acab8cc6e 100644 --- a/configs/raspberrypi4_defconfig +++ b/configs/raspberrypi4_defconfig @@ -54,6 +54,7 @@ BR2_PACKAGE_CURL=y BR2_PACKAGE_LIBCAP=y BR2_PACKAGE_PCRE=y BR2_PACKAGE_PCRE_UCP=y +BR2_PACKAGE_SEMVER_SORT=y BR2_PACKAGE_AUTOSSH=y BR2_PACKAGE_CRDA=y BR2_PACKAGE_DHCP=y diff --git a/configs/raspberrypi_defconfig b/configs/raspberrypi_defconfig index 4e35bb9d8a..2dfbf1c094 100644 --- a/configs/raspberrypi_defconfig +++ b/configs/raspberrypi_defconfig @@ -61,6 +61,7 @@ BR2_PACKAGE_CURL=y BR2_PACKAGE_LIBCAP=y BR2_PACKAGE_PCRE=y BR2_PACKAGE_PCRE_UCP=y +BR2_PACKAGE_SEMVER_SORT=y BR2_PACKAGE_AUTOSSH=y BR2_PACKAGE_CRDA=y BR2_PACKAGE_DHCP=y diff --git a/configs/tinkerboard_defconfig b/configs/tinkerboard_defconfig index c2bf2c966d..bb048c7115 100644 --- a/configs/tinkerboard_defconfig +++ b/configs/tinkerboard_defconfig @@ -51,6 +51,7 @@ BR2_PACKAGE_CURL=y BR2_PACKAGE_LIBCAP=y BR2_PACKAGE_PCRE=y BR2_PACKAGE_PCRE_UCP=y +BR2_PACKAGE_SEMVER_SORT=y BR2_PACKAGE_AUTOSSH=y BR2_PACKAGE_CRDA=y BR2_PACKAGE_DHCP=y diff --git a/package/semver-sort/semver-sort.mk b/package/semver-sort/semver-sort.mk index 84b9bcd730..e96df2eec5 100644 --- a/package/semver-sort/semver-sort.mk +++ b/package/semver-sort/semver-sort.mk @@ -4,7 +4,7 @@ # ################################################################################ -SEMVER_SORT_VERSION = 7cf3c5c783aeea6c2b8673c92b76cc51a1ec7ad5 +SEMVER_SORT_VERSION = a4de79b7691945e1db9b21ffc5b39b751477dc4e SEMVER_SORT_SITE = $(call github,ccrisan,semver-sort,$(SEMVER_SORT_VERSION)) SEMVER_SORT_LICENSE = MIT From 733326800de327847a8ad911c64c1b1ad82ecbaa Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Sun, 1 Dec 2019 23:07:55 +0200 Subject: [PATCH 22/24] rpi-firmware: update to 878d27e23ff2f1c9a35d1b1fc8fe71e06083b823 --- package/rpi-firmware/rpi-firmware.hash | 2 +- package/rpi-firmware/rpi-firmware.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package/rpi-firmware/rpi-firmware.hash b/package/rpi-firmware/rpi-firmware.hash index 713f912eb8..cd9ba14fc9 100644 --- a/package/rpi-firmware/rpi-firmware.hash +++ b/package/rpi-firmware/rpi-firmware.hash @@ -1 +1 @@ -sha256 eec0287caa24b42d5460ed7c555e6871096ee7cfddd1582bf864930740095de1 rpi-firmware-01508e81ec1e918448227ca864616d56c430b46d.tar.gz +sha256 92ac14e7af3ac0f30271c9de903ee237f9f77e31583000281324cb1d8100ae95 rpi-firmware-878d27e23ff2f1c9a35d1b1fc8fe71e06083b823.tar.gz diff --git a/package/rpi-firmware/rpi-firmware.mk b/package/rpi-firmware/rpi-firmware.mk index ddb977676d..6d71b2e9b1 100644 --- a/package/rpi-firmware/rpi-firmware.mk +++ b/package/rpi-firmware/rpi-firmware.mk @@ -4,7 +4,7 @@ # ################################################################################ -RPI_FIRMWARE_VERSION = 01508e81ec1e918448227ca864616d56c430b46d +RPI_FIRMWARE_VERSION = 878d27e23ff2f1c9a35d1b1fc8fe71e06083b823 RPI_FIRMWARE_SITE = $(call github,raspberrypi,firmware,$(RPI_FIRMWARE_VERSION)) RPI_FIRMWARE_LICENSE = BSD-3-Clause RPI_FIRMWARE_LICENSE_FILES = boot/LICENCE.broadcom From 8526e553e82ac8de5654c0210438c99de4b1bd1a Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Sun, 1 Dec 2019 23:09:19 +0200 Subject: [PATCH 23/24] rpi-userland: update to 13b33c8ee52521ac3c804ffa6d8e8b8a8cd30697 --- package/rpi-userland/rpi-userland.hash | 2 +- package/rpi-userland/rpi-userland.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package/rpi-userland/rpi-userland.hash b/package/rpi-userland/rpi-userland.hash index 6dd8e1fa94..b05c71a48b 100644 --- a/package/rpi-userland/rpi-userland.hash +++ b/package/rpi-userland/rpi-userland.hash @@ -1 +1 @@ -sha256 f0909d5fcdc53b9227e307b858ed695dcaa6dce7f90acee0de3cb9add4f8ad12 rpi-userland-2f85f2db007fb7b15ed1b485f42eae4cc6bc2bf4.tar.gz +sha256 3d31967d87c6d825ee73d1a5b8f39a53f2a006f7ff2903d7f628503248e62897 rpi-userland-13b33c8ee52521ac3c804ffa6d8e8b8a8cd30697.tar.gz diff --git a/package/rpi-userland/rpi-userland.mk b/package/rpi-userland/rpi-userland.mk index df32acb790..d53280bc27 100644 --- a/package/rpi-userland/rpi-userland.mk +++ b/package/rpi-userland/rpi-userland.mk @@ -4,7 +4,7 @@ # ################################################################################ -RPI_USERLAND_VERSION = 2f85f2db007fb7b15ed1b485f42eae4cc6bc2bf4 +RPI_USERLAND_VERSION = 13b33c8ee52521ac3c804ffa6d8e8b8a8cd30697 RPI_USERLAND_SITE = $(call github,raspberrypi,userland,$(RPI_USERLAND_VERSION)) RPI_USERLAND_LICENSE = BSD-3-Clause RPI_USERLAND_LICENSE_FILES = LICENCE From d53b4c14a7c4041d1819afc69a77ea52778d26a0 Mon Sep 17 00:00:00 2001 From: Calin Crisan Date: Sun, 1 Dec 2019 23:10:49 +0200 Subject: [PATCH 24/24] Raspberry Pi (all): update kernel to 3c235dcfe80a7c7ba360219e4a3ecb256f294376 --- configs/raspberrypi2_defconfig | 2 +- configs/raspberrypi3_defconfig | 2 +- configs/raspberrypi4_defconfig | 2 +- configs/raspberrypi_defconfig | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/configs/raspberrypi2_defconfig b/configs/raspberrypi2_defconfig index 400bdbecb3..ffcddb6822 100644 --- a/configs/raspberrypi2_defconfig +++ b/configs/raspberrypi2_defconfig @@ -12,7 +12,7 @@ BR2_ROOTFS_OVERLAY="board/common/overlay board/raspberrypi2/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/raspberrypi/linux/archive/6d8bf28fa4b1ca0a35c0cd1dcb267fb216daf720.tar.gz" +BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/raspberrypi/linux/archive/3c235dcfe80a7c7ba360219e4a3ecb256f294376.tar.gz" BR2_LINUX_KERNEL_DEFCONFIG="bcm2709" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="bcm2709-rpi-2-b" diff --git a/configs/raspberrypi3_defconfig b/configs/raspberrypi3_defconfig index c2e633fa5f..daac3ae10e 100644 --- a/configs/raspberrypi3_defconfig +++ b/configs/raspberrypi3_defconfig @@ -12,7 +12,7 @@ BR2_ROOTFS_OVERLAY="board/common/overlay board/raspberrypi3/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/raspberrypi/linux/archive/6d8bf28fa4b1ca0a35c0cd1dcb267fb216daf720.tar.gz" +BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/raspberrypi/linux/archive/3c235dcfe80a7c7ba360219e4a3ecb256f294376.tar.gz" BR2_LINUX_KERNEL_DEFCONFIG="bcm2709" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="bcm2710-rpi-3-b bcm2710-rpi-3-b-plus bcm2710-rpi-cm3" diff --git a/configs/raspberrypi4_defconfig b/configs/raspberrypi4_defconfig index 7acab8cc6e..e201f941c7 100644 --- a/configs/raspberrypi4_defconfig +++ b/configs/raspberrypi4_defconfig @@ -12,7 +12,7 @@ BR2_ROOTFS_OVERLAY="board/common/overlay board/raspberrypi4/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/raspberrypi/linux/archive/6d8bf28fa4b1ca0a35c0cd1dcb267fb216daf720.tar.gz" +BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/raspberrypi/linux/archive/3c235dcfe80a7c7ba360219e4a3ecb256f294376.tar.gz" BR2_LINUX_KERNEL_DEFCONFIG="bcm2711" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="bcm2711-rpi-4-b" diff --git a/configs/raspberrypi_defconfig b/configs/raspberrypi_defconfig index 2dfbf1c094..fdb2b7fa79 100644 --- a/configs/raspberrypi_defconfig +++ b/configs/raspberrypi_defconfig @@ -19,7 +19,7 @@ BR2_ROOTFS_OVERLAY="board/common/overlay board/raspberrypi/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/raspberrypi/linux/archive/6d8bf28fa4b1ca0a35c0cd1dcb267fb216daf720.tar.gz" +BR2_LINUX_KERNEL_CUSTOM_TARBALL_LOCATION="https://github.com/raspberrypi/linux/archive/3c235dcfe80a7c7ba360219e4a3ecb256f294376.tar.gz" BR2_LINUX_KERNEL_DEFCONFIG="bcmrpi" BR2_LINUX_KERNEL_DTS_SUPPORT=y BR2_LINUX_KERNEL_INTREE_DTS_NAME="bcm2708-rpi-zero-w bcm2708-rpi-b bcm2708-rpi-b-plus bcm2708-rpi-cm"