Skip to content

Commit

Permalink
od: Simplify MODEL query in gmenu2x.sh
Browse files Browse the repository at this point in the history
`/sys/firmware/devicetree/base/compatible` is `\0`-delimited.

Instead of relying on `\0`-removal and stripping the `ingenic.*` suffix, simply read the string up to the first `\0`.

Follow-up to #97 which did this for other script.

Signed-off-by: Gleb Mazovetskiy <[email protected]>
  • Loading branch information
glebm authored and pcercuei committed Mar 11, 2024
1 parent 35b8988 commit e3e6e47
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion board/opendingux/package/gmenu2x/gmenu2x.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

PLATFORMS=$(sed -n 's/^opkPlatforms="\(.*\)"$/\1/p' /usr/share/gmenu2x/gmenu2x.conf)

MODEL=$(sed -n 's/.*,\(.*\)ingenic.*/\1/p' /sys/firmware/devicetree/base/compatible)
IFS= read -r -d $'\0' MODEL </sys/firmware/devicetree/base/compatible
case $MODEL in
rs90|gcw0)
;;
Expand Down

0 comments on commit e3e6e47

Please sign in to comment.