代码拉取完成,页面将自动刷新
From 9a79f592594de97520b38c8d09a8a36f7aabfcd2 Mon Sep 17 00:00:00 2001
From: Qiumiao Zhang <zhangqiumiao1@huawei.com>
Date: Thu, 23 Jun 2022 11:30:26 +0800
Subject: [PATCH] add support for nvme disk
---
usr/Euler/project/disk/hwcompatible.sh | 24 ++++++++++++++++++++----
1 file changed, 20 insertions(+), 4 deletions(-)
diff --git a/usr/Euler/project/disk/hwcompatible.sh b/usr/Euler/project/disk/hwcompatible.sh
index 3b2da05..97f3b78 100644
--- a/usr/Euler/project/disk/hwcompatible.sh
+++ b/usr/Euler/project/disk/hwcompatible.sh
@@ -77,7 +77,11 @@ function DM_GetPartitionName()
echo "${disk_dev}p${partition_count}"
;;
*)
- echo "${disk_dev}${partition_count}"
+ if [[ ${disk_dev} == /dev/nvme* ]]; then
+ echo "${disk_dev}p${partition_count}"
+ else
+ echo "${disk_dev}${partition_count}"
+ fi
;;
esac
@@ -116,7 +120,11 @@ function DM_GetPartitionNumber()
echo "${partition_name}" | sed "s ${disk_dev}p "
;;
*)
- echo "${partition_name}" | sed "s ${disk_dev} "
+ if [[ ${disk_dev} == /dev/nvme* ]]; then
+ echo "${partition_name}" | sed "s ${disk_dev}p "
+ else
+ echo "${partition_name}" | sed "s ${disk_dev} "
+ fi
;;
esac
@@ -266,7 +274,11 @@ function DM_GetGrubInfo()
disk_dev="`hwinfo --disk --short | awk '{print $1}' | grep -w "${disk_dev}"`"
;;
*)
- disk_dev="`echo ${partition_info} | awk -F "/" '{print $NF}' | sed "s ${partition_id}$ "`"
+ if [[ ${partition_info} == */nvme* ]]; then
+ disk_dev="`echo ${partition_info} | awk -F "/" '{print $NF}' | sed "s p${partition_id}$ "`"
+ else
+ disk_dev="`echo ${partition_info} | awk -F "/" '{print $NF}' | sed "s ${partition_id}$ "`"
+ fi
harddisk_id="`echo ${disk_dev} | awk '{print substr($NF,length($NF),1)}'`"
command="`printf "%d" "'${harddisk_id}"` - `printf "%d" "'a"`"
disk_dev="`hwinfo --disk --short | awk '{print $1}' | grep -w "${disk_dev}"`"
@@ -282,7 +294,11 @@ function DM_GetGrubInfo()
command="`printf "%d" "'${harddisk_id}"` - `printf "%d" "'0"`"
;;
*)
- disk_dev="`echo ${partition_name} | sed "s ${partition_id}$ "`"
+ if [[ ${partition_name} == */nvme* ]]; then
+ disk_dev="`echo ${partition_name} | sed "s p${partition_id}$ "`"
+ else
+ disk_dev="`echo ${partition_name} | sed "s ${partition_id}$ "`"
+ fi
harddisk_id="`echo ${disk_dev} | awk -F "/" '{print substr($NF,length($NF),1)}'`"
command="`printf "%d" "'${harddisk_id}"` - `printf "%d" "'a"`"
;;
--
2.19.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。