diff --git a/scripts/image b/scripts/image index dd7ddcecaf..693a07d8ef 100755 --- a/scripts/image +++ b/scripts/image @@ -273,16 +273,9 @@ if [ "$1" = "release" -o "$1" = "mkimage" -o "$1" = "amlpkg" -o "$1" = "noobs" ] rm -rf $TARGET_IMG/$IMAGE_NAME.img.gz if [ -n "$BOOTLOADER" ]; then - BOOTLOADER_DIR="" - if [ -z "$BOOTLOADER_DIR" -a -d $PROJECT_DIR/$PROJECT/packages ]; then - BOOTLOADER_DIR=`find $PROJECT_DIR/$PROJECT/packages -type d -name $BOOTLOADER 2>/dev/null` - fi + BOOTLOADER_DIR="$(get_pkg_directory "$BOOTLOADER")" - if [ -z "$BOOTLOADER_DIR" -o ! -d "$BOOTLOADER_DIR" ]; then - BOOTLOADER_DIR=`find $PACKAGES -type d -name $BOOTLOADER 2>/dev/null` - fi - - if [ -d "$BOOTLOADER_DIR"/files ]; then + if [ -d $BOOTLOADER_DIR/files ]; then cp -R $BOOTLOADER_DIR/files/* $RELEASE_DIR fi @@ -290,7 +283,7 @@ if [ "$1" = "release" -o "$1" = "mkimage" -o "$1" = "amlpkg" -o "$1" = "noobs" ] . $PROJECT_DIR/$PROJECT/devices/$DEVICE/bootloader/release elif [ -f $PROJECT_DIR/$PROJECT/bootloader/release ]; then . $PROJECT_DIR/$PROJECT/bootloader/release - elif [ -f "$BOOTLOADER_DIR"/release ]; then + elif [ -f $BOOTLOADER_DIR/release ]; then . $BOOTLOADER_DIR/release fi fi @@ -480,8 +473,8 @@ if [ "$1" = "release" -o "$1" = "mkimage" -o "$1" = "amlpkg" -o "$1" = "noobs" ] # create System dir mkdir -p $RELEASE_DIR/${DISTRONAME}_${PROJECT}/System - BOOTLOADER_DIR=`find $PACKAGES -type d -name $BOOTLOADER 2>/dev/null` - if [ -d "$BOOTLOADER_DIR"/files/3rdparty/bootloader/ ]; then + BOOTLOADER_DIR="$(get_pkg_directory "$BOOTLOADER")" + if [ -d $BOOTLOADER_DIR/files/3rdparty/bootloader/ ]; then cp -PR $BOOTLOADER_DIR/files/3rdparty/bootloader/* $RELEASE_DIR/${DISTRONAME}_${PROJECT}/System fi