mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-24 11:16:51 +00:00
busybox: add dtname/dtfile helper scripts
This commit is contained in:
parent
ebf5f72c61
commit
cdeb85f70c
@ -124,6 +124,8 @@ makeinstall_target() {
|
||||
mkdir -p $INSTALL/usr/bin
|
||||
[ $TARGET_ARCH = x86_64 ] && cp $PKG_DIR/scripts/getedid $INSTALL/usr/bin
|
||||
cp $PKG_DIR/scripts/createlog $INSTALL/usr/bin/
|
||||
cp $PKG_DIR/scripts/dtfile $INSTALL/usr/bin
|
||||
cp $PKG_DIR/scripts/dtname $INSTALL/usr/bin
|
||||
cp $PKG_DIR/scripts/lsb_release $INSTALL/usr/bin/
|
||||
cp $PKG_DIR/scripts/apt-get $INSTALL/usr/bin/
|
||||
cp $PKG_DIR/scripts/sudo $INSTALL/usr/bin/
|
||||
|
20
packages/sysutils/busybox/scripts/dtfile
Executable file
20
packages/sysutils/busybox/scripts/dtfile
Executable file
@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv)
|
||||
|
||||
COMPATIBLE=$(cat /proc/device-tree/compatible | tr -d '\000' | sed -n -e 's/.*\(allwinner\|amlogic\|rockchip\).*/\1/p')
|
||||
|
||||
if [ -n "$COMPATIBLE" ]; then
|
||||
if [ -e /flash/extlinux/extlinux.conf ]; then
|
||||
DTFILE=$(grep FDT extlinux.conf | sed 's, *FDT /dtb/,,g')
|
||||
elif [ -e /flash/boot.ini ]; then
|
||||
DTFILE=$(grep -m 1 dtb_name boot.ini | cut -d \" -f2 | sed 's,/dtb/,,g')
|
||||
elif [ -e /flash/uEnv.ini ]; then
|
||||
DTFILE=$(grep dtb_name /flash/uEnv.ini | sed 's,dtb_name=/dtb/,,g')
|
||||
else
|
||||
DTFILE=""
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "$DTFILE"
|
13
packages/sysutils/busybox/scripts/dtname
Executable file
13
packages/sysutils/busybox/scripts/dtname
Executable file
@ -0,0 +1,13 @@
|
||||
#!/bin/bash
|
||||
|
||||
# SPDX-License-Identifier: GPL-2.0
|
||||
# Copyright (C) 2018-present Team LibreELEC (https://libreelec.tv)
|
||||
|
||||
COMPATIBLE=$(cat /proc/device-tree/compatible | tr -d '\000' | sed -n -e 's/.*\(allwinner\|amlogic\|rockchip\).*/\1/p')
|
||||
|
||||
if [ -n "$COMPATIBLE" ]; then
|
||||
DTNAME=$(cat /proc/device-tree/compatible | cut -f1,2 -d',' | head -n 1)
|
||||
echo "$DTNAME"
|
||||
else
|
||||
echo "unknown"
|
||||
fi
|
Loading…
x
Reference in New Issue
Block a user