We usually need more than a dozen installation packages when installing a platform in Linux/Unix. These source packages are from the network, local hard disk, and mobile devices. Sometimes it may cause a lot of trouble if the network is not smooth or becomes invalid. A good way is to download commonly used software packages to a local hard disk for storage. The problem is that over time, I don't even know which packages are suitable. Now it is a good solution to use makeself to implement self-resolution overwhelming installation. The following describes how to create the Func Client installation package.
I. Sort out software packages
# Cd/home
# Mkdir FuncPack1.0
Drop all required software packages to the FuncPack1.0 directory :)
# Ls FuncPack1.0
-Rw-r -- 1 root root50878 Sep 282009 certmaster-0.25.tar.gz
-Rw-r -- 1 root root249 Oct82009 certmaster. conf
-Rw-r -- 1 root 152871 Sep 282009 func-0.25.tar.gz
-Rw-r -- 1 root root=oct82009 minion. conf
-Rw-r -- 1 root 197981 Sep 282009 pyOpenSSL-0.9.tar.gz
-Rw-r -- 1 root 11060830 May 222008 Python-2.5.1.tgz
2. Compile and install shell
# Cd FuncPack1.0
# Vi install. sh
View plainprint?
- #! /Bin/sh
- #
- #---------------------------------------------------
- # Apython & funcinstallshell
- #---------------------------------------------------
- #
- # WritedbyLiutiansi
- # Mail: liutiansi@gmail.com
- # Blog: http://blog.liuts.com
- # QQgroups: 106651547
- #---------------------------------------------------
- _ Pwd = $ (pwd)
- Cd $ _ pwd/FuncPack1.0
- Echo "============================= * installpython2.5 * ====================== ============"
- // Bin/tar-zxvfPython-2.5.1.tgz
- CdPython-2.5.1
- ./Configure & make & makeinstall
- Echo "exportPATH =\$ PATH:/usr/local/bin">/etc/profile
- Source/etc/profile
- Cd ..
- Echo "=========================== * installFunc/certmaster/pyOpenSSL * ================== ==="
- // Bin/tar-zxvfpyOpenSSL-0.9.tar.gz
- CdpyOpenSSL-0.9
- /Usr/local/bin/pythonsetup. pyinstall
- Cd ..
- // Bin/tar-zxvfcertmaster-0.25.tar.gz
- Cdcertmaster-0.25
- /Usr/local/bin/pythonsetup. pyinstall
- Cd ..
- // Bin/tar-zxvffunc-0.25.tar.gz
- Cdfunc-0.25
- /Usr/local/bin/pythonsetup. pyinstall
- Cd ..
- /Bin/ln-s/usr/local/bin/certmaster/usr/bin/certmaster
- /Bin/ln-s/usr/local/bin/funcd/usr/bin/funcd
- /Bin/sed-I's/''hostname'' // G'/etc/hosts
- /Bin/rm-rf/etc/certmaster. conf
- /Bin/rm-rf/etc/certmaster/minion. conf
- /Bin/cpcertmaster. conf/etc/certmaster
- /Bin/cpminion. conf/etc/certmaster
- /Bin/sed-I-e '/^ listen_port/{s/51234/1999/;}'/etc/func/minion. conf
- /Bin/sed-I-e "/^ minion_name/{s = 'hostname';}"/etc/func/minion. conf
- /Sbin/chkconfig -- level345certmasteron
- /Sbin/servicecertmasterstart
- /Sbin/chkconfig -- level345funcdon
- /Sbin/servicefuncdstart
- Echo "Installover! "
# Chmod + x install. sh
3. Packaging
# Cd/home
# Wget http://megastep.org/makeself/makeself-2.1.5.run
# Chmod + x makeself-2.1.5.run
#./Makeself-2.1.5.run
# Cd makeself-2.1.5
Start packaging!
#./Makeself. sh -- notemp.../FuncPack1.0/FuncPack1.0.bin "system start install..."./install. sh
Running result:
Header is 402 lines long
About to compress 11280 KB of data...
Adding files to archive named "FuncPack1.0.bin "...
./
/Func-0.25.tar.gz
/Python-2.5.1.tgz
/PyOpenSSL-0.9.tar.gz
./Install. sh
./Minion. conf
./Certmaster. conf
/Certmaster-0.25.tar.gz
CRCs: 853861468
MD5: 14463177b627f0e85f3591e88fb02b1d
Self-extractible archive "FuncPack1.0.bin" successfully created.
Command description:
1. -- notemp does not generate a temporary directory. Create a new directory under the current directory (recommended)
2../FuncPack1.0/package source directory
3. Generate a self-run decompressed file using FuncPack1.0.bin
4. "system start install..." installation prompt
5. The installation script to be executed after./install. sh is decompressed
6. CRC and MD5 (prevent tampering)
For more information, see the official http://megastep.org/makeself/.
4. Running package
1. scp the generated FuncPack1.0.bin file to other hosts
2. Run FuncPack1.0.bin.
If you have any questions or interested topics, you can communicate with me through weibo: http://t.qq.com/yorkoliu