Skip to content

Commit

Permalink
Update to 10.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
RadxaYuntian committed Apr 22, 2022
1 parent 9624c74 commit b5d8449
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 17 deletions.
53 changes: 53 additions & 0 deletions 0001-dthelper-improve-compatibility-with-real-bash.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
From eda3c796c30fcdb0688594d8f7d6934dc9dcbf79 Mon Sep 17 00:00:00 2001
From: Yuntian Zhang <[email protected]>
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 <[email protected]>
---
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

23 changes: 12 additions & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 "[email protected]" && \
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)" \
Expand All @@ -32,6 +32,7 @@ all:
--license "GPL-2+" \
-m "Radxa <[email protected]>" \
--vendor "Radxa" \
-a all \
--force \
./.deb-pkg/=/

rm -rf ./.deb-pkg/
2 changes: 1 addition & 1 deletion NAME
Original file line number Diff line number Diff line change
@@ -1 +1 @@
libreelec-alsa-utils
dthelper
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
10.0.1-2
10.0.2-1
2 changes: 1 addition & 1 deletion src
Submodule src updated 219 files

0 comments on commit b5d8449

Please sign in to comment.