1# Copyright (c) 2021-2022 iSoftStone Device Co., Ltd. 2# Licensed under the Apache License, Version 2.0 (the "License"); 3# you may not use this file except in compliance with the License. 4# You may obtain a copy of the License at 5# 6# http://www.apache.org/licenses/LICENSE-2.0 7# 8# Unless required by applicable law or agreed to in writing, software 9# distributed under the License is distributed on an "AS IS" BASIS, 10# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11# See the License for the specific language governing permissions and 12# limitations under the License. 13 14set -e 15 16usage() { 17 cat >&2 << USAGE 18usage: $0 [-H] --dtb DTB 19 20optional arguments: 21 -H, --help show this help message and exit 22 --dtb DTB the dtb file name 23USAGE 24} 25 26function move_dtb_file() { 27 cd $SRC_DIR 28 mv $OBJ_FILE $PRC_FILE $OBJ_DIR 29 cd - 30} 31 32# Parse command-line arguments 33while [ $# -gt 0 ]; do 34 case $1 in 35 --mv) 36 SRC_DIR=$2 37 OBJ_DIR=$3 38 OBJ_FILE=$4 39 PRC_FILE=$5 40 move_dtb_file 41 shift 5 42 ;; 43 -H | --help) 44 usage 45 exit 0 46 ;; 47 *) 48 shift 49 ;; 50 esac 51done 52