≡ Menu

Multi-OS Installation: Configuring the Linux Environment

This article will discuss configuring a RHEL image for use in the Multi-OS installer. On successful boot, the user will be greeted by the text installer as if they had booted off of CD or DVD media. Other Linux variants are likely easily adaptable but were out of scope for the project that was delivered to the client.

Configuring Linux is nowhere near as complex as the Windows environment. The low level Linux boot process is the same as Windows and Solaris, mainly a PXE request is dropped onto the wire. The dhcpd server accepts the request and issues a reply packet containing the IP address for the PXE client, the IP address of the next server to speak to, and the filename that the PXE client needs to request. The filename passed to the client used is the pxelinux bootloader which has been described in detail elsewhere.

The operating system makes use of the PXE Loader configuration. Please go read that post if you have yet to do so as general configuration details are described in that article.

The pxelinux menu entry needs to be updated to point to the linux kernel and an appropriate initrd stanza needs to be added to the menu entry as well. Substitute your own directory name for all instances of RHEL_4_U5_x86_32. That said, a sample entry in my environment looks like this:

label rhel4_32
kernel /images/RHEL_4_U5_x86_32/install/images/pxeboot/vmlinuz
append initrd=/images/RHEL_4_U5_x86_32/install/images/pxeboot/initrd.img nofb text noipv6 method=http://install/images/RHEL_4_U5_x86_32/install ksdevice=eth0

Remember that the tftpd server is chrooted to /export/install, so on the filesystem, the kernel resides in the base directory /export/install/images/RHEL_4_U5_x86_32/. The nomenclature used at the customer site allows multiple variants of RHEL 4 32 and 64 bit to live in the tree concurrently. Menu entries need only be added for each desired variant to install other versions.

Once the PXE menu entries have been added, the image can be prepared. This is nowhere near as complex as windows and requires only a few steps:

mkdir /export/install/images/RHEL_4_U5_x86_32 # or the path for the real vers.
mkdir -p /mnt/{1,2,3,4…N} # one per ISO
mount -o loop /path/to/iso/RHEL4-U5-i386-AS-disc1.iso /mnt/1
…
mount -o loop /path/to/iso/RHEL4-U5-i386-AS-discN.iso /mnt/N
# note, if you run out of loopback devices, add “options loop max_loop=256”
# to /etc/modprobe.conf and reboot.
tar -C /mnt/1 cpvf – | tar -C /export/install/images/RHEL_4_U5_x86_32/ -xpf –
…
tar -C /mnt/N cpvf – | tar -C /export/install/images/RHEL_4_U5_x86_32/ -xpf –

When finished, in /export/install/images/RHEL_4_U5_x86_32/ directory you should have the following directories: RedHat, SRPMS, install, images, isolinux, and a large number of README html files.

Confirm that the install/images/pxeboot directory contains a file called vmlinuz and the path matches what was indicated in the pxelinux menu entry and that the initrd.img is present in the same directory and that the paths to the images match:

ls -al /export/install/images/RHEL_4_U5_x86_32/install/images/pxeboot
grep RHEL_4_U5_86_32 /export/install/default

And that concludes all of the image prep necessary. The next item to configure is the apache server to ensure it can serve the http content as requested by the method= line of the menu entry. To do so we need to edit the configuration of apache and add a section allowing the webserver to find our content at /images/. Edit the httpd.conf and add the following in an appropriate location, or use this snippet to create a new file uniquely named along the lines of install.conf in the httpd/conf.d directory, if present.

Alias /images/ /export/install/images/
< directory >
Options Indexes FollowSymLinks
AllowOverride Limit
Order allow,deny
Allow from all
< /directory >

Apache needs to then be restarted or HUP’ed for the configuration changes to take effect.

All that is left now is to test the individual components:

First we need to make sure dhcpd is running:

ps -ef | grep dhcpd

Next we ensure apache is running;

ps -ef | grep httpd

Now we make sure that the repository is in proper order:

ls -al /export/install/boot/pxelinux # check for pxelinux
ls -al /export/install/boot/default # check for the default menu file for your entry
ls -ald /export/install/images/RHEL_4_U5_x86_32/ # make sure the RedHat dir is there
ls -ald /export/install/images/RHEL_4_U5_x86_32/install/images/pxeboot # should return 4 files: initrd.img, README, TRANS.TBL, vmlinuz

Now we make sure that tftp is working as expected (remember that tftp was chrooted to /export/install so everything will be relative to that path):

tftp localhost
cd images/RHEL_4_U5_x86_32/install/images/pxeboot
get vmlinuz

Next we ensure the apache is serving content properly.

wget http://localhost/images/RHEL_4_U5_x86_32/install/images/pxeboot/vmlinuz

if for some reason you dont have wget on your server you can do it manually using telnet:

telnet localhost 80
HEAD /images/RHEL_4_U5_x86_32/install/images/pxeboot/vmlinuz HTTP/1.0

This essentially concludes the work required to netboot a RHEL installer to the point where the user can make their desired selections to complete the installation.

After finishing the configuration, all that is left is to reboot the machine and netboot using the F12 key, and then select the newly added menu entry from the pxelinux menu when prompted. When the installer loads and begins the interactive installation you will need to walk through the installer options and answer any question.

If you have any problems or questions, drop me a line and I’ll see what I can do to help. If there is interest in the topic, moving from an interactive installation to the configuring of kickstart may be discussed in a later article should there be interest in the topic.

>>> Karl