Creating a Fedora Core 5 Live CD for sipX using Kadischi

From SIPfoundry sipx, The Open Source SIP PBX for Linux - Calivia

Jump to: navigation, search

Contents

[edit] Introduction

Kadishi is the Fedora Project Live CD Project. It is still under development and not yet part of the official Fedora distributions. However, we accomplished our objective of building a sipX Live CD. The following article describes how. The following is based on Fedora Core 5 (FC5), Kadischi 3.4-4 (12/2006), and sipX 3.6. We used kernel 2.6.15; kernel 2.6.18 does not seem to include the module squashfs.ko, which is required for the live CD to work (suggestions welcome).

[edit] Prerequisites

Make sure the following packages are installed:

yum install kudzu-devel intltool glib2-devel autoconf automake fedora-rpmdevtools cvs
yum install anaconda busybox-anaconda syslinux mkisofs squashfs-tools e2fsprogs usermode 
yum install patch createrepo yum-utils gnome-python2-gtkhtml2

Note: This will pull in a lot of packages if you have not yet installed X11, because even if you are not planning on using a graphical environment, anaconda still depends on it.

[edit] Compiling Kadischi

Follow the instructions provided on the Kadischi Wiki and create an RPM. Then install this RPM instead of running make install. This puts the Kadischi files into /usr/share/kadischi and the config files into /etc/kadischi. Here are the commands run from a non-root account:

fedora-buildrpmtree
export CVSROOT=:pserver:anonymous@cvs.fedora.redhat.com:/cvs/devel
cvs -z3 login
cvs -z3 co kadischi
tar -cf kadischi.tar kadischi && bzip2 -9 kadischi.tar
export TAR_OPTIONS=--wildcards
rpmbuild -ta kadischi.tar.bz2

The Kadischi RPM should now be in ~/rpmbuild/RPMS/i386 ready to be installed:

sudo rpm -i ~/rpmbuild/RPMS/i386/kadischi-3.4-4.20061223cvs.i386.rpm

[edit] Creating the Repository

Creating a repository is simple (see also here). I created a directory in my home directory called i386/Fedora/.

Take CD1 of the FC5 CD set and copy all the files in Fedora/RPMS and Fedora/base to your new directory. Then take CD2 through CD5 and copy all the RPMS from all the CDs to your directory Fedora/RPMS. If you don't copy all the RPMS from all the CDs, then the rsync command will take much too long and you might be missing RPMS in cases where there is no update available for a particular package (the rsync command below only syncs with the update directory).

sudo mount /dev/cdrom cd
rsync --archive cd/Fedora i386/Fedora/

Note: To download it from the Web you can try this: rsync -avrt rsync://distro.ibiblio.org/fedora-linux-core/6/i386/os/Fedora/RPMS --exclude=debug/ --exclude=repodata/ --exclude=*debuginfo* i386/Fedora/RPMS

rsync -avrt rsync://distro.ibiblio.org/fedora-linux-core/updates/5/i386/ --exclude=debug/ \
  --exclude=repodata/ --exclude=*debuginfo* i386/Fedora/RPMS

Optional: If you also want to install the xfce4 graphical desktop:

rsync --archive rsync://mirrors.kernel.org/fedora/extras/5/i386/*xfce* i386/Fedora/RPMS
rsync --archive rsync://mirrors.kernel.org/fedora/extras/5/i386/xfdesktop* i386/Fedora/RPMS
rsync --archive rsync://mirrors.kernel.org/fedora/extras/5/i386/xfwm4* i386/Fedora/RPMS

Since all the updated packages that the rsync command imports have a different version number in their file name, you now have a lot of duplicate packages. The command repomanage will eliminate all the old ones.

repomanage --old i386/Fedora/RPMS | xargs rm -f

Now create the repository metadata (the createrepo command will find the RPMS directory on its own):

cd 
createrepo -g i386/Fedora/base/comps.xml .

Note: I disabled SELinux in /etc/selinux/config.

[edit] Necessary Modifications before running Kadischi to create a sipX Live CD

File: /usr/share/kadischi/movefiles.py
 files_to_be_writable = [
    '/var',
    '/tmp',
    '/etc',
    '/home',
    '/root',
    '/opt',
    '/mnt',
    '/media',
    '/var/lib/rpm',
    '/usr/share/www/doc/vm_vxml',
    '/usr/share/www/doc/aa_vxml',
    ] 
