1#!/bin/sh 2################################################################################ 3# 4# Copyright (C) 2022 Huawei Device Co., Ltd. 5# SPDX-License-Identifier: GPL-2.0 6# 7# Legacy blkg rwstat helpers enabled by CONFIG_BLK_CGROUP_RWSTAT. 8# Do not use in new code. 9# 10# Unless required by applicable law or agreed to in writing, software 11# distributed under the License is distributed on an "AS IS" BASIS, 12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13# See the License for the specific language governing permissions and 14# limitations under the License. 15# 16################################################################################ 17# File: mem_debug_t_init.sh 18# 19# Description: mem_debug_t testsuite init script 20# 21# Authors: Wang Yuting - wangyuting36@huawei.com 22# 23# History: May 25 2022 - init scripts 24# 25################################################################################ 26 27pre_condition() 28{ 29 30} 31 32hp_init() 33{ 34 dd if=/dev/random of=/data/hpdisk bs=4096 count=131072 35 losetup /dev/block/loop6 /data/hpdisk 36 hyperhold_device=$(cat /proc/sys/kernel/hyperhold/device) 37 echo /dev/block/loop6 > /proc/sys/kernel/hyperhold/device 38} 39 40hp_enable() 41{ 42 hyperhold_enable=$(cat /proc/sys/kernel/hyperhold/enable) 43 echo enable > /proc/sys/kernel/hyperhold/enable 44} 45 46zram_init() 47{ 48 zram0_group=$(cat /sys/block/zram0/group) 49 zram0_disksize=$(cat /sys/block/zram0/disksize) 50 echo readwrite > /sys/block/zram0/group 51 echo 512M > /sys/block/zram0/disksize 52} 53 54zram_enable() 55{ 56 mkswap /dev/block/zram0 57 swapon /dev/block/zram0 58 aa start -b com.ohos.settings -a com.ohos.settings.MainAbility 59 aa start -b ohos.samples.airquality -a ohos.samples.airquality.default 60 aa start -b ohos.samples.ecg -a ohos.samples.ecg.MainAbility 61 aa start -b ohos.samples.flashlight -a ohos.samples.flashlight.default 62 aa start -b ohos.samples.clock -a ohos.samples.clock.default 63} 64 65echo "***************************MEMDEBUG INIT START***************************" 66free -m 67pre_condition 68hp_init 69hp_enable 70zram_init 71zram_enable 72echo "***************************MEMDEBUG INIT END***************************"