#!/bin/bash
# make raspi image

. ${LKP_SRC}/lib/debug.sh
. ${LKP_SRC}/lib/create_compile_env.sh


main()
{
	ARCH="$(uname -i)"
	if [ ${ARCH} != "aarch64" ];then
		die "Only the aarch64 architecture is supported for raspi image creation."
	fi
	create_compile_env
	cd ${root_path}
	cat > run.cfg <<-EOF
	cd ${LKP_SRC}/tests && bash build_raspi_image_chroot
	EOF
	bash chroot.sh < run.cfg
	if [ -f "${root_path}/tmp/build_failed" ];then
		die "make raspi failed."
	fi
}


main
