mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-31 14:37:59 +00:00
Merge pull request #3143 from DaVukovic/getedid_fixup
[busybox] Fixed 'getedid delete' section
This commit is contained in:
commit
99f4e4b151
@ -50,7 +50,6 @@ del_edid() {
|
|||||||
mv "$file".old "$file"
|
mv "$file".old "$file"
|
||||||
rm -f /flash/edid.cpio
|
rm -f /flash/edid.cpio
|
||||||
mount_ro
|
mount_ro
|
||||||
rm -fr /storage/.config/firmware
|
|
||||||
sys_reboot
|
sys_reboot
|
||||||
else
|
else
|
||||||
echo "You don't have a backup file for $file. You did not use this script to create the custom EDID"
|
echo "You don't have a backup file for $file. You did not use this script to create the custom EDID"
|
||||||
@ -107,7 +106,7 @@ check_file() {
|
|||||||
sys_path="/flash"
|
sys_path="/flash"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#check which file is available
|
# check which file is available
|
||||||
if [ -f "$sys_path/syslinux.cfg" -a -f "$sys_path/extlinux.conf" ]; then
|
if [ -f "$sys_path/syslinux.cfg" -a -f "$sys_path/extlinux.conf" ]; then
|
||||||
echo "Your system contains both a /flash/syslinux.cfg and a /flash/extlinux.conf file"
|
echo "Your system contains both a /flash/syslinux.cfg and a /flash/extlinux.conf file"
|
||||||
echo "Something is wrong on your system. Exiting"
|
echo "Something is wrong on your system. Exiting"
|
||||||
@ -139,8 +138,19 @@ check_kernel() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
create_edid() {
|
||||||
|
# create edid
|
||||||
|
mkdir -p /tmp/cpio/lib/firmware/edid
|
||||||
|
cat "/sys/class/drm/$card/edid" > /tmp/cpio/lib/firmware/edid/edid.bin
|
||||||
|
|
||||||
|
# create cpio archive
|
||||||
|
cd /tmp/cpio/
|
||||||
|
find . -print | cpio -ov -H newc > /storage/edid.cpio
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
intel_amd() {
|
intel_amd() {
|
||||||
#check which output is connnected:
|
# check which output is connnected:
|
||||||
counter=0
|
counter=0
|
||||||
for i in /sys/class/drm/*; do
|
for i in /sys/class/drm/*; do
|
||||||
if [ "$(cat "$i"/status 2>/dev/null)" = "connected" ]; then
|
if [ "$(cat "$i"/status 2>/dev/null)" = "connected" ]; then
|
||||||
@ -155,38 +165,28 @@ intel_amd() {
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
#create edid
|
# create the edid
|
||||||
mkdir -p /storage/.config/firmware/edid
|
create_edid
|
||||||
cat "/sys/class/drm/$card/edid" > /storage/.config/firmware/edid/edid.bin
|
|
||||||
|
|
||||||
#create cpio archive
|
# check extlinux.conf and syslinux.cfg
|
||||||
cd /storage
|
|
||||||
mkdir -p cpio/lib/firmware/edid
|
|
||||||
cp /storage/.config/firmware/edid/edid.bin /storage/cpio/lib/firmware/edid/
|
|
||||||
cd cpio/
|
|
||||||
find . -print | cpio -ov -H newc > /storage/edid.cpio
|
|
||||||
cd /storage
|
|
||||||
rm -rf cpio
|
|
||||||
|
|
||||||
#check extlinux.conf and syslinux.cfg
|
|
||||||
check_file
|
check_file
|
||||||
check_content
|
check_content
|
||||||
|
|
||||||
#remount /flash to rw
|
# remount /flash to rw
|
||||||
mount_rw
|
mount_rw
|
||||||
mv /storage/edid.cpio /flash
|
mv /storage/edid.cpio /flash
|
||||||
|
|
||||||
# make a backup of $file
|
# make a backup of $file
|
||||||
cp "$file" "$file".old
|
cp "$file" "$file".old
|
||||||
|
|
||||||
#add boot parameters to $file in relation to the used kernel
|
# add boot parameters to $file in relation to the used kernel
|
||||||
if [ "$kernel" -lt "415000" ]; then
|
if [ "$kernel" -lt "415000" ]; then
|
||||||
sed -i "/ APPEND/s/$/ initrd=\/edid.cpio drm_kms_helper.edid_firmware=$hdmi:edid\/edid.bin video=$hdmi:D/" "$file"
|
sed -i "/ APPEND/s/$/ initrd=\/edid.cpio drm_kms_helper.edid_firmware=$hdmi:edid\/edid.bin video=$hdmi:D/" "$file"
|
||||||
else
|
else
|
||||||
sed -i "/ APPEND/s/$/ initrd=\/edid.cpio drm.edid_firmware=edid\/edid.bin/" "$file"
|
sed -i "/ APPEND/s/$/ initrd=\/edid.cpio drm.edid_firmware=edid\/edid.bin/" "$file"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
#reboot
|
# reboot
|
||||||
sys_reboot
|
sys_reboot
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user