Merge pull request #4989 from chewitt/imx6

iMX6: repackage cubox/udoo/wandboard images to use FDTDIR
This commit is contained in:
CvH 2021-01-23 09:11:05 +01:00 committed by GitHub
commit fb5a2cf4c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 35 additions and 30 deletions

View File

@ -0,0 +1,6 @@
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2019-present Team LibreELEC (https://libreelec.tv)
[ "$1" = "iMX6.arm" ] && exit 0 || exit 1

View File

@ -2,11 +2,25 @@
# Copyright (C) 2017-present Team LibreELEC (https://libreelec.tv)
if [ -f "$RELEASE_DIR/3rdparty/bootloader/u-boot.img" ]; then
echo "Writing u-boot.img to $(basename $DISK)"
echo "image: writing u-boot.img to $(basename $DISK)"
dd if="$RELEASE_DIR/3rdparty/bootloader/u-boot.img" of="$DISK" bs=1K seek=69 conv=fsync,notrunc >"$SAVE_ERROR" 2>&1 || show_error
fi
if [ -f "$RELEASE_DIR/3rdparty/bootloader/SPL" ]; then
echo "Writing SPL to $(basename $DISK)"
echo "image: writing SPL to $(basename $DISK)"
dd if="$RELEASE_DIR/3rdparty/bootloader/SPL" of="$DISK" bs=1K seek=1 conv=fsync,notrunc >"$SAVE_ERROR" 2>&1 || show_error
fi
echo "image: copying device trees"
mcopy -s -o "${RELEASE_DIR}/3rdparty/bootloader"/imx6d*${UBOOT_SYSTEM}*.dtb ::
mcopy -s -o "${RELEASE_DIR}/3rdparty/bootloader"/imx6q*${UBOOT_SYSTEM}*.dtb ::
echo "image: copying exlinux.conf"
mkdir -p "${LE_TMP}/extlinux"
cat << EOF > "${LE_TMP}/extlinux/extlinux.conf"
LABEL ${DISTRO}
LINUX /${KERNEL_NAME}
FDTDIR /
APPEND boot=UUID=${UUID_SYSTEM} disk=UUID=${UUID_STORAGE} quiet ${EXTRA_CMDLINE}
EOF
mcopy -s -o "${LE_TMP}/extlinux" ::

View File

@ -20,23 +20,21 @@ 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
# update extlinux device trees
for dtbfile in $BOOT_ROOT/*.dtb; do
dtb=$(basename $dtbfile)
echo "Updating $dtb"
cp -p $SYSTEM_ROOT/usr/share/bootloader/$dtb $BOOT_ROOT/ 2>/dev/null || true
done
# update bootloader files
if [ -f $SYSTEM_ROOT/usr/share/bootloader/u-boot.img ]; then
echo "*** updating u-boot image on: $BOOT_DISK ..."
echo "Updating u-boot image on $BOOT_DISK"
dd if=$SYSTEM_ROOT/usr/share/bootloader/u-boot.img of="$BOOT_DISK" bs=1K seek=69 conv=fsync &>/dev/null
fi
if [ -f $SYSTEM_ROOT/usr/share/bootloader/SPL ]; then
echo "*** updating u-boot SPL Blob on: $BOOT_DISK ..."
echo "Updating u-boot SPL on $BOOT_DISK"
dd if=$SYSTEM_ROOT/usr/share/bootloader/SPL of="$BOOT_DISK" bs=1k seek=1 conv=fsync &>/dev/null
fi

View File

@ -1 +0,0 @@
[ "$1" = "imx6.arm" ] && exit 0 || exit 1

View File

@ -196,28 +196,16 @@ devices = \
},
'NXP': {
'iMX6': {
'cubox-dl': {
'dtb': 'imx6dl-cubox-i.dtb',
'cubox': {
'dtb': '',
'config': 'mx6cuboxi_defconfig'
},
'cubox-q': {
'dtb': 'imx6q-cubox-i.dtb',
'config': 'mx6cuboxi_defconfig'
},
'udoo-dl': {
'dtb': 'imx6dl-udoo.dtb',
'udoo': {
'dtb': '',
'config': 'udoo_defconfig'
},
'udoo-q': {
'dtb': 'imx6q-udoo.dtb',
'config': 'udoo_defconfig'
},
'wandboard-dl': {
'dtb': 'imx6dl-wandboard.dtb',
'config': 'wandboard_defconfig'
},
'wandboard-q': {
'dtb': 'imx6q-wandboard.dtb',
'wandboard': {
'dtb': '',
'config': 'wandboard_defconfig'
},
},