1#!/bin/bash 2# Copyright (c) 2022 Shenzhen Kaihong Digital Industry Development Co., Ltd. 3# Licensed under the Apache License, Version 2.0 (the "License"); 4# you may not use this file except in compliance with the License. 5# You may obtain a copy of the License at 6# 7# http://www.apache.org/licenses/LICENSE-2.0 8# 9# Unless required by applicable law or agreed to in writing, software 10# distributed under the License is distributed on an "AS IS" BASIS, 11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12# See the License for the specific language governing permissions and 13# limitations under the License. 14set -e 15 16SCRIPT_PATH=$(dirname $0) 17SRC_PATH="$1" 18NO_APP_DATA_FLAG="$2" 19OUT_DIR=${SRC_PATH}/.. 20echo "=========>>gd32f4xx file system make:src path=$SRC_PATH,SCRIPT_PATH=${SCRIPT_PATH},OUT_DIR=${OUT_DIR}" >&2 21 22 23if [[ $NO_APP_DATA_FLAG == "no_app_data" ]]; then 24 python3 ${SCRIPT_PATH}/combination.py --bootloader_path ${SCRIPT_PATH}/gd32_uart_bootloader.bin --kernel_path ${OUT_DIR}/OHOS_Image.bin --image_path ${OUT_DIR}/gd32f4xx.bin 25else 26 #cd ${SRC_PATH}/.. 27 # ${SCRIPT_PATH}/mklfs -c $SRC_PATH -b 4096 -r 128 -p 128 -s 1048576 -n 1 -l 32 -e 128 -k 500 -i ${OUT_DIR}/lfs.img 28 ${OUT_DIR}/mklfs -c $SRC_PATH -b 4096 -r 1 -p 1 -s 1048576 -n 1 -l 16 -e 128 -k 500 -i ${OUT_DIR}/lfs.img 29 #cd - 30 python3 ${SCRIPT_PATH}/combination.py --bootloader_path ${SCRIPT_PATH}/gd32_uart_bootloader.bin --kernel_path ${OUT_DIR}/OHOS_Image.bin --file_path ${OUT_DIR}/lfs.img --image_path ${OUT_DIR}/gd32f4xx.bin 31fi 32 33