Here’s an old script, that also uses the magic provided by pxe-menu-generation (the script I posted before), but for VMware ESX/ESXi.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 |
; html-script: false ]#!/bin/bash TFTP_DIR=/srv/tftp INSTSRC_DIR=/srv/instsrc if [ -z $@ ] ; then echo "Usage: register-vmware <path to iso-file> labelname" exit 1 fi #set -x ISO_FILE=$1 mkdir /mnt/loop mount -o loop $ISO_FILE /mnt/loop if [ -f /mnt/loop/packages.xml ] ; then # Determine ISO information OS_LABEL="$( grep "<name>" /mnt/loop/packages.xml | sed -e "s,<name>,," -e "s,</name>,," )" OS_NAME="$( grep "<ProductLineId>" /mnt/loop/packages.xml | sed -e "s,<ProductLineId>,," -e "s,</ProductLineId>,," )" OS_RELEASE="$( grep "<version>" /mnt/loop/packages.xml | sed -e "s,<version>,," -e "s,</version>,," )" OS_BUILD="$( grep "<release>" /mnt/loop/packages.xml | sed -e "s,<release>,," -e "s,</release>,," )" shopt -s extglob OS_LABEL=${OS_LABEL##*( )} OS_NAME=${OS_NAME##*( )} OS_RELEASE=${OS_RELEASE##*( )} OS_BUILD=${OS_BUILD##*( )} elif [ -f /mnt/loop/README.txt ] ; then OS_LABEL="" OS_NAME="" OS_RELEASE="" OS_BUILD="" fi # Create directories mkdir -p $TFTP_DIR/boot/$OS_NAME/$OS_RELEASE-$OS_BUILD mkdir -p $TFTP_DIR/pxelinux.cfg/$OS_NAME mkdir -p $INSTSRC_DIR/$OS_NAME/$OS_RELEASE-$OS_BUILD #set +x # Copy CD/DVD content rsync -av /mnt/loop/* $INSTSRC_DIR/$OS_NAME/$OS_RELEASE-$OS_BUILD # Copy the PXE boot file (initrd/kernel) cp $INSTSRC_DIR/$OS_NAME/$OS_RELEASE-$OS_BUILD/isolinux/initrd.img $TFTP_DIR/boot/$OS_NAME/$OS_RELEASE-$OS_BUILD/initrd.img cp $INSTSRC_DIR/$OS_NAME/$OS_RELEASE-$OS_BUILD/isolinux/vmlinuz $TFTP_DIR/boot/$OS_NAME/$OS_RELEASE-$OS_BUILD/vmlinuz # Create the PXE boot menu cat > $TFTP_DIR/pxelinux.cfg/$OS_NAME/$OS_NAME-$OS_RELEASE-$OS_BUILD.menu << EOF #LABEL $OS_LABEL $OS_RELEASE - build $OS_BUILD #OSNAME $OS_NAME #OSARCH x86_64 MENU TITLE VMware Installservice MENU BACKGROUND addons/background-vmware.png MENU COLOR screen 37;40 #80ffffff #00000000 MENU COLOR border 0 #ffffffff #ee000000 std MENU COLOR title 0 #ffffffff #ee000000 std MENU COLOR unsel 0 #ffffffff #ee000000 std MENU COLOR sel 0 #ffffffff #85000000 std MENU COLOR scrollbar 30;44 #40000000 #00000000 MENU COLOR tabmsg 0 #ee000000 #ffffffff std MENU COLOR cmdmark 0 #ff00ff00 #00000000 std MENU COLOR cmdline 0 #ee000000 #ffffffff std MENU COLOR timeout_msg 0 #ee000000 #ffffffff std MENU COLOR timeout 0 #ee000000 #ffffffff std MENU COLOR disabled 0 #ffffffff #ee000000 std MENU COLOR pwdheader 0 #ff000000 #99ffffff rev MENU COLOR pwdborder 0 #ff000000 #99ffffff rev MENU COLOR pwdentry 0 #ff000000 #99ffffff rev MENU COLOR hotkey 0 #ff00ff00 #ee000000 std MENU COLOR hotsel 0 #ffffffff #85000000 std LABEL DESC MENU LABEL $OS_LABEL $OS_RELEASE MENU DISABLE MENU SEPARATOR LABEL kickstart MENU LABEL ^Kickstart Installation KERNEL boot/$OS_NAME/$OS_RELEASE-$OS_BUILD/vmlinuz APPEND initrd=boot/$OS_NAME/$OS_RELEASE-$OS_BUILD/initrd.img vmkopts=debugLogToSerial:1 mem=512M ks=http://install.home.barfoo.org/kickstart/$OS_NAME-$OS_RELEASE-$OS_BUILD.cfg HOSTNAME= IAPPEND 1 TEXT HELP Es ist zu beachten, das mit TAB der Hostname angepasst werden muss! ENDTEXT LABEL netinst MENU LABEL ^Netzwerkbasierte Installation KERNEL boot/$OS_NAME/$OS_RELEASE-$OS_BUILD/vmlinuz APPEND initrd=boot/$OS_NAME/$OS_RELEASE-$OS_BUILD/initrd.img vmkopts=debugLogToSerial:1 mem=512M url=http://install.home.barfoo.org/instsrc/$OS_NAME/$OS_RELEASE-$OS_BUILD IAPPEND 1 MENU SEPARATOR LABEL back MENU LABEL <-- ^Vorherige Ansicht KERNEL addons/vesamenu.c32 APPEND pxelinux.cfg/$OS_NAME.menu EOF umount /mnt/loop rmdir /mnt/loop |