Mitel SME Server - custom iso HowTo

Author:  Darrell May
Contributor:
  John Powell <jrp2@jrp2.net>
Release supported: SME 5.6
Last updated: Monday, January 13, 2003 11:54 AM



Problem:  You want to build your own Mitel SME Server, custom iso, bootable CD
Solution:
  Follow this HowTo

Resources: http://en.tldp.org/HOWTO/RedHat-CD-HOWTO/index.html  PLEASE READ!


STEP 1: On your SME 5.6B7 test server, download and install the following rpms:

  1. http://rpmfind.net/linux/redhat/7.3/en/os/i386/RedHat/RPMS/anaconda-7.3-7.i386.rpm
  2. http://rpmfind.net/linux/redhat/7.3/en/os/i386/RedHat/RPMS/anaconda-runtime-7.3-7.i386.rpm
  3. http://rpmfind.net/linux/redhat/7.3/en/os/i386/RedHat/RPMS/mkisofs-1.10-11.i386.rpm
  4. http://rpmfind.net/linux/redhat/7.3/en/os/i386/RedHat/RPMS/rpm-python-4.0.4-7x.18.i386.rpm
# rpm -Uvh --nodeps anaconda-7.3-7.i386.rpm
# rpm -Uvh --nodeps anaconda-runtime-7.3-7.i386.rpm
# rpm -Uvh mkisofs-1.10-11.i386.rpm
# rpm -Uvh rpm-python-4.0.4-7x.18.i386.rpm

STEP 2: To deal with some errors in the python paths, and an error in one of the scripts, you need to make some quick changes.  These are one-time changes to your build system.  Edit /usr/lib/anaconda-runtime/check-repository.py and comment out "import todo"  (line 38) with a '#'. Copy /usr/lib/anaconda-runtime/pkgorder to /usr/lib/anaconda.

# pico /usr/lib/anaconda-runtime/check-repository.py

Go to line 38 and comment out "import todo"  by preceding it with a '#',  # import todo

# cp /usr/lib/anaconda-runtime/pkgorder /usr/lib/anaconda


STEP 3: Download the current smeserver-5.6dev.iso and copy to /root.  Logged in as root, make a temporary directory to loopback mount the iso image.  Make a directory for your work area (for this example, /root/cdrom), cd to it.  Copy the iso contents into your work area on the hard drive.

# mkdir /root/iso_mnt_point
# mount -o loop smeserver-5.6dev.iso /root/iso_mnt_point/
# mkdir /root/cdrom
# cd /root/cdrom
# cp -Rav /root/iso_mnt_point/* .

STEP 4: Create the RedHat link required for proper compatibility with standard RedHat iso tools.

# cd /root/cdrom
# ln -s e-smith RedHat

STEP 5: Add your new rpms (example: sme56dev/updates) into /root/cdrom/e-smith/RPMS.  Remember to delete any older rpm versions you are replacing.

# cp *.rpm /root/cdrom/e-smith/RPMS

TIP ;->

You may find it beneficial to create an iso that includes all the contribs and important programs you regularly use. To do so simply create a subdirectory under /root/cdrom and copy all your files into it.  These will not get automatically installed but will be available inside your iso for manual installation.  You may include both Linux and Windows programs in your iso.  Example: /root/cdrom/downloads/Mitel /root/cdrom/downloads/Windows.


STEP 6: If you added any new rpms above into /root/cdrom/e-smith/RPMS you must edit /root/cdrom/e-smith/base/comps and add the new rpm names into the list.

# pico  /root/cdrom/e-smith/base/comps

STEP 7: Optional.  Edit the install.cfg mirror.cfg upgrade.cfg. These are commented text files that hold install/mirror/upgrade defaults. You may leave these untouched or elect to alter to meet your specific needs.

# cd /root/cdrom/images

# pico install.cfg
# pico mirror.cfg
# pico upgrade.cfg


STEP 8: Optional, but a good idea.  Run the script check-repository.py.  This is will do some simple checks to verify that all the RPMs listed in your comps file are in the RPMS directory.  If it returns nothing, all is well.  If it returns an error, correct the problem.  Errors are usually due to typos in the comps file, or you forgot to add the RPM to the RPMs directory in the image.  This script will stop on the first error, so you need to run it until all errors are fixed!

# /usr/lib/anaconda-runtime/check-repository.py /root/cdrom

STEP 9:  Here is a script I use to automate building iso images.  Paste and save this into a file named /root/buildiso

# pico /root/buildiso
#!/bin/sh
# useage = ./buildiso label date
# Example: ./buildiso cdrom 010903

BUILDROOT=/root/$1
DESTINATION=/root

# remove any previous destination files
/bin/rm -f $DESTINATION/$1-$2.*

# create a rpm list for this build and save to destination
/bin/ls -1 $BUILDROOT/e-smith/RPMS > $DESTINATION/$1-$2.list

# generate the initial hdlist file for the pgkorder script to use
/usr/lib/anaconda-runtime/genhdlist $BUILDROOT

# generate the pkgorder file
/usr/lib/anaconda/pkgorder $BUILDROOT i386 > $BUILDROOT/RedHat/base/pkgorder

# copy the pkgorder file to destination
/bin/cp $BUILDROOT/RedHat/base/pkgorder $DESTINATION/$1-$2.pkgorder

# generate the hdlist file again, using the pkgorder file this time
/usr/lib/anaconda-runtime/genhdlist --fileorder $BUILDROOT/RedHat/base/pkgorder $BUILDROOT

# build the iso, save to destination
/usr/bin/mkisofs -V '$1-$2' -b images/boot.img -c e-smith/base/boot.cat -J -r -T -pad -o $DESTINATION/$1-$2.iso $BUILDROOT

Make the script executable:

# cd /root
# chmod 750 /root/buildiso

Next to create the iso simply enter this command:

# ./buildiso cdrom 010903

The above command creates three files in the /root dir:

  1. cdrom-010903.iso = the new iso image
  2. cdrom-010903.list =  a list of all rpms in this build
  3. cdrom-010903.pkgorder = the pkgorder list

STEP 10: Burn the cdrom-010903.iso image to a CDR.


STEP 11: Test the CDR by booting and performing a fresh server install.