mirror of
https://github.com/Fishwaldo/build.git
synced 2025-06-07 06:41:58 +00:00
Support for updating u-boot on eMMC
This commit is contained in:
parent
9e4bb74c50
commit
18638607d1
3 changed files with 17 additions and 2 deletions
|
@ -107,8 +107,8 @@ n=0
|
||||||
for line in "${buildlist[@]}"; do
|
for line in "${buildlist[@]}"; do
|
||||||
unset LINUXFAMILY LINUXCONFIG KERNELDIR KERNELSOURCE KERNELBRANCH BOOTDIR BOOTSOURCE BOOTBRANCH ARCH UBOOT_NEEDS_GCC KERNEL_NEEDS_GCC \
|
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 \
|
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 \
|
write_uboot_platform family_tweaks setup_write_uboot_platform BOOTSCRIPT UBOOT_FILES LOCALVERSION UBOOT_COMPILER KERNEL_COMPILER \
|
||||||
MODULES MODULES_NEXT INITRD_ARCH HAS_UUID_SUPPORT BOOTENV_FILE BOOTDELAY
|
UBOOT_TARGET MODULES MODULES_NEXT MODULES_DEV INITRD_ARCH HAS_UUID_SUPPORT BOOTENV_FILE BOOTDELAY
|
||||||
|
|
||||||
read BOARD BRANCH RELEASE BUILD_DESKTOP <<< $line
|
read BOARD BRANCH RELEASE BUILD_DESKTOP <<< $line
|
||||||
n=$[$n+1]
|
n=$[$n+1]
|
||||||
|
|
|
@ -75,14 +75,17 @@ compile_uboot()
|
||||||
source /usr/lib/u-boot/platform_install.sh
|
source /usr/lib/u-boot/platform_install.sh
|
||||||
[[ \$DEVICE == /dev/null ]] && exit 0
|
[[ \$DEVICE == /dev/null ]] && exit 0
|
||||||
[[ -z \$DEVICE ]] && DEVICE="/dev/mmcblk0"
|
[[ -z \$DEVICE ]] && DEVICE="/dev/mmcblk0"
|
||||||
|
[[ $(type -t setup_write_uboot_platform) == function ]] && setup_write_uboot_platform
|
||||||
write_uboot_platform \$DIR \$DEVICE
|
write_uboot_platform \$DIR \$DEVICE
|
||||||
exit 0
|
exit 0
|
||||||
EOF
|
EOF
|
||||||
chmod 755 $DEST/debs/$uboot_name/DEBIAN/postinst
|
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
|
cat <<-EOF > $DEST/debs/$uboot_name/usr/lib/u-boot/platform_install.sh
|
||||||
DIR=/usr/lib/$uboot_name
|
DIR=/usr/lib/$uboot_name
|
||||||
$(declare -f write_uboot_platform)
|
$(declare -f write_uboot_platform)
|
||||||
|
$(declare -f setup_write_uboot_platform)
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
# set up control file
|
# set up control 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=/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
|
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
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue