5.5. Compiling The Dynamic Software Update Patch

The dynamic software update patch produced by the patch generator, which is in source code format, is compiled using the hcucc.pl compiler to produce a dynamic software update patch in binary format, which is a dynamically loadable shared object library. This binary dynamic software update patch is later used to apply a live update.

Figure 5-9 shows an example of preparing a binary dynamic software update patch that will update vsFTPd from version 2.0.4 to version 2.0.5. The compilation is carried out in two steps.

Figure 5-9. Compiling a dynamic software update patch for vsFTPd from 2.0.4 to 2.0.5.

# Compile the source dynamic software update patch to be dynamically updateable
bash$ hcucc.pl -fPIC \
               -c vsftpd_comb.c_v204_to_v205.hcupatch.c \
               -o vsftpd_comb.c_v204_to_v205.hcupatch.o \
               --update-version=205

# Create a binary dynamic software update patch as a dynamically loadable
# shared object library
bash$ hcucc.pl -shared -Wl,-soname=vsftpd_v205_to_v205.so \
               -o libvsftpd_v205_to_v205.so.205 \
               vsftpd_comb.c_v204_to_v205.hcupatch.o
         

Warning

Unlike preparing updateable programs in Section 4.1, no "--base-version" argument is supplied here. The dynamic software update patch is not the original program: it is an update. When the patch is applied the original program is already running.