当前位置:网站首页>BOA服务器移植之嵌入式开发板(FS4412)
BOA服务器移植之嵌入式开发板(FS4412)
2022-08-03 05:26:00 【当然是菜包啦】
前言
续前面boa移植链接: boa服务器移植,在这基础之上,更改编译方式,使其boa服务器能够在开发板上运行,然后能够在电脑上访问服务器。
BOA服务器在开发板(fs4412)的移植过程
- 查看交叉编译器的类型,并查看选中的工具链,我这里用的是gcc-4.6.4版本
[email protected]:~$ cd /home/linux/fs4412/toolchain/gcc-4.6.4/bin
[email protected]:~/fs4412/toolchain/gcc-4.6.4/bin$ ls
2. 指定交叉编译工具链
[email protected]:~$ cd boa-0.94.13/src/
[email protected]:~/boa-0.94.13/src$ vi Makefile
将Makefile中的指定编译器改为
# CC = gcc
CC = arm-none-linux-gnueabi-gcc
- 删除原来编译的文件,重新编译
[email protected]:~/boa-0.94.13/src$ make clean
[email protected]:~/boa-0.94.13/src$ make
- 将编译生成的文件拷贝到之前的boa文件夹下,查看拷贝文件的属性是支持在ARM平台下运行的文件
[email protected]:~/boa-0.94.13/src$ cp boa /home/linux/boa/
[email protected]:~/boa-0.94.13/src$ cp boa_indexer /home/linux/boa/
[email protected]:~/boa-0.94.13/src$ file boa
boa: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.38, not stripped
[email protected]:~/boa-0.94.13/src$ file boa_indexer
boa_indexer: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.38, not stripped
- 将boa/cgi-bin/目录下test.c重新编译
[email protected]:~/boa/cgi-bin$ arm-none-linux-gnueabi-gcc -o test.cgi test.c
[email protected]:~/boa/cgi-bin$ file test.cgi
test.cgi: ELF 32-bit LSB executable, ARM, EABI5 version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.38, not stripped
[email protected]:~/boa/cgi-bin$
- 将整个/boa目录复制到,nfs共享跟目录下面
[email protected]:~$ sudo cp -rf boa/ /opt/4412/rootfs/
- 测试,在电脑(ubuntu)中浏览器进行访问
出现了这样的一个错误,/home/linux/boa这个目录在开发板上找不到,所以我们需要查看这个boa在开发板的目录,更改某个头文件路径和配置文件。
[email protected]:~/boa-0.94.13/src$ vi defines.h +30
将
#define SERVER_ROOT "/home/linux/boa"
改为:
#define SERVER_ROOT "/boa"
将配置文件boa.conf也修改
然后删除原来编译的文件重新编译,重新拷贝文件过去
[email protected]:~/boa-0.94.13/src$ make clean
[email protected]:~/boa-0.94.13/src$ make
[email protected]:~/boa-0.94.13/src$ sudo cp boa /opt/4412/rootfs/boa/
[email protected]:~/boa-0.94.13/src$ sudo cp boa_indexer /opt/4412/rootfs/boa/
重新执行
在电脑(ubuntu)上访问开发板的网址
在点跳转的时候出现了一个错误
查看log下的日志文件显示以下信息:
[01/Jan/1970:00:00:53 +0000] boa.c:211 - getpwuid: No such file or directory
解决办法:将boa.c中的drop_privs函数以下几行注释掉
#if 0
if (passwdbuf == NULL) {
DIE("getpwuid");
}
if (initgroups(passwdbuf->pw_name, passwdbuf->pw_gid) == -1) {
DIE("initgroups");
}
#endif
然后重新编译拷贝boa文件到nfs共享目录下
太难了,点个赞吧!
边栏推荐
猜你喜欢
随机推荐
八、抽象类的接口的区别
Phase Vocoder的补充完善,Matlab音频变速不变调、变调不变速
MATLAB自带的dwt2和wavedec2函数实现基于小波变换的自适应阈值图像边缘检测
VS2022 encapsulation under Windows dynamic library and dynamic library calls
内网渗透信息收集
All-round interpretation of POE switches (middle)
ZEMAX | 绘图分辨率结果对光线追迹的影响
电容器和电池有什么不同?
POE交换机全方位解读(中)
二分查找1-实现一个二分查找
ARP协议及简单路由器原理(1)
2. What is the difference between Exception and Error?
appium(3)webview测试
一文看懂常见域名后缀的含义
二分查找5 - 第一个错误的版本
classpath: comparison with classpath*
MCU接收串口字符型数据转换成数据型数据
ZEMAX | 在OpticStudio中建立扩增实境(VR)头戴式显示器
使用JSP实现简单的登录注册功能,并且使用Session跟踪用户登录信息
ZEMAX | 如何创建复杂的非序列物体