2008/06/09

WMU-6500FS - Deployment



For easy and convenient deployment I have created a simple script creating an appropriate package based on a timestamp. It deploys all the files newer than a ".start_time" file created just before an installation process. The script is very simple, just in case one is lazy to create his own, here is the [link] to download it.

I got used to following sequence of operations whenever I am installing a new piece of software:
  1. download software package
  2. dev# cd /usr/local/src
    dev# wget <sw-src-uri>
    dev# tar xzvf <sw-src-package>
    
  3. configure and build
  4. dev# cd <sw-src-dir>
    dev# ./configure --prefix=/mnt/C/sys <possibly-other-options>
    dev# make
    
  5. create timestamp, install and create resulting binary package
  6. dev# echo > /mnt/C/.start_time
    dev# make install
    dev# cd /mnt/C
    dev# ./filopack.sh <package-name>
    
  7. upload resulting package to the box
  8. deb# scp <dev-root>/mnt/C/<package-name>.tgz root@storage:/mnt/C/
    
  9. install the resulting package on the box
  10. box# cd /mnt/C
    box# tar xzvf <package-name>.tgz
    

Script usage examples

Help and usage
dev# ./filopack.sh -h
usage: filopack.sh [OPTIONS] <package-name>

 Based on previously created timestamp (.start_time file) generates
 archive <package-name>.<fmt> along with file list <package-name>.lst.

 Available options:
         -o <fmt> ... archive format ('tar', 'tgz', 'tbz2', 'lst' currently supported)
                 ('lst' just generates .lst file and prints filenames)
         -p ... prefix path ('sys/' by default)
         -f ... filter ('-newer .start_time' by default, '' performs no filtering)
         -r ... reuse the previously generated filename list (.lst file)
         -v ... prints version
         -h ... prints this help message
Deployment of the file (unix command) - tar.bz2 archive is created by default.
dev# echo > /mnt/C/.start_time
dev# make install
dev# cd /mnt/C
dev# ./filopack.sh file-4.24
-rwxr-xr-x root/root     39355 2008-06-16 14:46:50 sys/bin/file
-rwxr-xr-x root/root    285972 2008-06-16 14:46:49 sys/lib/libmagic.so.1.0.0
lrwxrwxrwx root/root         0 2008-06-16 14:46:49 sys/lib/libmagic.so.1 -> libmagic.so.1.0.0
lrwxrwxrwx root/root         0 2008-06-16 14:46:49 sys/lib/libmagic.so -> libmagic.so.1.0.0
-rwxr-xr-x root/root       803 2008-06-16 14:46:49 sys/lib/libmagic.la
-rw-r--r-- root/root    396680 2008-06-16 14:46:49 sys/lib/libmagic.a
-rw-r--r-- root/root     16176 2008-06-16 14:46:51 sys/share/man/man1/file.1
-rw-r--r-- root/root      7555 2008-06-16 14:46:51 sys/share/man/man3/libmagic.3
-rw-r--r-- root/root     16504 2008-06-16 14:46:51 sys/share/man/man4/magic.4
-rw-r--r-- root/root   1627584 2008-06-16 14:46:50 sys/share/file/magic.mgc
-rw-r--r-- root/root      3547 2008-06-16 14:46:50 sys/include/magic.h
Deployment of the same package - this time the file list is reused and gzip archive is used fir resulting archive.
dev# ./filopack.sh -o tgz -r file-4.24
-rwxr-xr-x root/root     39355 2008-06-16 14:46:50 sys/bin/file
-rwxr-xr-x root/root    285972 2008-06-16 14:46:49 sys/lib/libmagic.so.1.0.0
lrwxrwxrwx root/root         0 2008-06-16 14:46:49 sys/lib/libmagic.so.1 -> libmagic.so.1.0.0
lrwxrwxrwx root/root         0 2008-06-16 14:46:49 sys/lib/libmagic.so -> libmagic.so.1.0.0
-rwxr-xr-x root/root       803 2008-06-16 14:46:49 sys/lib/libmagic.la
-rw-r--r-- root/root    396680 2008-06-16 14:46:49 sys/lib/libmagic.a
-rw-r--r-- root/root     16176 2008-06-16 14:46:51 sys/share/man/man1/file.1
-rw-r--r-- root/root      7555 2008-06-16 14:46:51 sys/share/man/man3/libmagic.3
-rw-r--r-- root/root     16504 2008-06-16 14:46:51 sys/share/man/man4/magic.4
-rw-r--r-- root/root   1627584 2008-06-16 14:46:50 sys/share/file/magic.mgc
-rw-r--r-- root/root      3547 2008-06-16 14:46:50 sys/include/magic.h
Archive of the Mesa libraries is created (timestamp filtering is disabled and prefix pattern is used for the file selection).
dev# ./filopack.sh -p 'sys/lib/lib[OG]*' -f '' Mesa-7.0.3
lrwxrwxrwx root/root         0 2008-06-16 14:07:09 sys/lib/libGL.so -> libGL.so.1
lrwxrwxrwx root/root         0 2008-06-16 14:07:09 sys/lib/libGL.so.1 -> libGL.so.1.5.070003
-rwxr-xr-x root/root  20101208 2008-06-16 14:07:09 sys/lib/libGL.so.1.5.070003
-rw-r--r-- root/root         0 2008-06-16 14:37:35 sys/lib/libGL.so.1.lst
lrwxrwxrwx root/root         0 2008-06-16 14:07:24 sys/lib/libGLU.so -> libGLU.so.1
lrwxrwxrwx root/root         0 2008-06-16 14:07:24 sys/lib/libGLU.so.1 -> libGLU.so.1.3.070003
-rwxr-xr-x root/root   2875754 2008-06-16 14:07:24 sys/lib/libGLU.so.1.3.070003
lrwxrwxrwx root/root         0 2008-06-16 14:07:24 sys/lib/libGLw.so -> libGLw.so.1
lrwxrwxrwx root/root         0 2008-06-16 14:07:24 sys/lib/libGLw.so.1 -> libGLw.so.1.0.0
-rwxr-xr-x root/root    127359 2008-06-16 14:07:24 sys/lib/libGLw.so.1.0.0
lrwxrwxrwx root/root         0 2008-06-16 14:07:10 sys/lib/libOSMesa.so -> libOSMesa.so.6
lrwxrwxrwx root/root         0 2008-06-16 14:07:10 sys/lib/libOSMesa.so.6 -> libOSMesa.so.6.5.3
-rwxr-xr-x root/root    252524 2008-06-16 14:07:10 sys/lib/libOSMesa.so.6.5.3
This time the whole X11 distribution is archived (all files in given sub-tree and no timestamp filtering).
dev# ./filopack.sh -p sys/X11R7/ -f '' XOrg.7.1
...

2 comments:

Anonymous said...

Hi Filodej, where do you keep your filopack.sh script? Inside the chroot jail or within the normal colinux system?

Thanks
Robert

filodej said...

Hi,
I keep it in the chroot jail, namely in the /mnt/C/ directory.

The convention I am using regarding to the systems and commands being run is:

deb# prefix ... CoLinux Debian system
dev# prefix ... chroot jail
box# prefix ... WMU box

I have to note that this whole post is obsolete since it describes the obsolete version of the script (0.0.5), sorry for that.

If you will, you can download and inspect the actual version as follows:

box# cd /mnt/C
box# wget http://filodej.ic.cz/filopack/filopack.sh
box# ./filopack.h --help

Regards,
Filodej