当前位置:网站首页>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共享目录下
太难了,点个赞吧!
边栏推荐
猜你喜欢
随机推荐
树——二叉排序树(BST)
PCB设计经验之模拟电路和数字电路区别为何那么大
用DirectX12绘制一个几何体的程序详述
SSL证书过期后怎么办?
【面筋1】一些没什么标准答案的问题
【随笔】把喜欢的事情提上日程吧
【记录】把json的所有key转换成小写
【测试基础】bug分级、测试流程、ISO9126质量模型
Dynamic adjustment of web theme (2) Extraction
9. Please introduce the class loading process, what is the parent delegation model?
使用Blender和ZBrush制作武器模型
ZEMAX | 如何创建简单的非序列系统
【随笔】平常心
VS2022 encapsulation under Windows dynamic library and dynamic library calls
剑指 Offer II 001. 整数除法
数组与字符串8-最长回文子串
Makefile.am:24: error: Libtool library used but ‘LIBTOOL‘ is undefined
JS--正则表达式
【七夕特效】 -- 满屏爱心
【3D建模制作技巧分享】ZBrush快捷键如何设置