mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-28 13:16:41 +00:00
busybox: add Amlogic getedid script
Signed-off-by: Christian Hewitt <christianshewitt@gmail.com>
This commit is contained in:
parent
23942f808a
commit
94954d7751
@ -103,6 +103,9 @@ makeinstall_target() {
|
|||||||
cp ${PKG_DIR}/scripts/update-bootloader-edid-rpi ${INSTALL}/usr/bin/update-bootloader-edid
|
cp ${PKG_DIR}/scripts/update-bootloader-edid-rpi ${INSTALL}/usr/bin/update-bootloader-edid
|
||||||
cp ${PKG_DIR}/scripts/getedid-drm ${INSTALL}/usr/bin/getedid
|
cp ${PKG_DIR}/scripts/getedid-drm ${INSTALL}/usr/bin/getedid
|
||||||
fi
|
fi
|
||||||
|
if [ "${PROJECT}" = "Amlogic" ]; then
|
||||||
|
cp ${PKG_DIR}/scripts/update-bootloader-edid-amlogic ${INSTALL}/usr/bin/getedid
|
||||||
|
fi
|
||||||
cp ${PKG_DIR}/scripts/createlog ${INSTALL}/usr/bin/
|
cp ${PKG_DIR}/scripts/createlog ${INSTALL}/usr/bin/
|
||||||
cp ${PKG_DIR}/scripts/dthelper ${INSTALL}/usr/bin
|
cp ${PKG_DIR}/scripts/dthelper ${INSTALL}/usr/bin
|
||||||
ln -sf dthelper ${INSTALL}/usr/bin/dtfile
|
ln -sf dthelper ${INSTALL}/usr/bin/dtfile
|
||||||
|
89
packages/sysutils/busybox/scripts/update-bootloader-edid-amlogic
Executable file
89
packages/sysutils/busybox/scripts/update-bootloader-edid-amlogic
Executable file
@ -0,0 +1,89 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# SPDX-License-Identifier: GPL-2.0
|
||||||
|
# Copyright (C) 2022-present Team LibreELEC (https://libreelec.tv)
|
||||||
|
|
||||||
|
do_install(){
|
||||||
|
# create the persistent firmware dir
|
||||||
|
mkdir -p "/storage/.config/firmware/edid"
|
||||||
|
|
||||||
|
# capture the raw edid file
|
||||||
|
if [ ! -e /storage/.config/firmware/edid/edid.bin ]; then
|
||||||
|
cat "/sys/class/drm/card0-HDMI-A-1/edid" > "/storage/.config/firmware/edid/edid.bin"
|
||||||
|
else
|
||||||
|
echo "info: using existing edid.bin"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# create the cpio file
|
||||||
|
mkdir -p "/storage/cpio/lib/firmware/edid"
|
||||||
|
cp "/storage/.config/firmware/edid/edid.bin" "/storage/cpio/lib/firmware/edid/"
|
||||||
|
cd "/storage/cpio"
|
||||||
|
find . -print | cpio -ov -H newc > "/storage/.config/firmware/edid/edid.cpio"
|
||||||
|
|
||||||
|
# mount /flash rw
|
||||||
|
mount -o remount,rw /flash
|
||||||
|
|
||||||
|
# copy the cpio file
|
||||||
|
cp "/storage/.config/firmware/edid/edid.cpio" "/flash/edid.cpio"
|
||||||
|
|
||||||
|
# cleanup cpio dir
|
||||||
|
rm -rf "/storage/cpio"
|
||||||
|
|
||||||
|
# determine boot method and set params
|
||||||
|
if [ -f "/flash/extlinux/extlinux.conf" ]; then
|
||||||
|
FILE="/flash/extlinux/extlinux.conf"
|
||||||
|
if grep -q "initrd=/edid.cpio" "${FILE}" ; then
|
||||||
|
echo "error: ${FILE} already contains edid.cpio, aborting!"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
cp "${FILE}" "${FILE}.backup"
|
||||||
|
sed -i "/ APPEND/s/$/ drm.edid_firmware=edid\/edid.bin video=HDMI-A-1:D/" "${FILE}"
|
||||||
|
echo "info: edid setup complete!"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
FILE="/flash/uEnv.ini"
|
||||||
|
if grep -q "initrd=/edid.cpio" "${FILE}" ; then
|
||||||
|
echo "error: ${FILE} already contains edid.cpio info .. aborting!"
|
||||||
|
exit 1
|
||||||
|
else
|
||||||
|
cp "${FILE}" "${FILE}.backup"
|
||||||
|
sed -i "/ bootargs/s/$/ drm.edid_firmware=edid\/edid.bin video=HDMI-A-1:D/" "${FILE}"
|
||||||
|
echo "info: edid setup complete!"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
do_cleanup(){
|
||||||
|
rm "/storage/.config/firmware/edid/edid.bin"
|
||||||
|
rm "/storage/.config/firmware/edid/edid.cpio"
|
||||||
|
mount -o remount,rw /flash
|
||||||
|
rm "/flash/edid.cpio"
|
||||||
|
if [ -f "/flash/extlinux/extlinux.conf" ]; then
|
||||||
|
FILE="/flash/extlinux/extlinux.conf"
|
||||||
|
else
|
||||||
|
FILE="/flash/uEnv.ini"
|
||||||
|
fi
|
||||||
|
cp "${FILE}.backup" "${FILE}"
|
||||||
|
mount -o remount,ro /flash
|
||||||
|
}
|
||||||
|
|
||||||
|
do_usage(){
|
||||||
|
echo "usage: getedid {create|delete}"
|
||||||
|
exit 0
|
||||||
|
}
|
||||||
|
|
||||||
|
case $1 in
|
||||||
|
create)
|
||||||
|
do_install
|
||||||
|
;;
|
||||||
|
delete)
|
||||||
|
do_cleanup
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
do_usage
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit
|
Loading…
x
Reference in New Issue
Block a user