登录
注册
开源
企业版
高校版
搜索
帮助中心
使用条款
关于我们
开源
企业版
高校版
私有云
模力方舟
登录
注册
代码拉取完成,页面将自动刷新
开源项目
>
其他开源
>
操作系统
&&
捐赠
捐赠前请先登录
取消
前往登录
扫描微信二维码支付
取消
支付完成
支付提示
将跳转至支付宝完成支付
确定
取消
Watch
不关注
关注所有动态
仅关注版本发行动态
关注但不提醒动态
32
Star
87
Fork
61
openEuler
/
sysmaster
代码
Issues
5
Pull Requests
0
Wiki
统计
流水线
服务
质量分析
Jenkins for Gitee
腾讯云托管
腾讯云 Serverless
悬镜安全
阿里云 SAE
Codeblitz
SBOM
我知道了,不再自动展开
752
devmaster新增支持ata_id外置命令
已关闭
用户已删除:master
openEuler:master
xujing
创建于 2023-08-10 17:29
克隆/下载
HTTPS
SSH
复制
下载 Email Patch
下载 Diff 文件
# 描述 1、devmaster新增支持ata_id外置命令; 2、修复replace_whitespace行为与udev不一致的问题。 # 自测验证 ## CD类型的ATA设备验证(调用 disk_command(..., DiskCmdType::IdentifyPacketDevice)) ### 添加调试打印验证 systemd ata_id在调用disk_indetify之后的identify内容: gdb /usr/lib/udev/ata_id  devmaster ata_id在调用disk_indetify之后的identify内容: ./target/debug/ata_id -x /dev/sr0  **内容一致,符合预期** ### 使用`-x`选项验证 systemd ata_id 与 devmaster ata_id 回显一致: /usr/lib/udev/ata_id -x /dev/sr0 ./target/debug/ata_id -x /dev/sr0  **符合预期** ### 不使用`-x`选项验证 systemd ata_id 与 devmaster ata_id 回显一致: /usr/lib/udev/ata_id /dev/sr0 ./target/debug/ata_id /dev/sr0 `VMware_Virtual_IDE_CDROM_Drive_10000000000000000001` **符合预期** ## DISK类型的ATA设备验证(调用 disk_command(..., DiskCmdType::Identify)) ### 添加调试打印验证 systemd ata_id在调用disk_indetify之后的identify内容: gdb /usr/lib/udev/ata_id ``` 448 if (disk_identify(fd, identify.byte, &is_packet_device) == 0) { (gdb) 387 return ret; (gdb) 453 disk_identify_fixup_string(identify.byte, 10, 20); /* serial */ (gdb) p/u identify.byte $1 = {64, 0, 255, 63, 0, 0, 16, 0, 0, 126, 0, 2, 63, 0, 0, 0, 0, 0, 0, 0, 77, 81, 48, 48, 48, 48, 32, 49, 32 <repeats 12 times>, 3, 0, 0, 2, 4, 0, 46, 50, 43, 53, 32, 32, 32, 32, 69, 81, 85, 77, 72, 32, 82, 65, 68, 68, 83, 73, 32, 75, 32 <repeats 26 times>, 16, 128, 1, 0, 0, 11, 0, 0, 0, 2, 0, 2, 7, 0, 255, 63, 16, 0, 63, 0, 16, 252, 251, 0, 16, 1, 0, 0, 128, 12, 7, 0, 7, 4, 3, 0, 120, 0, 120, 0, 120, 0, 120, 0, 0, 64, 0 <repeats 20 times>, 240, 0, 22, 0, 33, 64, 0, 116, 0, 64, 33, 64, 0, 52, 0, 64, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 96, 0 <repeats 14 times>, 128, 12, 0, 0, 0, 0, 0, 0, 0, 0, 0, 96, 0 <repeats 124 times>, 1, 0 <repeats 173 times>} (gdb) ``` devmaster ata_id在调用disk_indetify之后的identify内容: ./target/debug/ata_id -x /dev/sda ``` [root@localhost ata_id]# ./target/debug/ata_id /dev/sda identify_byte = [64, 0, 255, 63, 0, 0, 16, 0, 0, 126, 0, 2, 63, 0, 0, 0, 0, 0, 0, 0, 77, 81, 48, 48, 48, 48, 32, 49, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 3, 0, 0, 2, 4, 0, 46, 50, 43, 53, 32, 32, 32, 32, 69, 81, 85, 77, 72, 32, 82, 65, 68, 68, 83, 73, 32, 75, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 32, 16, 128, 1, 0, 0, 11, 0, 0, 0, 2, 0, 2, 7, 0, 255, 63, 16, 0, 63, 0, 16, 252, 251, 0, 16, 1, 0, 0, 128, 12, 7, 0, 7, 4, 3, 0, 120, 0, 120, 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, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] ``` **内容一致,符合预期** ### 使用`-x`选项验证 systemd ata_id 与 devmaster ata_id 回显一致: /usr/lib/udev/ata_id -x /dev/sda ./target/debug/ata_id -x /dev/sda ``` ID_ATA=1 ID_TYPE=disk ID_BUS=ata ID_MODEL=QEMU_HARDDISK ID_MODEL_ENC=QEMU\x20HARDDISK\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20 ID_REVISION=2.5+ ID_SERIAL=QEMU_HARDDISK_QM00001 ID_SERIAL_SHORT=QM00001 ID_ATA_WRITE_CACHE=1 ID_ATA_WRITE_CACHE_ENABLED=1 ID_ATA_FEATURE_SET_SMART=1 ID_ATA_FEATURE_SET_SMART_ENABLED=1 ``` **符合预期** ### 不使用`-x`选项验证 systemd ata_id 与 devmaster ata_id 回显一致: /usr/lib/udev/ata_id /dev/sda ./target/debug/ata_id /dev/sda `QEMU_HARDDISK_QM00001` **符合预期**
此 Pull Request 需要通过一些审核项
类型
指派人员
状态
审查
hexiaowen
syyhao
love_hangzhou
licunlong
chenjiayi
xuxiaozhou1
已完成
(0/0人)
怎样手动合并此 Pull Request
git checkout master
git pull https://gitee.com/openeuler/sysmaster.git master
git push origin master
质量门禁通过
查看扫描报告
评论
17
提交
2
文件
5
检查
代码问题
0
批量操作
展开设置
折叠设置
审查
Code Owner
审查人员
yanan-rock
yanan-rock
dracoding
dracoding
myeuler
myeuler
licunlong
licunlong
xuxiaozhou1
xuxiaozhou1
chenjiayi
jiayi0118
Monday
licihua
forrest_ly
forrest_ly
ethan848
ethan848
fcwicky
fcwicky
jingxiaolu
jingxiaolu
hexiaowen
overweight
love_hangzhou
love_hangzhou
syyhao
shenyangyang01
未设置
最少人数
0
测试
yanan-rock
yanan-rock
dracoding
dracoding
myeuler
myeuler
licunlong
licunlong
xuxiaozhou1
xuxiaozhou1
chenjiayi
jiayi0118
Monday
licihua
forrest_ly
forrest_ly
ethan848
ethan848
fcwicky
fcwicky
jingxiaolu
jingxiaolu
hexiaowen
overweight
love_hangzhou
love_hangzhou
未设置
最少人数
0
优先级
不指定
严重
主要
次要
不重要
标签
openeuler-cla/yes
ci_failed
sig/dev-utils
stat/needs-squash
关联 Issue
未关联
Pull Request 合并后将关闭上述关联 Issue
里程碑
未关联里程碑
参与者
(2)
Rust
1
https://gitee.com/openeuler/sysmaster.git
git@gitee.com:openeuler/sysmaster.git
openeuler
sysmaster
sysmaster
点此查找更多帮助
搜索帮助
Git 命令在线学习
如何在 Gitee 导入 GitHub 仓库
Git 仓库基础操作
企业版和社区版功能对比
SSH 公钥设置
如何处理代码冲突
仓库体积过大,如何减小?
如何找回被删除的仓库数据
Gitee 产品配额说明
GitHub仓库快速导入Gitee及同步更新
什么是 Release(发行版)
将 PHP 项目自动发布到 packagist.org
仓库举报
回到顶部
登录提示
该操作需登录 Gitee 帐号,请先登录后再操作。
立即登录
没有帐号,去注册