当前位置:网站首页>onie支持pice硬盘
onie支持pice硬盘
2022-07-06 07:39:00 【菜菜的阿庄】
文章目录
引言
我们知道,SATA硬盘和pcie硬盘的dev设备名不一样:
SATA设备名一般是是sd*,例如sda sdb,分区后设备名为sda1,sda2等;
而pcie接口硬盘设备名一般是nvme0n*,分区后设备名为nvme0n1p1 nvme0n1p2等。
onie中怎么支持将onie安装到指定硬盘上的呢?
onie支持pice类型硬盘
在 installer/grub-arch/install-arch 中的 install_image 接口中,将 $onie_dev 变量作为onie安装位置,从 echo "Installing ONIE on: $onie_dev"也可以看出这点。onie_dev 变量是在 init_onie_install 接口中,通过 [ -b "$onie_dev" ] || onie_dev="$(install_device_platform)" 定义了的。
因此,需要支持指定的硬盘,只需要在自己的vendor_modules下重载 install_device_platform 接口,并返回相应的硬盘设备名。例如支持nvme硬盘:
install_device_platform()
{
mass_bus="nvme0"
for i in 1 2 3 4 ; do
if $(ls -l /sys/block/nvme0n$i/device 2>/dev/null | grep -q "$mass_bus") ; then
echo "/dev/nvme0n$i"
return 0
fi
done
echo "storage-not-found"
return 1
}
接口只要返回/dev/nvme0n1即可。
同样如果需要将onie安装到SATA硬盘或U盘,接口返回/dev/sda /dev/sdb等即可.
边栏推荐
- Ble of Jerry [chapter]
- Set picture annotation in markdown
- Get/post/put/patch/delete meaning
- NiO programming introduction
- Excel的相关操作
- Launch APS system to break the problem of decoupling material procurement plan from production practice
- 软件测试界的三无简历,企业拿什么来招聘你,石沉大海的简历
- TypeScript 函数定义
- TS类型体操 之 字符串的妙用
- 智能终端设备加密防护的意义和措施
猜你喜欢

烧录场景下的源代码防泄密方案分享

Related operations of Excel
![Ble of Jerry [chapter]](/img/00/27486ad68bf491997d10e387c32dd4.png)
Ble of Jerry [chapter]

In the era of digital economy, how to ensure security?
![[computer skills]](/img/30/2a4506adf72eb4cb188dd64cce417d.jpg)
[computer skills]

Pre knowledge reserve of TS type gymnastics to become an excellent TS gymnastics master

杰理之BLE【篇】

Summary of Digital IC design written examination questions (I)

How to delete all the words before or after a symbol in word

Set picture annotation in markdown
随机推荐
Basics of reptile - Scratch reptile
C # connect to SQLite database to read content
剪映的相关介绍
Database addition, deletion, modification and query
Typescript function definition
Scala语言学习-08-抽象类
成为优秀的TS体操高手 之 TS 类型体操前置知识储备
[MySQL learning notes 30] lock (non tutorial)
word中如何删除某符号前面或后面所有的文字
【Redis】NoSQL数据库和redis简介
Simulation of holographic interferogram and phase reconstruction of Fourier transform based on MATLAB
Emo diary 1
Jerry's general penetration test - do data transmission with app Communication [article]
杰理之普通透传测试---做数传搭配 APP 通信【篇】
学go之路(一)go的基本介绍到第一个helloworld
TS 类型体操 之 extends,Equal,Alike 使用场景和实现对比
If Jerry's Bluetooth device wants to send data to the mobile phone, the mobile phone needs to open the notify channel first [article]
Three no resumes in the software testing industry. What does the enterprise use to recruit you? Shichendahai's resume
上线APS系统,破除物料采购计划与生产实际脱钩的难题
CF1036C Classy Numbers 题解