1#!/bin/sh 2################################################################################ 3# 4# Copyright (C) 2022 Huawei Device Co., Ltd. 5# SPDX-License-Identifier: GPL-2.0 6# 7# Unless required by applicable law or agreed to in writing, software 8# distributed under the License is distributed on an "AS IS" BASIS, 9# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 10# See the License for the specific language governing permissions and 11# limitations under the License. 12# 13################################################################################ 14# File: enhancedf2fs01.sh 15# 16# Description: enhancedf2fs_t testsuite init script 17# 18# Authors: Li Zhanming - lizhanming3@h-partners.com 19# 20# History: April 8 2022 - init scripts 21# 22################################################################################ 23 24create_catalogue() 25{ 26 export DISK_PATH="/data" 27 export DISK_NAME=$(df -h |grep /dev/block |grep $DISK_PATH |awk '{print $1}' |cut -d "/" -f4) 28} 29 30test_remount() 31{ 32 gc_merge_mount_opt=$(mount |grep gc_merge) 33 if [[ "$gc_merge_mount_opt" == "" ]] ;then 34 mount -o remount,gc_merge $DISK_PATH/ 35 mount -o remount,nogc_merge $DISK_PATH/ 36 else 37 mount -o remount,nogc_merge $DISK_PATH/ 38 mount -o remount,gc_merge $DISK_PATH/ 39 fi 40 mount -o remount,rw $DISK_PATH/ 41} 42 43enable_init() 44{ 45 46} 47 48echo "***************************ENHANCED INIT START***************************" 49create_catalogue 50test_remount 51enable_init 52echo "***************************ENHANCED INIT END*****************************" 53