Merge pull request #3432 from chewitt/busybox-dtname

busybox: add dtname/dtfile helper scripts
This commit is contained in:
CvH 2019-04-17 07:59:54 +02:00 committed by GitHub
commit ec94899d82
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 35 additions and 0 deletions

View File

@ -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/

View 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"

View 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