Projects
Eulaceura:Factory
install-scripts
_service:obs_scm:0001-add-support-for-nvme-disk...
Sign Up
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File _service:obs_scm:0001-add-support-for-nvme-disk.patch of Package install-scripts
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
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.
浙ICP备2022010568号-2