test-definitions/blob/estuary-dev/ubuntu/scripts/acpi-check.sh

#! /bin/sh

DSDTPASS=
#通过echo输出log 并换行
echo -n "Testing presence of /sys/firmware/acpi: "
#检查是否存在/sys/firmware/acpi 这个目录
if [ -d /sys/firmware/acpi ]; then
	echo PASS
else
	echo FAIL
fi

echo -n "Testing presence of /sys/firmware/acpi/tables/DSDT: "
#检查是否存在这个文件/sys/firmware/acpi/tables/DSDT
if [ -f /sys/firmware/acpi/tables/DSDT ]; then
	#输出PASS,并给DSDTPASS 赋值
	echo PASS
	DSDTPASS=pass
else
	echo FAIL
fi

echo -n "Can decompile DSDT: "
#-x 检查/usr/bin/iasl 是个可以执行,-a 表示and -n 表示DSDTPASS 不为null
if [ -x /usr/bin/iasl -a -n "$DSDTPASS" ]; then
	#copy 文件到目录
	cp /sys/firmware/acpi/tables/DSDT /tmp/
	#用飘键得到执行的结果,这里是反汇编DSDT表
	ERROR=`/usr/bin/iasl -d /tmp/DSDT 2>&1 | grep DSDT.dsl`
	#判断反汇编的结果是否为null
	if [ -n "$ERROR" ]; then
		echo PASS
	else
		echo FAIL
	fi
	#删除临时文件
	rm /tmp/DSDT /tmp/DSDT.dsl
else
	echo SKIP
fi

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值