Support for updating u-boot on eMMC

This commit is contained in:
zador-blood-stained 2016-10-22 18:34:18 +03:00
parent 9e4bb74c50
commit 18638607d1
3 changed files with 17 additions and 2 deletions

View file

@ -107,8 +107,8 @@ n=0
for line in "${buildlist[@]}"; do
unset LINUXFAMILY LINUXCONFIG KERNELDIR KERNELSOURCE KERNELBRANCH BOOTDIR BOOTSOURCE BOOTBRANCH ARCH UBOOT_NEEDS_GCC KERNEL_NEEDS_GCC \
CPUMIN CPUMAX UBOOT_VER KERNEL_VER GOVERNOR BOOTSIZE UBOOT_TOOLCHAIN KERNEL_TOOLCHAIN PACKAGE_LIST_EXCLUDE KERNEL_IMAGE_TYPE \
write_uboot_platform family_tweaks BOOTSCRIPT UBOOT_FILES LOCALVERSION UBOOT_COMPILER KERNEL_COMPILER UBOOT_TARGET \
MODULES MODULES_NEXT INITRD_ARCH HAS_UUID_SUPPORT BOOTENV_FILE BOOTDELAY
write_uboot_platform family_tweaks setup_write_uboot_platform BOOTSCRIPT UBOOT_FILES LOCALVERSION UBOOT_COMPILER KERNEL_COMPILER \
UBOOT_TARGET MODULES MODULES_NEXT MODULES_DEV INITRD_ARCH HAS_UUID_SUPPORT BOOTENV_FILE BOOTDELAY
read BOARD BRANCH RELEASE BUILD_DESKTOP <<< $line
n=$[$n+1]

View file

@ -75,14 +75,17 @@ compile_uboot()
source /usr/lib/u-boot/platform_install.sh
[[ \$DEVICE == /dev/null ]] && exit 0
[[ -z \$DEVICE ]] && DEVICE="/dev/mmcblk0"
[[ $(type -t setup_write_uboot_platform) == function ]] && setup_write_uboot_platform
write_uboot_platform \$DIR \$DEVICE
exit 0
EOF
chmod 755 $DEST/debs/$uboot_name/DEBIAN/postinst
# declare -f on non-defined function does not do anything
cat <<-EOF > $DEST/debs/$uboot_name/usr/lib/u-boot/platform_install.sh
DIR=/usr/lib/$uboot_name
$(declare -f write_uboot_platform)
$(declare -f setup_write_uboot_platform)
EOF
# set up control file

View file

@ -29,3 +29,15 @@ write_uboot_platform()
dd if=/dev/zero of=$2 bs=1k count=1023 seek=1 status=noxfer > /dev/null 2>&1
dd if=$1/u-boot-sunxi-with-spl.bin of=$2 bs=1024 seek=8 status=noxfer > /dev/null 2>&1
}
setup_write_uboot_platform()
{
for dev in $(lsblk -d -n -p -o NAME); do
if grep -q 'eGON.BT0' <(dd if=$dev bs=32 skip=256 count=1 status=none); then
# Assuming that only one device with SPL signature is present
echo "SPL signature found on $dev" >&2
DEVICE=$dev
break
fi
done
}