自制UCI扩展包
From DSL Wiki
This page in other languages: english
自制uci最难的部分与压缩无关. 最难的部分是制作一个能在/opt里包含所有文件(自包含)的程序. 由于openoffice 和 firefoxopen 优秀的自包含, 而且能在/opt里运行, 所以最好用他们来做测试. 而且, uci限制为只读. 这就是user.tar.gz存在的原因. Those parts that require updates can be "linked" into a writeable directory. The user.tar.gz file is really an additional MyDSL extension included within the uci. When the uci is mounted the system looks inside the mount for a user.tar.gz ("user.tar.gz" is the literal filename) and then performs a mydsl-load on that tar.gz. This makes for an easy single file download and load. The user.tar.gz file is optional, and generally includes a desktop icon, menu item, and any personal configs if your application requires but does not create them itself. This file must be built in the same way as a *.tar.gz extension, including full paths and proper file ownerships/permissions.
Sometimes you will be required to make a shell wrapper to start the app, as being self-contained implies that the application's libraries are also stored locally with the application. This usually implies requiring a LD_LIBRARY_PATH and sometimes a PATH change, thus the shell wrapper. Anyway, make the app. Test it as a .tar.gz. Once the app is working then to make a uci do the following.
1. The app is installed and runs properly from the /opt/your_app directory.
2. become root
3. cd /opt
4. mkisofs -R -hide-rr-moved your_app | create_compressed_fs - 65536 > /mnt/somedrive/your_app.uci
To change/update a UCI file do the following: (example here is firefox.uci)
1. mount the uci as normal
2. mkdir work
3. cd work
4. cp -a /opt/firefox/.
5. cd firefox
6. mkdir user
7. cd user
8. tar -zxvf ../user.tar.gz
9. tar -ztf ../user.tar.gz > list
10. -- now edit the actual files as needed --
11. -- be sure to edit/update the "list"
12. tar -T list --numeric-owner --no-recursion -czvf ../user.tar.gz
13. cd ..
14. rm -rf user
15. cd ..
16. mkisofs -R -hide-rr-moved -cache-inodes -pad firefox/|create_compressed_fs - 65536 > ../firefox.uci
17. cd ..
18. rm -rf work
(Thanks to Robert Shingledecker)