mirror of
https://github.com/Freescale/meta-freescale-3rdparty.git
synced 2025-07-19 12:09:01 +02:00
u-boot-script-toradex: Add recipe
Recipe based on u-boot-distro-boot from meta-toradex-bsp-common https://git.toradex.com/cgit/meta-toradex-bsp-common.git/tree/recipes-bsp/u-boot/u-boot-distro-boot.bb Signed-off-by: Fabio Berton <fabio.berton@ossystems.com.br>
This commit is contained in:
parent
7869887b52
commit
6ad0524b13
30
recipes-bsp/u-boot/u-boot-script-toradex/boot.cmd.in
Normal file
30
recipes-bsp/u-boot/u-boot-script-toradex/boot.cmd.in
Normal file
|
@ -0,0 +1,30 @@
|
|||
if test ${devtype} = "ubi"
|
||||
then
|
||||
echo "This script is not meant to distro boot from raw NAND flash."
|
||||
exit
|
||||
fi
|
||||
|
||||
if test ${distro_bootpart} != 1
|
||||
then
|
||||
echo "Boot partition needs to be the first partition"
|
||||
exit
|
||||
fi
|
||||
|
||||
if test -n ${setup}
|
||||
then
|
||||
run setup
|
||||
else
|
||||
env set setupargs 'console=tty1 consoleblank=0'
|
||||
fi
|
||||
test -n ${m4boot} || env set m4boot ';'
|
||||
test -n ${fdtfile} || env set fdtfile $fdt_file
|
||||
test -n ${kernel_image} || env set kernel_image ${boot_file}
|
||||
|
||||
env set uuid_set 'part uuid ${devtype} ${devnum}:2 uuid'
|
||||
env set emmcargs_set 'env set emmcargs root=PARTUUID=${uuid} rw rootfstype=ext4 rootwait'
|
||||
env set bootcmd_args 'env set bootargs ${defargs} ${emmcargs} ${setupargs} ${vidargs} ${tdxargs}'
|
||||
env set bootcmd_kernel 'load ${devtype} ${devnum}:${distro_bootpart} ${kernel_addr_r} ${kernel_image}'
|
||||
env set bootcmd_dtb 'load ${devtype} ${devnum}:${distro_bootpart} ${fdt_addr_r} ${fdtfile}'
|
||||
env set bootcmd_run '@@KERNEL_BOOTCMD@@ ${kernel_addr_r} - ${fdt_addr_r}'
|
||||
env set bootcmd 'run m4boot; run bootcmd_dtb && run uuid_set && run emmcargs_set && run bootcmd_args && run bootcmd_kernel && run bootcmd_run'
|
||||
run bootcmd
|
26
recipes-bsp/u-boot/u-boot-script-toradex_2019.07.bb
Normal file
26
recipes-bsp/u-boot/u-boot-script-toradex_2019.07.bb
Normal file
|
@ -0,0 +1,26 @@
|
|||
DESCRIPTION = "Boot script for launching images with U-Boot distro boot"
|
||||
LICENSE = "MIT"
|
||||
LIC_FILES_CHKSUM = "file://${COREBASE}/meta/COPYING.MIT;md5=3da9cfbcb788c80a0384361b4de20420"
|
||||
|
||||
INHIBIT_DEFAULT_DEPS = "1"
|
||||
DEPENDS = "u-boot-mkimage-native"
|
||||
|
||||
SRC_URI = "\
|
||||
file://boot.cmd.in \
|
||||
"
|
||||
|
||||
KERNEL_BOOTCMD ??= "bootz"
|
||||
KERNEL_BOOTCMD_aarch64 ?= "booti"
|
||||
|
||||
inherit deploy nopackages
|
||||
|
||||
do_deploy() {
|
||||
sed -e 's/@@KERNEL_BOOTCMD@@/${KERNEL_BOOTCMD}/' \
|
||||
"${WORKDIR}/boot.cmd.in" > boot.cmd
|
||||
mkimage -T script -C none -n "Distro boot script" -d boot.cmd boot.scr
|
||||
install -m 0644 boot.scr ${DEPLOYDIR}
|
||||
}
|
||||
|
||||
addtask deploy after do_install before do_build
|
||||
|
||||
PACKAGE_ARCH = "${MACHINE_ARCH}"
|
Loading…
Reference in New Issue
Block a user