vSphere

Creating a new TTY in ESXi 4.1 |VMware Communities

Hi,

 

I tried this on a HPE BL460c blade server (boot.cfg is in directory EFI for me) and used the .ISO file via the HPE ILO remote console.

I could not change the initial file.

 

I solved it by adding this in the kickstart script. (see below)

I create a new inittab file instead of adding modules. (+sleep 10)

This is tested on 6.7U1, ISO, HPE virtual CD-ROM

I now only have to create an ISO with only the ks-script inside. (no need for making extras.tgz)

 

The only problem is that if you mistype an entry, the kickstart script see this as a wrong character (the backspace gets wrong interpreted).
This means you may not mistype anything during entering of the parameters?

Maybe someone know how to solve this?

 

Thanks anyway for the code!

 

###############################################################################

# Pre-installation section

###############################################################################

%pre –interpreter=busybox

 

 

#

# Change the inittab file by removing the techsupport.sh line and changing by another tty1

# We do this by creating a new inittab file

#

cp /etc/inittab /etc/inittab.ori

rm /etc/inittab

 

echo “::sysinit:/usr/lib/vmware/secureboot/bin/secureBoot.py” > /tmp/inittab

echo “::sysinit:/usr/lib/vmware/firstboot/bin/firstboot.py -e” >> /tmp/inittab

echo “::sysinit:/usr/lib/vmware/rp/bin/configRP init” >> /tmp/inittab

echo “#” >> /tmp/inittab

echo “::sysinit:/usr/lib/vmware/misc/bin/timeoutConsole.sh tty4 &” >> /tmp/inittab

echo “::sysinit:/bin/init-launcher” >> /tmp/inittab

echo “::wait:/usr/lib/vmware/firstboot/bin/firstboot.py ++group=host/vim/vmvisor/boot -l” >> /tmp/inittab

echo “::wait:/bin/services.sh start” >> /tmp/inittab

echo “::wait:/usr/lib/vmware/misc/bin/ucode_workarounds.py” >> /tmp/inittab

echo “::wait:/bin/apply-host-profiles” >> /tmp/inittab

echo “::wait:/usr/lib/vmware/secureboot/bin/secureBoot.py ++group=host/vim/vmvisor/boot -a” >> /tmp/inittab

echo “::wait:/usr/lib/vmware/vmksummary/log-bootstop.sh boot” >> /tmp/inittab

echo “::wait:/usr/lib/vmware/coredump/collect-coredump-at-boot.sh” >> /tmp/inittab

echo “::wait:/bin/vmdumper -g ‘Boot Successful'” >> /tmp/inittab

echo “::wait:/usr/lib/vmware/misc/bin/killTimeoutConsole.sh” >> /tmp/inittab

echo “::wait:/bin/sh ++min=0,group=host/vim/vimuser/terminal/shell /etc/rc.local” >> /tmp/inittab

echo “::wait:/bin/esxcfg-init –set-boot-progress done” >> /tmp/inittab

echo “::wait:/bin/vmware-autostart.sh start” >> /tmp/inittab

echo “#Following line has been commented out by skor and replaced for Kickstart” >> /tmp/inittab

echo “#tty1::respawn:/bin/initterm.sh tty1 /bin/techsupport.sh” >> /tmp/inittab

echo “tty1::respawn:/bin/initterm.sh tty1 /bin/sh” >> /tmp/inittab

echo “tty2::respawn:-/bin/initterm.sh tty2 /bin/dcuiweasel” >> /tmp/inittab

echo “::restart:/bin/init” >> /tmp/inittab

echo “::shutdown:/usr/lib/vmware/vmksummary/log-bootstop.sh stop” >> /tmp/inittab

echo “::shutdown:/bin/shutdown.sh” >> /tmp/inittab

echo “::shutdown:/usr/lib/vmware/random-seed/bin/storeRandomSeed.sh” >> /tmp/inittab

echo “::shutdown:/bin/vmware-autostart.sh stop” >> /tmp/inittab

echo “::shutdown:/bin/services.sh stop” >> /tmp/inittab

echo “::shutdown:/bin/backup.sh 1” >> /tmp/inittab

echo “#This call sets up the next fast boot, but does not perform a reboot,” >> /tmp/inittab

echo “#and must be called after backup.sh” >> /tmp/inittab

echo “::shutdown:/usr/lib/vmware/loadesx/bin/loadESXShutdown.sh prepare” >> /tmp/inittab

echo “#No logging after this point” >> /tmp/inittab

echo “::shutdown:/usr/lib/vmware/vmsyslog/bin/shutdown.sh” >> /tmp/inittab

 

cp /tmp/inittab /etc/inittab

 

# Wait for techsupport to start

sleep 10

 

################################################################################

# Force init to re-read /etc/inittab

################################################################################

init_pid=`ps -c|grep ‘/bin/init’|awk ‘{ print $1 }’`

kill -1 ${init_pid}

 

################################################################################

# Kill /bin/techsupport.sh and associated getty process

################################################################################

techsupp_pid=`ps -c|grep ‘/bin/techsupport.sh’|awk ‘{ print $1 }’`

kill -9 ${techsupp_pid}

getty_pid=`ps -c|grep ‘getty.*tty1’|awk ‘{ print $1 }’`

kill -9 ${getty_pid}

 

###############################################################################

# Change to virtual terminal 2

###############################################################################

/usr/bin/chvt 1

 

###############################################################################

# Make sure keyboard comes with us

###############################################################################

exec < /dev/tty1 > /dev/tty1 2>&1

 

###############################################################################

# Clear screen

###############################################################################

clear

 

###############################################################################

# INSERT YOUR CODE HERE

###############################################################################

HOSTNAME=””

IPADDR=””

NETMASK=””

GATEWAY=””

DNS=””

 

#while [[ “$HOSTNAME” == “” ]] || [[ “${IPADDR}” == “” ]] || [[ “${NETMASK}” == “” ]] || [[ “${GATEWAY}” == “” ]] || [[ “${DNS}” == “” ]] ; do

    echo

    echo ” *** Please enter the following details: *** “

    echo

    read -p “Hostname: ” HOSTNAME

    read -p “IP Address: ” IPADDR

    read -p “Netmask: ” NETMASK

    read -p “Gateway: ” GATEWAY

    read -p “DNS: ” DNS

#done

 

echo “network –bootproto=static –addvmportgroup=0 –device=vmnic0 –ip=${IPADDR} –netmask=${NETMASK} –gateway=${GATEWAY} –nameserver=${DNS} –hostname=${HOSTNAME}” > /tmp/networkconfig

 

echo -e “Applying the following configuration: n”

echo “Hostname = ${HOSTNAME}”

echo “IP Address = ${IPADDR}”

echo “Netmask = ${NETMASK}”

echo “Gateway = ${GATEWAY}”

echo -e “DNS = ${DNS}n”

sleep 5

/usr/bin/chvt 2


Source link

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Close