File: /usr/share/kadischi/install/rc.readonly-livecd
       mount_file /root
       mount_file /home
       mount_file /opt
       mount_file /mnt
       mount_file /media
       mount_file /etc
       # Added:
       mount_file /usr/share/www/doc/vm_vxml
       mount_file /usr/share/www/doc/aa_vxml
  • Added the LiveCD start script sipx_reset_cd to /usr/share/kadischi/install
File: /usr/share/kadischi/post_install_scripts/02install.sh
#Added:
inst sipx_reset_cd root/

Modify Boot Splash Screen and Dialog: Change files in /usr/share/kadishi/bootsplash

[edit] Kadischi Kickstart File

############################################################
###
### Kickstart configuration file for Kadischi Fedora Live CD
### sipX Live CD
###
### Copyright Calivia GmbH, Bern, Switzerland
### Licensed to SIPfoundry under a Controbutor Agreement
###
### Copyright SIPfoundry
### Licensed under the L-GPL license
###
############################################################

#--- Installation method
install

#--- Language and input support
lang en_US.UTF-8
langsupport --default=en_US.UTF-8 en_US.UTF-8
keyboard us
mouse generic3ps/2

#--- X-Windows (use "skipx" directive to skip X-Windows configuration)
skipx

#--- Network configuration
network --device eth0 --bootproto static --ip 192.168.5.177 --netmask 255.255.255.0 --gateway 192.168.5.1 --nameserver 192.168.5.145 --hostname sipx-live.pingtel.com
#network --device eth1 --onboot no --bootproto dhcp --hostname sipx.us.calivia.com

#--- Authentication and security
rootpw --iscrypted $1$nIbsWYcm$AJ3Dm/kvbhDP3f30j2EKy/
firewall --disabled
selinux --disabled
authconfig --enableshadow --enablemd5

#--- Time zone
timezone America/New_York

#--- Boot loader
bootloader --location=none
reboot

#--- Package selection
%packages --resolvedeps --excludedocs
-firstboot-tui
#kernel
ntp
dhcp

### sipX components
sipxpbx
sipxproxy-cdr
sipxconfig-tftp
sipxconfig-ftp

#--- Pre-installation script
%pre

#--- Post-installation script
%post
#!/bin/sh

#...Disable the utility 'cpuspeed'. If run the VIA C3 Nehemia processor based systems will crash
#/sbin/service cpuspeed stop
#chkconfig cpuspeed off

#...Replace /etc/hosts
echo -e "# Generated from the SIPX installation CD\n127.0.0.1   localhost.localdomain localhost\n192.168.5.177  sipx-live.pingtel.com sipx-live\n" > etc/hosts

#...Remove the HW address entry (MAC address) from the network config - it will be different on every machine
perl -pi -e 's/^HWADDR=.*/HWADDR=/' /etc/sysconfig/network-scripts/ifcfg-eth0

#... Turn off unnecessary services or services that will be started later
chkconfig bluetooth off
chkconfig smartd off
#chkconfig irqbalance off
chkconfig sipxpbx off
chkconfig postgresql off
rm -rf var/lib/pgsql/data/

#...Turn off that annoying Kudzu boot message
#for fn in `ls /etc/rc3.d/* | grep kudzu`; do rm -f $fn; done

#...Create startfile to initialize sipXconfig after boot
echo -e "#!/bin/bash\n./sipx_reset_cd" > /root/init-script
chmod +x /root/init-script
echo -e "\n[ -f /root/init-script ] && /root/init-script\n" >> /root/.bashrc

[edit] Running Kadischi

File: /etc/kadischi/kadischi.conf
 # set the boot loader to isolinux
 BOOTLOADER=isolinux

Kadischi can be started from a non privileged account. However, at startup it will ask for root privileges and then run as root. It creates a lot of temporary data in /tmp/kadischi. This is useful for debugging, however, after many runs you might want to delete the tmp files in order to save space.

kadischi --text /home/kadischi test.iso --kickstart=/home/kadischi/kadischi/ks.cfg

[edit] Live CD Start Wizard

The Live CD is setup so that after booting the operating system and logging in as root, a startup wizard starts that allows easy configuration of the system. The wizard addresses the following configuration steps:

  • Configure network parameters, hostname and domain
  • Configure admin password and email address used for system messages
  • Configure timezone and setup an NTP server
  • Optional: Configure a DHCP and DNS server to provide the necessary services as required by sipX and the phones on a subnet where there is no other DHCP server running
  • Configure FTP Server for phone profile download
  • Create a self-signed certificate and install it as required

The wizard is written in Python and uses ncurses graphics similar to Anaconda in text mode.

Personal tools