Launching Red Hat from within Altiris Linux Automation Environment


I spent a couple of days last week pulling my hair out trying to get our RHEL5 Linux build to install from within Altiris.
 
The most common approach uses the Altiris DOS Automation environment to configure GRUB4DOS which launches the RHEL5 kickstart installation on the next reboot.
I couldn’t get the Altiris DOS Automation environment to work (the shared drive mapping failed) and I couldn’t be arsed picking through our policies to fix it.
 
Another approach linked here, creates a custom PXE boot menu option that starts the RHEL5 install. I wouldn’t recommend this approach as it takes away the manual step of dropping a job on a computer object in DS to deploy server images. You know it would only be a matter of time before some butter fingered monkey starts rebuilding all your RHEL servers.
 
What I really wanted was to just launch the kick start install from within the Linux Automation environment ala the way you launch Windows in WinPE.
Thanks to viddect for pointing me in the right direction.
 
Hopefully this will save other linux n00bs a few headaches. I separated the different steps into multiple ‘Run Scripts’ tasks for error checking. I tried to combine them afterwards but they didn’t act the same. Who knows why. I have learnt not to ask too many questions of Altiris.
 
—————————————cut here————————————————-

Run Script #1
## Partition Disk /dev/sda
fdisk /dev/sda << _EOF
n
p
1
1
+100M
a
1
w
_EOF
sleep 5

Run Script #2
## formats /dev/sda1 to ext2
mke2fs /dev/sda1
sleep 5

Run Script #3
## Mount /dev/sda1
mkdir /mnt/setup
mount -t ext2 /dev/sda1 /mnt/setup
sleep 5

Run Script #4
# # Copy RHEL 57 Kernel Files to /dev/sda1
cp -R /mnt/ds/lib/osdist/linux/RHEL57/isolinux/vmlinuz /mnt/setup/
cp -R /mnt/ds/lib/osdist/linux/RHEL57/isolinux/initrd.img /mnt/setup/

Run Script #5
## Copy GRUB Files to /dev/sda1
mkdir /mnt/setup/boot
cp -R /boot/* /mnt/setup/boot/

Run Script #6
## Create menu.lst
cat > /mnt/setup/boot/grub/menu.lst <<EOF1
timeout 5
default /default
title RHEL SOE
root (hd0,0)
kernel (hd0,0)/vmlinuz text ks=ftp://x.x.x.x/PXE57/Config/ks.cfg
initrd (hd0,0)/initrd.img
EOF1

Run Script #7
## Configure GRUB
/sbin/grub –batch <<EOF
root (hd0,0)
setup (hd0)
quit
EOF

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s