0
0
mirror of https://github.com/libretro/Lakka-LibreELEC.git synced 2025-03-05 09:38:49 +00:00
2019-07-10 15:14:45 -07:00

33 lines
875 B
Bash

#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2016-present Team LibreELEC (https://libreelec.tv)
[ -z "$BOOT_ROOT" ] && BOOT_ROOT="/flash"
[ -z "$BOOT_PART" ] && BOOT_PART=$(df "$BOOT_ROOT" | tail -1 | awk {' print $1 '})
if [ -z "$BOOT_DISK" ]; then
case $BOOT_PART in
/dev/sd[a-z][0-9]*)
BOOT_DISK=$(echo $BOOT_PART | sed -e "s,[0-9]*,,g")
;;
/dev/mmcblk*)
BOOT_DISK=$(echo $BOOT_PART | sed -e "s,p[0-9]*,,g")
;;
esac
fi
# mount $BOOT_ROOT r/w
mount -o remount,rw $BOOT_ROOT
# update Device Tree Blobs
for all_dtb in /flash/*.dtb; do
dtb=$(basename $all_dtb)
if [ -f $SYSTEM_ROOT/usr/share/bootloader/$dtb ]; then
echo "*** updating Device Tree Blob: $dtb ..."
cp -p $SYSTEM_ROOT/usr/share/bootloader/$dtb $BOOT_ROOT
fi
done
# mount $BOOT_ROOT r/o
sync
mount -o remount,ro $BOOT_ROOT