Installing packages to N800 from source

本文详细介绍如何为特定设备如N800定制并构建deb安装包,包括使用dpkg-buildpackage工具自动化编译和打包过程,以及如何修改debian/control文件以适配不同系统的目录结构。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

For example, get a package called "gst-plugins-good0.10":
Terminal 代码
  1. [sbox-SDK_ARMEL: ~] fakeroot apt-get update   
  2. [sbox-SDK_ARMEL: ~] fakeroot apt-get build-dep gst-plugins-good0.10    
  3. [sbox-SDK_ARMEL: ~] fakeroot apt-get source gst-plugins-good0.10   
  4. [sbox-SDK_ARMEL: ~] cd gst-plugins-good0.10-0.10.4-osso2  

Edit debian/control file for installation:

Terminal 代码
  1. [sbox-SDK_ARMEL: ~/gst-plugins-good0.10-0.10.4-osso2] vim debian/control  

The default file is prepared for Linux desktop, not N800.  

So change "Sections: utils" into "Sections: user/utils" in each package of control file.

It is because N800 puts all user datas under "user/" directory, while as other system folders are not visible.

All other sections written in control should alse be changed.

Known sections: utils, libs, devel...

Next, to build ded package which would be installable on N800:

Terminal 代码
  1. [sbox-SDK_ARMEL: ~/gst-plugins-good0.10-0.10.4-osso2] dpkg-buildpackage -rfakeroot -b  

It will take some time.

After that, *.deb (could be 2 files or more) will appear in the home folder of scratchbox. (that is /scratchbox/user/cloud/home/cloud/)

Copy your own *.deb into N800.

If you see "Unable to install. Imcompatible package" while installing, mostly, your control file is not working correctly.

Check it out and do the packaging again.


We don't need to run:

Terminal 代码
  1. [sbox-SDK_ARMEL: ~/gst-plugins-good0.10-0.10.4-osso2] ./configure   
  2. [sbox-SDK_ARMEL: ~/gst-plugins-good0.10-0.10.4-osso2] make  

before dpkg-buildpackage, since it automatically runs both of them before packaging by default, which is controlled in /debian/rules.

However, if the sources have been modified, to save some time probably, run make to find errors before dpkg-buildpackage.

Another way of packaging:

The deb packaging process (dpkg-buildpackage) is totally controlled by the debian/ directory. But, some sources not from apt-get (got from www.debian.org) maybe doesn't contain the directory. So dh_make will be needed to create a widely usable template debian/, which includes default changelog, control, rules, etc. Dpkg-buildpackage can be runned after modified debian/control (change sections) and debian/rules (remove installdocs). But none of packages created this way have been proved effective, though normally installable.

Steps:

Terminal 代码
  1. $ sudo apt-get install dh-make dpkg-dev g++ patch make libc6-dev fakeroot libgtk2.0-dev   
  2. [sbox-SDK_ARMEL: ~/test0.1] dh_make -e your@email.com -f ../SourceFileName.tar.gz   
  3. [sbox-SDK_ARMEL: ~/test0.1] vim debian/control   
  4. [sbox-SDK_ARMEL: ~/test0.1] vim debian/rules   
  5. [sbox-SDK_ARMEL: ~/test0.1] dpkg-buildpackage -rfakeroot -b  

Note:

dh-make is a tool package including dh_make, dh_installdocs, etc. Mostly dh-make is used in apt-get install. Pay attention to the difference between dh-make and dh_make

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值