From b5d8449a941a72e65d24c446b78105991487fe3e Mon Sep 17 00:00:00 2001 From: Yuntian Zhang Date: Fri, 22 Apr 2022 17:53:18 +0800 Subject: [PATCH] Update to 10.0.2 --- ...improve-compatibility-with-real-bash.patch | 53 +++++++++++++++++++ Makefile | 23 ++++---- NAME | 2 +- README.md | 6 +-- VERSION | 2 +- src | 2 +- 6 files changed, 71 insertions(+), 17 deletions(-) create mode 100644 0001-dthelper-improve-compatibility-with-real-bash.patch diff --git a/0001-dthelper-improve-compatibility-with-real-bash.patch b/0001-dthelper-improve-compatibility-with-real-bash.patch new file mode 100644 index 0000000..4684ea4 --- /dev/null +++ b/0001-dthelper-improve-compatibility-with-real-bash.patch @@ -0,0 +1,53 @@ +From eda3c796c30fcdb0688594d8f7d6934dc9dcbf79 Mon Sep 17 00:00:00 2001 +From: Yuntian Zhang +Date: Fri, 22 Apr 2022 17:48:10 +0800 +Subject: [PATCH] dthelper: improve compatibility with real bash + +busybox's bash and GNU bash handles '\0' in stdout differently, and +the script will output incorrect result due to this. + +Signed-off-by: Yuntian Zhang +--- + packages/sysutils/busybox/scripts/dthelper | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/packages/sysutils/busybox/scripts/dthelper b/packages/sysutils/busybox/scripts/dthelper +index a60e6b95f4..624a8c9ab8 100755 +--- a/packages/sysutils/busybox/scripts/dthelper ++++ b/packages/sysutils/busybox/scripts/dthelper +@@ -20,7 +20,7 @@ do_dtfile(){ + + do_dtflag(){ + if [ "${COMPATIBLE}" = "raspberrypi" ]; then +- DTFLAG=$(cat /proc/device-tree/compatible | cut -f1,2 -d',' | head -n 1) ++ DTFLAG=$(tr '\0' '\n' < /proc/device-tree/compatible | head -n 1) + PIREV=$(awk '/^Revision/ {sub($3,-6, "", $3); print $3}' /proc/cpuinfo) # truncate to 6-chars + case "${PIREV}" in + d*) +@@ -46,7 +46,7 @@ do_dtflag(){ + ;; + esac + else +- DTFLAG=$(cat /proc/device-tree/compatible | cut -f1,2 -d',' | head -n 1) ++ DTFLAG=$(tr '\0' '\n' < /proc/device-tree/compatible | head -n 1) + MEMSIZE=$(awk -F " " '/MemTotal:/ {print $2}' /proc/meminfo) + if [ "${MEMSIZE}" -lt "524288" ]; then + MEMSIZE="-512" +@@ -58,12 +58,12 @@ do_dtflag(){ + } + + do_dtname(){ +- DTNAME=$(cat /proc/device-tree/compatible | cut -f1,2 -d',' | head -n 1) ++ DTNAME=$(tr '\0' '\n' < /proc/device-tree/compatible | head -n 1) + echo "${DTNAME}" + } + + do_dtsoc(){ +- DTSOC=$(cat /proc/device-tree/compatible | cut -f1,2 -d',' | tail -n 1) ++ DTSOC=$(tr '\0' '\n' < /proc/device-tree/compatible | tail -n 1) + echo "${DTSOC}" + } + +-- +2.35.1 + diff --git a/Makefile b/Makefile index d173ea5..9387e59 100644 --- a/Makefile +++ b/Makefile @@ -2,27 +2,27 @@ MAKEFLAGS += --silent NAME = $(shell cat NAME) VERSION = $(shell cat VERSION) -URL = https://github.com/radxa-pkg/libreelec-alsa-utils -DESCRIPTION = ALSA helper from LibreELEC +URL = https://github.com/radxa-pkg/dthelper +DESCRIPTION = Device tree helper from LibreELEC all: + cd ./src && \ + git config --get user.name || git config user.name "Radxa" && \ + git config --get user.email || git config user.email "dev@radxa.com" && \ + git am ../*.patch && \ + cd .. + rm -rf ./.deb-pkg/ - mkdir -p ./.deb-pkg/usr/lib/udev/rules.d/ - cp ./src/packages/audio/alsa-utils/scripts/soundconfig ./.deb-pkg/usr/lib/udev - # truly magic happening here. script won't work without piping - sed -i -e 's+progress "Setting up sound card"+echo "Setting up sound card" | cat+g' ./.deb-pkg/usr/lib/udev/soundconfig - cp ./src/packages/audio/alsa-utils/udev.d/90-alsa-restore.rules ./.deb-pkg/usr/lib/udev/rules.d mkdir -p ./.deb-pkg/usr/bin cp ./src/packages/sysutils/busybox/scripts/dthelper ./.deb-pkg/usr/bin - sed -i -e "s+cat /proc/device-tree/compatible | cut -f1,2 -d','+tr '\\\0' '\\\n' < /proc/device-tree/compatible+g" ./.deb-pkg/usr/bin/dthelper ln -sf dthelper ./.deb-pkg/usr/bin/dtfile ln -sf dthelper ./.deb-pkg/usr/bin/dtflag ln -sf dthelper ./.deb-pkg/usr/bin/dtname ln -sf dthelper ./.deb-pkg/usr/bin/dtsoc + fpm -s dir -t deb -n $(NAME) -v $(VERSION) \ - -p $(NAME)_$(VERSION)_all.deb \ + -a all \ --deb-priority optional --category admin \ - --force \ --deb-field "Multi-Arch: foreign" \ --deb-field "Replaces: $(NAME)" \ --deb-field "Conflicts: $(NAME)" \ @@ -32,6 +32,7 @@ all: --license "GPL-2+" \ -m "Radxa " \ --vendor "Radxa" \ - -a all \ + --force \ ./.deb-pkg/=/ + rm -rf ./.deb-pkg/ \ No newline at end of file diff --git a/NAME b/NAME index 3ace132..c4d25cb 100644 --- a/NAME +++ b/NAME @@ -1 +1 @@ -libreelec-alsa-utils \ No newline at end of file +dthelper \ No newline at end of file diff --git a/README.md b/README.md index 475c227..5654b0b 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# libreelec-alsa-utils +# dthelper -[![Build](https://github.com/radxa-pkg/libreelec-alsa-utils/actions/workflows/build.yml/badge.svg)](https://github.com/radxa-pkg/libreelec-alsa-utils/actions/workflows/build.yml) [![Release](https://github.com/radxa-pkg/libreelec-alsa-utils/actions/workflows/release.yml/badge.svg)](https://github.com/radxa-pkg/libreelec-alsa-utils/actions/workflows/release.yml) +[![Build](https://github.com/radxa-pkg/dthelper/actions/workflows/build.yml/badge.svg)](https://github.com/radxa-pkg/dthelper/actions/workflows/build.yml) [![Release](https://github.com/radxa-pkg/dthelper/actions/workflows/release.yml/badge.svg)](https://github.com/radxa-pkg/dthelper/actions/workflows/release.yml) -ALSA helper from [LibreELEC](https://github.com/LibreELEC/LibreELEC.tv), providing ALSA routing in user space. +Device tree helper from [LibreELEC](https://github.com/LibreELEC/LibreELEC.tv), providing easy-to-use board & SoC identification. diff --git a/VERSION b/VERSION index 142b628..0843407 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -10.0.1-2 \ No newline at end of file +10.0.2-1 \ No newline at end of file diff --git a/src b/src index 6c0f328..8fd15cd 160000 --- a/src +++ b/src @@ -1 +1 @@ -Subproject commit 6c0f328c00e53c2d6298911f4233fc207a9fa4e7 +Subproject commit 8fd15cdad59fb70083aa25b5c9680d8826b94696