mkfirmware.sh&mk-image.sh: Make sure using buildroot host tools

Change-Id: I3037ec2d5b91b34a9b31aa1a0887a4f47f7162b8
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
This commit is contained in:
Jeffy Chen
2019-01-02 14:29:35 +08:00
parent f71f98b69d
commit a264ab8cef
4 changed files with 19 additions and 11 deletions

View File

@ -194,15 +194,8 @@ function clean_all(){
} }
function build_firmware(){ function build_firmware(){
HOST_DIR=$TOP_DIR/buildroot/output/host
if [ -d "$TARGET_OUTPUT_DIR" ];then
HOST_DIR=$TARGET_OUTPUT_DIR/host
fi
HOST_PATH=$HOST_DIR/usr/sbin:$HOST_DIR/usr/bin:$HOST_DIR/sbin:$HOST_DIR/bin
# mkfirmware.sh to genarate image # mkfirmware.sh to genarate image
PATH=$HOST_PATH:$PATH ./mkfirmware.sh $BOARD_CONFIG ./mkfirmware.sh $BOARD_CONFIG
if [ $? -eq 0 ]; then if [ $? -eq 0 ]; then
echo "Make image ok!" echo "Make image ok!"
else else

View File

@ -1,10 +1,14 @@
#!/bin/bash #!/bin/bash
if [ -d "$TARGET_OUTPUT_DIR" ];then if [ ! -d "$TARGET_OUTPUT_DIR" ]; then
HOST_DIR=$TARGET_OUTPUT_DIR/host echo "Source buildroot/build/envsetup.sh firstly!!!"
export PATH=$HOST_DIR/usr/sbin:$HOST_DIR/usr/bin:$HOST_DIR/sbin:$HOST_DIR/bin:$PATH exit 1
fi fi
# Prefer using buildroot host tools for compatible.
HOST_DIR=$TARGET_OUTPUT_DIR/host
export PATH=$HOST_DIR/usr/sbin:$HOST_DIR/usr/bin:$HOST_DIR/sbin:$HOST_DIR/bin:$PATH
fatal() fatal()
{ {
echo -e "FATAL: " $@ echo -e "FATAL: " $@

View File

@ -30,6 +30,12 @@ LOADER=$TOP_DIR/u-boot/*_loader_v*.bin
MKIMAGE=$TOP_DIR/device/rockchip/common/mk-image.sh MKIMAGE=$TOP_DIR/device/rockchip/common/mk-image.sh
mkdir -p $ROCKDEV mkdir -p $ROCKDEV
# Require buildroot host tools to do image packing.
if [ ! -d "$TARGET_OUTPUT_DIR" ]; then
echo "Source buildroot/build/envsetup.sh"
source $TOP_DIR/buildroot/build/envsetup.sh $RK_CFG_BUILDROOT
fi
if [ $RK_ROOTFS_IMG ] if [ $RK_ROOTFS_IMG ]
then then
if [ -f $ROOTFS_IMG ] if [ -f $ROOTFS_IMG ]

View File

@ -35,6 +35,11 @@ MKIMAGE=$TOP_DIR/device/rockchip/common/mk-image.sh
rm -rf $ROCKDEV rm -rf $ROCKDEV
mkdir -p $ROCKDEV mkdir -p $ROCKDEV
# Require buildroot host tools to do image packing.
if [ ! -d "$TARGET_OUTPUT_DIR" ]; then
echo "Source buildroot/build/envsetup.sh"
source $TOP_DIR/buildroot/build/envsetup.sh $RK_CFG_BUILDROOT
fi
if [ "${RK_OEM_DIR}" == "dueros" ];then if [ "${RK_OEM_DIR}" == "dueros" ];then
if [ $RK_ARCH == arm ];then if [ $RK_ARCH == arm ];then