希捷powerchoice磁盘休眠功能arm打包
官方只提供了x86下面的包,没有提供arm下面的包,而我们的arm机器是32位的,需要编译一个支持armhf的二进制文件,这个文件只需要一个即可,但是编译是整套编译的,并且我们需要选定指定的版本,关闭nvme的支持(arm的缺库,也用不上),不带debug信息的
准备编译环境
编译环境选择的是ubuntu 18.04 (X86),在centos下面编译可能出现arm库不对的情况,通常情况下,ubuntu的跨平台编译要好一些,并且我们的arm也是ubuntu的
安装编译软件
apt-get install gcc-arm-linux-gnueabihf
支持arm的编译环境
下载代码
注意要下载这个版本的,其它版本可能发生命令变化,这个无法去一个个确认,这个版本确认可以的
git clone --recursive -b Release-19.06.02 https://github.com/Seagate/openSeaChest.git
进入执行编译命令的目录
root@ubuntu-KVM:~/sea# cd openSeaChest/Make/gcc
root@ubuntu-KVM:~/sea/openSeaChest/Make/gcc# CC=arm-linux-gnueabihf-gcc make
修改Makefile-方便调试编译
clean:
rm -f *.o *.a $(FILE_OUTPUT_
改成
clean:
rm -rf *.o *.a $(FILE_OUTPUT_
这个是可以让每次编译的时候能够清理好环境,有个是目录,这个需要改成r才能删除
报错
In file included from ../../include/platform_helper.h:22:0,
from ../../src/cmds.c:21:
../../include/sg_helper.h:68:35: error: Please define one of the following to include the correct NVMe header: SEA_NVME_IOCTL_H, SEA_NVME_H, or SEA_UAPI_NVME_H
These specify whether the NVMe IOCTL is in /usr/include/linux/nvme_ioctl.h, /usr/include/linux/nvme.h, or /usr/include/uapi/nvme.h
#pragma GCC error "Please define one of the following to include the correct NVMe header: SEA_NVME_IOCTL_H, SEA_NVME_H, or SEA_UAPI_NVME_H\nThese specify whether the NVMe IOCTL is in /usr/include/linux/nvme_ioctl.h, /usr/include/linux/nvme.h, or /usr/include/uapi/nvme.h"
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Makefile:99: recipe for target '../../src/cmds.o' failed
这个报错是出现在编译opensea-transport里面的,我们检查下编译opensea-transport的Makefile
vim ./opensea-transport/Make/gcc/Makefile
#determine the proper NVMe include file. SEA_NVME_IOCTL_H, SEA_NVME_H, or SEA_UAPI_NVME_H
NVME_IOCTL_H = /usr/include/linux/nvme_ioctl.h
NVME_H = /usr/include/linux/nvme.h
UAPI_NVME_H = /usr/include/uapi/nvme.h
可以看到这个地方是引用了本地的头文件,而我们的编译环境是跨平台编译,肯定没这个的arm的引用的,我们可以屏蔽掉这个nvme相关的,这个里面是提供了屏蔽的参数的
root@ubuntu-KVM:~/sea/openSeaChest/Make/gcc# vim Makefile
#add any defines needed for tool release.
#PROJECT_DEFINES += -DDISABLE_NVME_PASSTHROUGH -DDISABLE_TCG_SUPPORT
PROJECT_DEFINES += -DDISABLE_TCG_SUPPORT
ifeq ($(UNAME),FreeBSD)
PROJECT_DEFINES += -DDISABLE_NVME_PASSTHROUGH
endif
修改为
#add any defines needed for tool release.
PROJECT_DEFINES += -DDISABLE_NVME_PASSTHROUGH -DDISABLE_TCG_SUPPORT
#PROJECT_DEFINES += -DDISABLE_TCG_SUPPORT
ifeq ($(UNAME),FreeBSD)
PROJECT_DEFINES += -DDISABLE_NVME_PASSTHROUGH
endif
再次编译
root@ubuntu-KVM:~/sea/openSeaChest/Make/gcc# CC=arm-linux-gnueabihf-gcc make
报错如下
make[1]: Entering directory '/root/sea/openSeaChest/Make/gcc'
mkdir -p openseachest_exes
gcc -Wall -c -std=gnu99 -g -I../../opensea-common/include -I../../opensea-transport/include -I../../opensea-transport/include/vendor -I../../include -I../../opensea-operations/include -DDISABLE_NVME_PASSTHROUGH -DDISABLE_TCG_SUPPORT -D_DEBUG -D_DEBUG ../../utils/C/openSeaChest/openSeaChest_Firmware.c -o ../../utils/C/openSeaChest/openSeaChest_Firmware.o
make[1]: gcc: Command not found
Makefile.openSeaChest_firmware:109: recipe for target '../../utils/C/openSeaChest/openSeaChest_Firmware.o' failed
make[1]: *** [../../utils/C/openSeaChest/openSeaChest_Firmware.o] Error 127
make[1]: Leaving directory '/root/sea/openSeaChest/Make/gcc'
Makefile:210: recipe for target 'openSeaChest_Firmware' failed
可以看到上面出现了gcc,并且有openseachest_exes,这个是调用的另外一个makefile文件出现的,我们检查下makefile文件
root@ubuntu-KVM:~/sea/openSeaChest/Make/gcc# vim Makefile.openSeaChest_firmware
可以看到写死了两个值
CC = gcc
STRIP = strip
我们修改为我们想编译的平台的
CC = arm-linux-gnueabihf-gcc
STRIP = arm-linux-gnueabihf-strip
再次编译,顺利编译成功
root@ubuntu-KVM:~/sea/openSeaChest/Make/gcc# CC=arm-linux-gnueabihf-gcc make
这里编译完成的时候,默认开启了debug,我们需要有个没有debug信息的版本
再次编译
root@ubuntu-KVM:~/sea/openSeaChest/Make/gcc# CC=arm-linux-gnueabihf-gcc make release
注意我们的命令发生了变化,加上了release的后缀,这个是能够提供两个二进制文件的,一个是dbg的一个是剥离了dbg的
检查生成的文件
root@ubuntu-KVM:~/sea/openSeaChest/Make/gcc# ll openseachest_exes/openSeaChest_PowerControl*
-rwxr-xr-x 1 root root 822808 8月 24 17:55 openseachest_exes/openSeaChest_PowerControl*
-rwxr-xr-x 1 root root 1872988 8月 24 17:49 openseachest_exes/openSeaChest_PowerControl_dbg*
root@ubuntu-KVM:~/sea/openSeaChest/Make/gcc# file openseachest_exes/openSeaChest_PowerControl
openseachest_exes/openSeaChest_PowerControl: ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-armhf.so.3, for GNU/Linux 3.2.0, BuildID[sha1]=400fe0fa246e1b57115f6b7a3ea70569fd64efae, with debug_info, not stripped
我们把openSeaChest_PowerControl拷贝到arm的机器上面执行
root@arm23:~# ./openSeaChest_PowerControl -d /dev/sdb --checkPowerMode
==========================================================================================
openSeaChest_PowerControl - openSeaChest drive utilities
Copyright (c) 2014-2020 Seagate Technology LLC and/or its Affiliates, All Rights Reserved
openSeaChest_PowerControl Version: 1.10.0-1_19_24 ARM
Build Date: Aug 24 2020
Today: Mon Aug 24 18:01:55 2020
==========================================================================================
/dev/sdb - ST10000NM0016-1TT101 - ZA2CS3KZ - ATA
Device is in the PM1: Idle state and the device is in the Idle_b power condition
可以看到命令可以执行成功,并且上面也显示的是arm的版本,剩下的具体的设置根据配置文档进行设置即可
变更记录
| Why | Who | When |
|---|---|---|
| 创建 | 武汉-运维-磨渣 | 2020-08-25 |
希捷powerchoice磁盘休眠功能arm打包的更多相关文章
- 希捷powerchoice磁盘休眠功能配置方法
本篇关于希捷磁盘休眠的配置方法 准备设置的软件 下载地址 https://raw.githubusercontent.com/Seagate/ToolBin/master/SeaChest/Power ...
- win7开启休眠功能
win7有的系统默认关机选项没有休眠功能,其实是没打开. cmd-> powercfg -hibernate on 即可
- 使用ntfs的磁盘映射功能
当年95极受欢迎,是作为一个还算真正的32位系统.之前的3.1都是16位为基础的,很多api支持有限.相应的对于硬件性能的发掘还是值得肯定的 98对于95的取代是成功的,我想重要原因是图形尤其是游戏的 ...
- Win7 系统如何关闭休眠功能?(已解决)
一不小心,使用了系统的 休眠 功能. 一开始也没注意. 后来,发现C盘(系统盘)怎么变小了? 一想,应该是休眠的问题. 我就想把它生成的文件给删了. 为此,我特意把 文件夹选项 里的 显示隐藏文件和文 ...
- 关于windows 7系统下开启休眠功能的方法
今天笔者新装了一个windows 7操作系统,装完后,点击开始按钮.鼠标放到关机处的左边扩展选项时,没有发现休眠选项. 于是开始上网查询解决方法,并将过程记录如下: 首先简单的介绍一下休眠功能:休眠( ...
- MAC电脑里的休眠功能在哪里?
Windows7和Ubuntu里都有睡眠和休眠功能,睡眠一般是指挂起到内存,电脑停止运行,数据都在内存里,只需要给内存供电,恢复时很快:休眠是指挂起到硬盘,电脑可以完全停止供电,恢复时从硬盘读取数据, ...
- CDLinux 自动休眠功能的关闭方法
CDLinux 自动休眠功能的关闭方法: 控制台下使用xset命令来完成. xset q 可以查看当前屏幕保护和电源管理的状态信息 具体设置时,常用的有以下参数: xset s //这个参数设置屏 ...
- Ubuntu 16.04 开启休眠功能
因为休眠功能在部分计算机无法正常工作,所以Ubuntu默认是不开启休眠功能. 要想开启休眠功能先进行如下测试: 1.先检查是否有交换分区(swap),如果有确认交换分区至少和实际可用内存一样大. 2. ...
- win7 休眠功能的开启与关闭
1. 打开控制面板得下面目录,编辑计划设置
随机推荐
- 基于python实现链式栈
""" 链式栈 linkstack.py 思路分析: 1.源于链表结构 2.封装栈的操作方法(入栈,出栈,栈空,栈顶) 3.链表的开头作为栈顶(不用每次遍历,效率高,怎样 ...
- 双栈排序(洛谷P1155)二分图的判定+思维贪心
题目:戳这里 题目大意: 给你一个数列,问能否通过两个栈的push与pop把它输出成一个升序序列(每个数只能入队并出队一次) 不能的话输出0,能的话输出操作方法 主要思路: 1.判断是否可以成功输出升 ...
- Privileged Permission开机授权时序图 SourceCode android-10.0.0_r36
Privileged Permission开机授权时序图 | SourceCode:android-10.0.0_r36 | Author:秋城 | v1.1SystemServerSystemSer ...
- ngx_align 值对齐宏
ngx_align 值对齐宏 ngx_align 为nginx中的一个值对齐宏.主要在需要内存申请的地方使用,为了减少在不同的 cache line 中内存而生. // d 为需要对齐的 // a 为 ...
- python去除特殊字符
去除数字,特殊字符,只保留汉字 ? 1 2 3 4 5 6 7 8 import re s = '1123*#$ 中abc国' str = re.sub('[a-zA-Z0-9'!"# ...
- java List<T>和List<Object>的区别
// List<T> 的T表示的是某一类型可以用人一类型来替代,一般在定义的时候使用 // List<Object> 就是具体的了表示这个List里只能放置Object pub ...
- Flutter Webview添加Cookie的正确姿势
场景 h5页面要从cookie里面取数据,所以需要在flutter webview的cookie里面塞一些数据,设置的数据多达十几条:按照网上查的使用方式来设置,通过fiddler抓包发现,只能生效一 ...
- MVC查询
前言 最近没什么好写的,所以写个查询来巩固一下知识 HTML @{ Layout = null; } <!DOCTYPE html> <html> <head> & ...
- v s
关键字volatile是线程同步的轻量级实现,所以volatile性能肯定比synchronized要好,并且只能修改变量,而synchronized可以修饰方法,以及代码块. ...
- Lock接口示例
Lock 的挂起 await() 唤醒signal() Lock 简单示例 public class LockDemo { public static void main(String[] args ...