官方只提供了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打包的更多相关文章

  1. 希捷powerchoice磁盘休眠功能配置方法

    本篇关于希捷磁盘休眠的配置方法 准备设置的软件 下载地址 https://raw.githubusercontent.com/Seagate/ToolBin/master/SeaChest/Power ...

  2. win7开启休眠功能

    win7有的系统默认关机选项没有休眠功能,其实是没打开. cmd-> powercfg -hibernate on   即可

  3. 使用ntfs的磁盘映射功能

    当年95极受欢迎,是作为一个还算真正的32位系统.之前的3.1都是16位为基础的,很多api支持有限.相应的对于硬件性能的发掘还是值得肯定的 98对于95的取代是成功的,我想重要原因是图形尤其是游戏的 ...

  4. Win7 系统如何关闭休眠功能?(已解决)

    一不小心,使用了系统的 休眠 功能. 一开始也没注意. 后来,发现C盘(系统盘)怎么变小了? 一想,应该是休眠的问题. 我就想把它生成的文件给删了. 为此,我特意把 文件夹选项 里的 显示隐藏文件和文 ...

  5. 关于windows 7系统下开启休眠功能的方法

    今天笔者新装了一个windows 7操作系统,装完后,点击开始按钮.鼠标放到关机处的左边扩展选项时,没有发现休眠选项. 于是开始上网查询解决方法,并将过程记录如下: 首先简单的介绍一下休眠功能:休眠( ...

  6. MAC电脑里的休眠功能在哪里?

    Windows7和Ubuntu里都有睡眠和休眠功能,睡眠一般是指挂起到内存,电脑停止运行,数据都在内存里,只需要给内存供电,恢复时很快:休眠是指挂起到硬盘,电脑可以完全停止供电,恢复时从硬盘读取数据, ...

  7. CDLinux 自动休眠功能的关闭方法

    CDLinux 自动休眠功能的关闭方法: 控制台下使用xset命令来完成. xset q  可以查看当前屏幕保护和电源管理的状态信息 具体设置时,常用的有以下参数: xset s  //这个参数设置屏 ...

  8. Ubuntu 16.04 开启休眠功能

    因为休眠功能在部分计算机无法正常工作,所以Ubuntu默认是不开启休眠功能. 要想开启休眠功能先进行如下测试: 1.先检查是否有交换分区(swap),如果有确认交换分区至少和实际可用内存一样大. 2. ...

  9. win7 休眠功能的开启与关闭

    1. 打开控制面板得下面目录,编辑计划设置

随机推荐

  1. Verilog基础入门——简单的语句块编写(一)

    [题干] [代码] module top_module ( input in, output out ); assign out = ~in; endmodule 简单的实现一个非门

  2. Kibana基础之直接操作ElasticSearch

    1.入门级别操作 Elasticsearch采用Rest风格API,其API就是一次http请求,你可以用任何工具发起http请求 创建索引的请求格式: 请求方式:PUT 请求路径:/索引库名 请求参 ...

  3. 【树形DP】CF 1293E Xenon's Attack on the Gangs

    题目大意 vjudge链接 给n个结点,n-1条无向边.即一棵树. 我们需要给这n-1条边赋上0~ n-2不重复的值. mex(u,v)表示从结点u到结点v经过的边权值中没有出现的最小非负整数. 计算 ...

  4. centos8平台用ss监控网络

    一,ss所属的包: [root@blog ~]# whereis ss ss: /usr/sbin/ss /usr/share/man/man8/ss.8.gz [root@blog ~]# rpm ...

  5. svn:E170001:Authorization failed解决

    eclipse添加svn资源库:打开eclipse→Window→SVN资源库→空白处右键新建资源库位置→填写正确的URL→finish 错误信息: 原因一:用户名或密码错误 因svn登录验证的账号信 ...

  6. ThreeJS学习6_几何体相关(BufferGeometry)

    ThreeJS学习6_几何体相关(BufferGeometry) 使用 BufferGeometry 可以有效减少向 GPU 传输几何体相关数据所需的开销 可以自定义顶点位置, 面片索引, 法向量, ...

  7. django—Form组件校验方法(is_valid)执行流程

    1.从is_valid方法入手 def is_valid(self): """Return True if the form has no errors, or Fals ...

  8. 第12天 | 12天搞定Python,让excel飞起来

    学了10多天Python基础知识了,是时候来点硬货了,看过<第1天 | 12天搞定Python,告诉你有什么用?>的老铁都知道,Python可用的领域挺多的.只是我长期待在企业,所以只能说 ...

  9. java 第一课 笔记

    java是一种解释型语言 Java提供了内存自动管理:不涉及指针:单继承. classpath:字节码文件的路径,执行java.exe时,会查找并解释*.class文件 set classpath=. ...

  10. mininet实践应用

    目录 mininet的安装和基本指令的了解 安装过程 拓扑类型和基本指令 mininet拓扑实战 拓扑的创建和编辑 对自定义拓扑一些简单的测试. 测试总结 mininet的安装和基本指令的了解 安装过 ...