In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article focuses on "how to make an application package for tinyco linux". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to make an application package for tinyco linux.
Running rootfs in ram
First, root=/dev/ram0,initrd=microcore.gz,cobd0=/imgs/tinycolinux1g in conf/colinux.conf, so that the rootfs of the launched colinux is in / dev/ram0, and the hard disk media is only used to store user data, that is, the four mount addresses / opt=cobd0,/home=cobd0,local=cobd0,tce=cobd0 defined in conf/colinux.conf. These four mountable mount points are those of colinux if and only if they need to be modified, so they need to be mounted persistently. We can also define a few more variables to enhance the strength of the live rootfs, such as norestore
Start up, run. Successfully entered the cmdline of the tc user.
Of course, although the live rootfs system is started, the rootfs is still a bit raw form and inconvenient. For example:
Through the df command, we found that of the four defined mount points, only three were mounted to / missing / tce, but four folders / opt,/home,/tclocal corresponding to / usr/local and / tce were still generated on the hard disk. Through tce-load-w, we found that the downloaded package was in / mnt/cobd0/tce. This is the correct behavior. It works but does not look good. The loading logic of these four mount points is all in / etc/init.d/tc-config. So we can even repackage microcore.gz and modify tc-config to add the missing / tce entry.
Modprobe can also make errors because readonly live rootfs cannot load the lib/modules injected by the original initrd.gz, but again, we can repackage microcore.gz to add these files manually.
There are also some necessary system-level persistence that cannot be done, such as user password change, which is saved in readonly rootfs / etc/shadow, which we have to do:
Sudo passwd root
Enter the password twice
Cp / etc/shadow / opt/shadow (make a backup to the hard drive / opt)
Then modify / opt/.bootsync.sh by adding the following:
Cp / etc/shadow / etc/shadow_old cp / opt/shadow / etc/shadow
In fact, we can completely replace the passwd in busybox and change the / etc/shadow path to another external durable location. For example, the vm container sub-machine environment does not need to shut down and the halt in busybox can be removed. For example, we can compile and add dropbear support. After all, sshd is the most basic distribution support.
We will not customize the microcore.cpio package. Too tired.
Set up composite application
Officials have provided a lot of images, and these packages are all orthogonal. And there are building source code, but often we also need lnmp such a combination package, we can press the "release tinycolinux" part2 in the hard disk installation application method to combine one-time installation package (of course, so it is not orthogonal, but a vm container usually only need to carry a load to install lnmp once in the case, it is very reasonable and practical), the following is a combination of application logic, for example we used a lnmp, combined into a lnmp.tar.gz.
First, tce-load-w nginx,php5,sqlite3, it is found that a large number of tcz will be downloaded to / mnt/cobd0/tce/options: bsddb.tcz,bzip2-lib.tcz,curl.tcz,gmp.tcz,libgdbm.tcz,libiconv.tcz,libltdl.tcz,libmcrypt.tcz,libpng.tcz,libxml2.tcz,libxslt.tcz,mysql.tcz,ncurses.tcz,ncurses-common.tcz,nginx.tcz,openssl-0.9.8.tcz,pcre.tcz,perl5.tcz,php5.tcz,readline.tcz,sqlite3.tcz These are the basis for us to combine into a large application package. Extract it one by one to the my folder, sudo unsquashfs-f-d / mnt/cobd0/my/ / mnt/cobd0/tce/optional/xxx.tcz
Make some changes (this is because the original tcz is all green dropin packages):
Nginx conf/nginx.conf,root index adds an index.php to remove annotations from the three comments about php to make them valid, where SCRIPT_FILENAME is changed to $document_root$fastcgi_script_name; and the maximum script memory is changed from 128m to 64mb
Usr/local/etc plus a my.cnf, the content is as follows:
[mysqld] socket = / tmp/mysql.sockport = 3306pid-file = / tmp/hostname.piddatadir = / usr/local/var/mysqllanguage = / usr/local/share/mysql/englishuser = tc
All right, now rebuild the database, sudo / usr/local/bin/mysql_install_db, attempts to launch mysql: sudo / usr/local/bin/mysqld_safe &, successful
Then we cd / mnt/cobd0/my, package them sudo tar zcf lnmp.tar.gz *, install this big application test: cd to /, then tar zxvf / mnt/cobd0/my/lnmp.tar.gz, and then start them in / opt/bootlocal.sh:
Sudo nginx;sudo php-cgi-b 127.0.0.1 9000tersudo mysql_safe
Success.
At this point, I believe you have a deeper understanding of "how to make an application package for tinyco linux". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.