CUPS移植记录

CUPS,即Common Unix Printing System 是一个UNIX系统下的打印管理程序。
移植编译过程:

#!/bin/sh  

# 1.下载源码  
wget http://www.cups.org/software/1.3.9/cups-1.3.9-source.tar.gz &&  

# 2.解压并打开  
tar xvzf cups-1.3.9-source.tar.gz && cd cups-1.3.9 &&  

# 3.配置  
./configure --host=arm-linux --target=arm-linux --build=i686-linux CC=arm-linux-gcc CXX=arm-linux-g++ LD=arm-linux-ld RANLIB=arm-linux-ranlib AR=arm-linux-ar  --disable-gnutls --disable-gssapi --disable-dbus --prefix=/ &&  

# 4.修改Makefile使其不编译man  
sed -i '22s/locale man monitor/locale monitor/' ./Makefile  &&  

# 5.编译并安装  
make && make install DSTROOT=${PWD}/_install &&  

echo "cups build install ok!"

部署到目标板子上后,正常情况下启动CUPS:

# /etc/init.d/cups start
cups: started scheduler.
# 
# lpinfo -v
network socket
network http
network ipp
network lpd
direct scsi
#
# lpadmin 
Usage:

    lpadmin [-h server] -d destination
    lpadmin [-h server] -x destination
    lpadmin [-h server] -p printer [-c add-class] [-i interface] [-m model]
                       [-r remove-class] [-v device] [-D description]
                       [-P ppd-file] [-o name=value]
                       [-u allow:user,user] [-u deny:user,user]

以下是会遇到问题:

1. busybox的PS命令和PC端不一致

# /etc/init.d/cups start
ps: invalid option -- 'a'
BusyBox v1.17.2 (2010-12-30 11:13:11 HKT) multi-call binary.

Usage: ps 

Show list of processes

Options:
        w       Wide output

解决方法:
将/etc/init.d/cups的162行ps ax改为ps w改后如下:

pid=`ps w | awk '{if (match($5, ".*/cupsd$") || $5 == "cupsd") print $1}'` 

2. 库文件路径不正确

# lpstat
lpstat: error while loading shared libraries: libcups.so.2: cannot open shared object file: No such file or directory

解决方法:
这些库文件存在于/usr/lib64目录下,一种方法是将/usr/lib64也作为运行库目录;另一种方法是将/usr/lib64目录下的内容拷贝到/usr/lib目录下解决问题。cp usr/lib64/* /usr/lib/

3. error while loading shared libraries: libssl.so libcrypto.so.1.0.0

# /etc/init.d/cups start
/usr/sbin/cupsd: error while loading shared libraries: libssl.so.1.0.0: cannot open shared object file: No such file or directory
/usr/sbin/cupsd: error while loading shared libraries: libcrypto.so.1.0.0: cannot open shared object file: No such file or directory
cups: unable to start scheduler.

解决方法:将交叉工具链中的库拷贝进来。

  • 3
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 4
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

袁保康

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值