Softpanorama

Home Switchboard Unix Administration Red Hat TCP/IP Networks Neoliberalism Toxic Managers
May the source be with you, but remember the KISS principle ;-)
Skepticism and critical thinking is not panacea, but can help to understand the world better

Modifying ISO image to include kickstart file and other useful files

News Kickstart Recommended Books Recommended Links Creating a boot image that is using a remote kickstart file to install Red Hat Minimization of boot ISO Kickstart Configurator Loopback filesystem
Kickstart Installation of Red Hat from a USB drive Installation Networking NTP configuration LVM  Xinetd Etc

Introduction

First of all, please understand that kickstart installation is a tricky business. If you are a novice do not expect a quick success. You need to be persistent as at the initial state you do not fully understand the mechanic of the process and typically make one or more mistakes. As the result your installation fails.  RHEL documentation is weak and internet posts are often incomplete and contradictory so it takes some time to distill the  necessary information and make the necessary number of experiments to succeed.

But this is a great productivity tool for mass install of the servers and if you are persistent you will eventually succeed and your efforts will be rewarded. 

Also this is a pretty elegant solution that is worth learning, unlike, say, systemd ;-)  So far Red hat did not manage to screw kickstart to the extent it screwed the whole RHEL7 distribution with systemd, so in RHEL 7 this is still workable and reliable solution. 

Including kickstart files in the ISO presents dome problems: the ISO9660 file structure is not designed for modification, everything has a strictly defined place with no room to extend files or directories. 

The way to include ks.cfg file is to extract the whole ISO file structure  to working directory, modify that, and re-create a new image (in bootable format) from this working directory.

There are several step you need to accomplish

  1. Extracting the source ISO image to work directory
  2. Adding your ks.cfg file to the tree
  3. Creating a new ISO Image which includes your modifications

There are too major approaches here:

NOTES:

Creating you own ks.cfg file

The best way to create you own ks.cfg file is to use the one that Anaconda created for this type of servers and slightly adapt it. That mean that the fist time you need to perform manual installation and that use the generated kickstart file as a starting point.  This way you can create pretty usable initial Kickstart file that you can refine as you get experience with both the type of servers you are trying to create in bulk and kickstart ecosystem. 

Suggested steps: 

  1. Manually install two or three systems out of, say, 16 or a couple of dozen similar system that  needs to be installed (creating the image with kickstart file make sense starting from say 8 systems to be installed. Otherwise it is simple to point to ks file from grub on each installation. 
  2. Compare all created kickstart files using diff. It is given that they are not identical and you made slight mistakes in one or two installation and then need to be eliminated in final ks.cfg.
    1. Pay attention o the root password you are using. Forgetting it lead to some troubles, when you try to login to the fleshly installed system. 
    2. Pay attention to partitioning of the system (typically you need to wipe out all old partitions if they existed) 
  3. Take some time to document your kickstart file and ides that you used in its creation; place the document in the place where you can find it later.
  4. [Optional] You can modify and partially verify ks.cfg using Kickstart Configurator (very buggy, but still usable)  See
  5. Verify ks.cfg using the ksvalidator [RHEL7 only]

    Verifying the Kickstart File

    When creating or customizing your Kickstart file, it is useful to verify that it is valid before attempting to use it in an installation. CentOS 7.7.1908 includes the ksvalidator command line utility which can be used to do this. This tool is a part of the pykickstart package. To install this package, execute the following command as root:
    # yum install pykickstart
    After installing the package, you can validate a Kickstart file using the following command:
    $ ksvalidator /path/to/kickstart.ks
    Replace /path/to/kickstart.ks with the path to the Kickstart file you want to verify.
    For more information about this tool, see the ksvalidator(1) man page.
  6. Make the Kickstart file available and reachable from the installation system. This is exactly the same as making the installation source (ISO) available, only with the Kickstart file instead of the installation ISO image or tree. For full procedures, see Preparing Installation Sources.
  7. Test ks.cfg from Grub on one blade or the rack server. Usually you will find some errors and need several iterations to make it right.  
  8. Include it in image and create a new boot or full ISO

TIP: If you disk was not initialized (new blade or server) you need to use

zerombr yes
clearpart --all --initlabel

in your ks.cfg file to avoid prompts. In this case  you will not be prompted to confirm that want to wipe out the whole disks.

You can put multiple Kickstart config files in your image and just specify the appropriate one at boot time or in you custom boot image. 

Within the ks.cfg file you can specify pre-install and post-install scripts. These are standard scripts that will be run either before or after the install process. Post install scripts can do the bulk of your configuration but it is important not to overdo this: kickstart is a limited environment with its own gotchas (it boot from its own virtual disk) and all operations that you can do in Postinstall scripts you can do after rebooting the sever via ssh as well. 

For inspiration you can also look at examples on Internet, but  there are a lot of overcomplexity junking out  their so be  careful.  Search for ks.cfg example in your favorite serach engine (actually Google is not the best in this particular case ;-). 

Examples of Kickstart files (old from previous version of RHEL)

There are multiple samples of  custom kickstart configuration files that can be downloaded from the Internet. But generally, you should never use them other that to borrow small fragment that accomplish a specific task (most of them are outdated anyway).

Some useful links:

Here is yet another outdated, but still pretty educational example from Red Hat of  a Classroom Server Kickstart Configuration File (2005). It split kickstart file into useful sections and you should borrow some of those comments, as they represent a useful documentation tool.

This kickstart file has nice  structure that may wish to imitate:

The following is a sample Kickstart configuration file for installing a Red Hat Academy Classroom Server. 

#########################################################################
#
# Red Hat Academy Classroom Server Kickstart Script
#
# $Id: 010_text.dbk,v 1.5 2005/08/08 08:35:41 bowe Exp $
# version: RHEL4
# academy-docs@redhat.com
#
# For more information, see the Red Hat Customization Guide, 
# http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/sysadmin-guide/ch-kickstart2.html
#
#########################################################################

###############################################################
# you definately want to set one of the following
###############################################################

rootpw redhat
bootloader --location=mbr --password=redhat

###########################################################################
#
# the following MD5 encrypted passwords can be generated using
#
#    openssl passwd -1 redhat
#
#  see "man sslpasswd" for more information
#
###########################################################################
#rootpw --isencrypted $1$Su2Gv/$fZeEi7RtQq/RAZ1oEla5z0 # md5 encrypted "redhat"
#bootloader --location=mbr --md5pass=$1$x.3x1cDe$ucwc8hTScWzfb5DYW6r25/


###############################################################
# point to a local installation server, or use "cdrom"
###############################################################
text		# you're not going to be standing there watching it, are you?
cdrom
# url --url http://kickstart.example.com/pub/es4/i386


###############################################################
# partitioning
###############################################################
zerombr yes
clearpart --all --initlabel 
part /boot --fstype ext3 --size 128 
part / --fstype ext3 --size 4096 --grow --maxsize 8192
part /var --fstype ext3 --size 4096 --grow --maxsize 8192 
part swap --recommended 

###############################################################
# network configuration
#   - the following is for the "recommended solution" outlined
#     in the Red Hat Academy Instructor's Guide
###############################################################
network --bootproto=static --ip=192.168.0.254 --netmask=255.255.255.0 --device=eth0
network --bootproto=dhcp --device=eth1
#firewall --enabled --http --ftp --port=https:tcp --port=ipp:tcp
firewall --disabled


###############################################################
# environment 
###############################################################
lang en_US
langsupport --default=en_US
timezone America/New_York
#timezone America/Chicago
#timezone America/Denver
#timezone America/Los_Angeles

###############################################################
# hardware 
###############################################################
mouse generic3ps/2
#mouse genericps/2 --emulthree   	# enable for 2 button mice
keyboard us
xconfig --depth=16 --resolution=1024x768 --defaultdesktop=GNOME --startxonboot


###############################################################
# misc
###############################################################
auth  --useshadow  --enablemd5 
reboot					# reboot automatically when done
install					# instead of "upgrade"

###############################################################
#
# New in RHEL-4: SELinux
#
###############################################################
selinux --enforcing
#selinux --permissive
#selinux --disabled

###############################################################
#
# Software
#
###############################################################
%packages --resolvedeps
@ Workstation Common
@ Server
@ GNOME 

@ Engineering and Scientific
@ Games and Entertainment
@ Mail Server
@ DNS Name Server
@ FTP Server
@ Network Servers
@ Development Tools
@ System Tools

ypserv
dhcp
ethereal-gnome
sysstat
vlock

%post
###############################################################
#
# Post Script - the following script runs on the newly
# installed machine, immediately after installation
#
###############################################################

########################################################
# add entry to /etc/hosts, if necessary
########################################################
#echo "192.168.0.254      rha-server" >> /etc/hosts

########################################################
# turn on required services
########################################################

chkconfig httpd on
chkconfig vsftpd on

########################################################
# install red hat academy custom software
########################################################

#RHASRC=ftp://kickstart.example.com/pub/rha/RPMS/
#rpm -ihv $RHASRC/rha-base*.rpm $RHASRC/rha-classroom-rha*.rpm $RHASRC/rha-server-*.rpm  $RHASRC/fauxlp-*.rpm
#unset RHASRC

########################################################
# add proxy server to /etc/rha_server.conf, if necessary
########################################################

#echo "ExerciseReporterProxy  http://10.1.1.1:8080" >> /etc/rha_server.conf


########################################################
# mirror RHEL-4-ES distribution from remote server
########################################################

#lftp -c "mirror ftp://kickstart.example.com/pub/es4 /var/ftp/pub/es4"

########################################################
# ln anonymous FTP pub dir to Document Root
########################################################

ln -s ../../ftp/pub /var/www/html/pub
# set SELinux context s.t. contents of pub directory available from web
chcon -R --reference /var/www/html /var/ftp/pub

Extracting the source ISO image to work directory

First create a directory that will house the modified image. For example: 

$ mkdir /tmp/RHEL_custom

Now we need to mount the source ISO image locally so we can work with it.

# mount -t iso9660 -o loop RHEL-5.6-x86_64-DVD.iso /media

To extract the source ISO files into another directory. This will take a couple of minutes as we are copying more then 3GB of information: 

cd /media
tar cf - . | (cd /tmp/RHEL_custom; tar xfp -)

Note:

Adding your ks.cfg file to the tree

The ks.cfg file is what the install routine will use while loading the OS. You can add it to the root directory of your ISO image making it king of "golden image" for particular type of servers. Or you can put is on HTTP server or NFS.  This is a better way as you can modify it later.

If your ks,cfg is added to ISO  you need to type  "linux" line path to your ks.cfg file.

boot: linux text ks=cdrom:/ks.cfg

Adding custom RPMs

If you have additional packages that you want to install, you can copy them into the custom image directory. This way they will be included in the image when we create the new ISO.

You can then put a post install script in place to install and configure those packages automatically at install time.

Here the game probably is not worse the candles, as you always install additional RPMS after system is installed and rebooted.  But theoretically as long as you do not exceed the capacity of a CD or DVD, then you can add as much as you want.

Creating a new ISO Image which includes your modifications

Once all of your modifications are complete, you just need to put it all together and create a new ISO image. 

With UEFI this a tricky business.

See Creating a boot image that is using a remote kickstart file to install Red Hat


Top Visited
Switchboard
Latest
Past week
Past month

NEWS CONTENTS

Old News ;-)

[Feb 14, 2020] Install CentOS 7 remotely using Kickstart and GRUB by Fredrik Averpil

Dec 30, 2015 | fredrikaverpil.github.io

This guide assumes the target host is already running CentOS (a derivate of Red Hat Enterprise Linux) or at least running the GRUB boot loader and that you have root access to this host.

What's this all about?

I'm going to install CentOS 7 onto a machine which I do not have physical access to. In order to achieve this, I'm going to need a Kickstart file, some files from the CentOS 7 installation and create a custom GRUB boot loader entry.

The Kickstart file

A Kickstart file will automate the whole installation process. The RedHat 7 Enterprise documentation does a good job explaining:

Red Hat Enterprise Linux 7 offers a way to partially or fully automate the installation process using a Kickstart file. Kickstart files contain answers to all questions normally asked by the installation program, such as what time zone do you want the system to use, how should the drives be partitioned or which packages should be installed. Providing a prepared Kickstart file at the beginning of the installation therefore allows you to perform the entire installation (or parts of it) automatically, without need for any intervention from the user. This is especially useful when deploying Red Hat Enterprise Linux on a large number of systems at once.

A Kickstart file is generated in /root after a successful installation of CentOS. You can use this as a start to create your custom Kickstart file.

As an example, here's a Kickstart file which was created automatically when installing CentOS 7. However, we'll need to make some changes to it so that it will work when remotely installing CentOS 7 via SSH.

First, we'll have to change the installation media from "cdrom" to "url". I'm using one of the mirrors available:

# Use CDROM installation media
#cdrom

# Use network installation
url --url="http://mirror.zetup.net/CentOS/7/os/x86_64/"

We'll also have to tell the installation to clear out any previous partitions on "sda" (the primary disk):

# Partition clearing information
#clearpart --none --initlabel
clearpart --all --drives=sda

Since we want the machine to automatically reboot after completed installation, we'll have to tell it to do that:

# Reboot after installation
reboot

It's possible that we won't know how to access the machine remotely after the installation finished if we don't specify e.g. a static IP address. Here's how we could do that:

# Network information
#network  --bootproto=dhcp --device=eth0 --ipv6=auto --activate
network  --bootproto=static --device=eth0 --gateway=10.0.0.1 --ip=10.0.0.100 --nameserver=8.8.8.8 --netmask=255.255.255.0 --ipv6=auto --activate
network  --hostname=mymachine

Please review all options in the Kickstart file. There are additional options which I will not cover here:

I recommend taking a minute or two to read through the Kickstart How-To .

Verify the Kickstart file

You can make sure your Kickstart file is valid by using "ksvalidator":

Install ksvalidator:

yum install pykickstart

Run ksvalidator on your Kickstart file:

ksvalidator /path/to/anaconda-ks.cfg

Please note: ksvalidator will not attempt to validate the %pre , %post and %packages sections of the Kickstart file.

Make the Kickstart file available on a web server

During the installation phase, Anaconda will attempt to read the Kickstart file from somewhere. I'm serving it using a basic web server .

Download vmlinuz and initrd.img

Download vmlinuz and initrd.img from the desired CentOS version you wish to install and place them in /boot . For example:

curl -o /boot/vmlinuz http://mirror.zetup.net/CentOS/7/os/x86_64/isolinux/vmlinuz
curl -o /boot/initrd.img http://mirror.zetup.net/CentOS/7/os/x86_64/isolinux/initrd.img
Add custom boot entry in CentOS 6.x (or GRUB 1.x )

If you are installing CentOS 7 remotely on a CentOS 6 system, read on

Add a custom entry into /boot/grub/grub.conf :

title Install CentOS 7
kernel /vmlinuz ks=http://some-web-server.com/anaconda-ks.cfg
initrd /initrd.img

If you make sure that this entry is the first entry in the configuration file, you will not have to bother defining this to become the default entry. But if you decide to not place this entry first, you will have to tell grub which entry this is by changing this line, also in /boot/grub/grub.conf :

default 0

Also, you should replace the URL in the custom boot entry to reflect the location of where your Kickstart file is at.

You may wish to add options to the end of the kernel line of the boot stanza in the custom boot entry. For example, if you wish to monitor the installation via VNC, you'll have to add VNC options as well as network options with static IP address.

Add custom boot entry in CentOS 7.x (or GRUB 2.x )

If you are installing CentOS 7 remotely on a CentOS 7 system, read on

Add a custom menu entry into /etc/grub.d/40_custom , which is where custom boot entries are defined when you use GRUB2:

menuentry "Install CentOS 7" {
    set root=(hd0,1)
    linux /vmlinuz ks=http://some-web-server.com/anaconda-ks.cfg
    initrd /initrd.img
}

You should replace the URL in the custom boot entry to reflect the location of where your Kickstart file is at.

Add any additional boot options at the end of the linux line of the boot stanza in the custom boot entry. For example, if you wish to monitor the installation via VNC, you'll have to add VNC options as well as network options with static IP address.

Make the custom entry the default choice in /etc/default/grub :

GRUB_DEFAULT="Install CentOS 7"

Then run the following to make your changes go into effect:

grub2-mkconfig --output=/boot/grub2/grub.cfg
Reboot your system to install CentOS 7

Go grab a cup of coffee and reboot your system:

reboot
Additional notes

Personally, I find it very useful to run Pre-installation Python scripts using %pre --interpreter=/usr/bin/python and I highly recommend reading more on that in the documentation. Currently, I use this to match the machine's MAC address against a JSON/dictionary, which will determine which hostname and static IP address the machine should use, as I'm managing a large number of computational nodes, running CentOS, on our local network.

If CentOS (or GRUB) is not present on the machine you wish to install CentOS 7 onto, you can boot via the CentOS 7 DVD or USB-stick. In the menu that appears, you can hit "tab" and enter custom commands, such as vmlinuz initrd=initrd.img ks= http://some-web-server.com/anaconda-ks.cfg to specify the Kickstart file. This will cause the installation to complete automatically without requiring any input from you. For a complete tutorial on this check this out.

If a package requires access to a specific repository, you can specify this in the Kickstart file:

repo --name="EPEL" --baseurl=http://dl.fedoraproject.org/pub/epel/7/x86_64/

If you need to know the location of the Kickstart file, from within the Kickstart file (perhaps you wish to access another file relative to its location) you can read /proc/cmdline and parse it. Here's an example:

%pre --interpreter=/usr/bin/python
cmdline = ''
with open('/proc/cmdline', 'r') as myfile:
  cmdline = myfile.read()
pieces = cmdline.split(' ')
for piece in pieces:
  if 'ks=' in piece:
    KS_LOCATION = piece[ piece.rfind('ks=')+3 : piece.rfind('/') ]
%end

[Feb 10, 2020] Creating an automated CentOS 7 Install via Kickstart file

Feb 10, 2020 | marclop.svbtle.com

File Generation #

In this post I'll try to describe as throughly as I can and make a walkthrough of how to automate the installation of CentOS7 via a Kickstarter file located in an accesible web server over the Internet. Here are the steps required to do it:

  1. [OPTIONAL] Install CentOS7 using your preferred method
  2. [OPTIONAL] Copy the resulting installation file located under /root/anaconda-ks.cfg
  3. Open your kickstart file and begibn writing your desired configuration
  4. Save it when it suits your needs and upload it to any http server you have in your reach (you can alternatively use onedrive, dropbox, or even github's gist)

First, you have to write a custom kickstart file for your installation, if you find yourself unable to do this, (I'm sure you can google around for a while and have a clear picture in no time) you can alternatively install CentOS7 in an unnatended installation manner and then modify the resulting kickstarter file named 'anaconda-ks.cfg', located under the /root directory.

Then, copy it to your local working desktop and open it with your preferred editor (sulbime text is my favourite here). The kickstart file should look like a regular ini/cfg file and might look intimidating at first, so let's break it down in parts:

Define installation source and aditional repos:

# Use network installation
url --url="http://sunsite.rediris.es/mirror/CentOS/7/os/x86_64"
repo --name="EPEL" --baseurl=http://dl.fedoraproject.org/pub/epel/beta/7/x86_64
# Run the Setup Agent on first boot
firstboot --enable
# Accept Eula
eula --agreed
# Reboot afer installing
reboot

Define Language/locale settings:

# Keyboard layouts
keyboard --vckeymap=es --xlayouts='es'
# System language
lang en_US.UTF-8

Define Network, time and timezone settings:

# Network information
network  --bootproto=dhcp --device=enp0s3 --ipv6=auto --activate
network  --hostname=centos7.test.local
# System timezone
timezone Europe/Madrid --isUtc --ntpservers=0.centos.pool.ntp.org,1.centos.pool.ntp.org,2.centos.pool.ntp.org,3.centos.pool.ntp.org

Define User/Authentication settings:

# System authorization information
auth --enableshadow --passalgo=sha512
# Root password
rootpw --iscrypted SOMECRYPTEDPASSWORD
user --groups=wheel --homedir=/home/marc --name=marc --password=SOMECRYPTEDPASSWORD --iscrypted --gecos="marc"

Define System services:

# System services
services --enabled=NetworkManager,sshd,chronyd

Define Botlooader and partition information:

# System bootloader configuration
bootloader --location=mbr --boot-drive=sda
autopart --type=lvm
zerombr
# Partition clearing information
clearpart --all --drives=sda
ignoredisk --only-use=sda

Define SELinux settings:

# Selinux State
selinux --permissive

Specify packages which will be installed:

# Packages
%packages
@base
@core
chrony
yum-cron
vim
salt-minion

%end

With this kickstart file, we will do the following actions:

Password generation #

So, you might be asking, how do I generate this wickedly complicated SHA512 password? here is how to do it:

First, check if you have python python 2.6 or lower

[root@centos7 ~]# python -V
Python 2.7.5

If (like me) you have python 2.7.5 you'll have to issue this command to generate a valid SHA512 hashed password and enter the actual password:

[root@centos7 ~]# python -c 'import crypt,getpass; print(crypt.crypt(getpass.getpass(), crypt.mksalt(crypt.METHOD_SHA512)))'
Password:
$6$kPbnFm3jv9YDRKeo$GcMRSlE0M2WMO0v1AY9LRaVDnOdhRELiPPczb6Q8EEBLgofsRto3jwwAx5hTUJbQCkWt9Meg2u2P2xOmjBW9j.

If you have a version lower than 2.7, then use:

python -c 'import crypt; print crypt.crypt("CLEARTEXTPASSWORD", "$6$saltsalt$")'

Where CLEARTEXTPASSWORD goes your password, so don't forget to update it.

Upload to a reachable URL for your host. #

To have this set up working, you'll need the following:

  1. CentOS 7 Network install iso
  2. A network with DHCP in it
  3. A reachable HTTP server to put your ks.cfg file (such as a Onedrive public folder or an actual http server you own)

So, after you have all of that, you can mount your ISO in VirtualBox or VMware and boot the machine:

centos7-1.PNG

Once it's powered on it'll ask you to chose an action, simply press TAB and erase what's in there and write:

vmlinuz initrd=initrd.cfg ks=http://YOURDOMAIN/ks.cfg

centos7-2.PNG

It will download the ks.cfg file, parse it and then will start the scripted installation just as we defined.

centos7-4.PNG

centos7-5.PNG

centos7-6.PNG

After it has installed all the necessary packages, it will restart itself, we have to unmount the disk in order to be able to boot into the system. So if you're already in the installation menu, please remove the disk and reset the VM.

centos7-7.PNG

After removing the disk, you'll notice that the host boots blazingly fast (thanks to Systemd)

centos7-8.PNG

centos7-9.PNG

In the next post I'll outline some of the differences of CentOS 7 from Centos 6.

By the way, here is the final Kickstart file:

#version=RHEL7
# Action
install

# System authorization information
auth --enableshadow --passalgo=sha512
repo --name="EPEL" --baseurl=http://dl.fedoraproject.org/pub/epel/7/x86_64

# Accept Eula
eula --agreed

reboot
# Use network installation
url --url="http://sunsite.rediris.es/mirror/CentOS/7/os/x86_64"
# Run the Setup Agent on first boot
firstboot --enable
ignoredisk --only-use=sda
# Keyboard layouts
keyboard --vckeymap=es --xlayouts='es'
# System language
lang en_US.UTF-8

# Network information
network  --bootproto=dhcp --device=enp0s3 --noipv6 --activate
network  --hostname=centos7.test.local
# Root password
rootpw --iscrypted SOMECRYPTEDPASSWORD
# System services
services --enabled=NetworkManager,sshd,chronyd
# System timezone
timezone Europe/Madrid --isUtc --ntpservers=0.centos.pool.ntp.org,1.centos.pool.ntp.org,2.centos.pool.ntp.org,3.centos.pool.ntp.org
user --groups=wheel --homedir=/home/marc --name=marc --password=SOMECRYPTEDPASSWORD --iscrypted --gecos="marc"
# System bootloader configuration
bootloader --location=mbr --boot-drive=sda
autopart --type=lvm
zerombr
# Partition clearing information
clearpart --all --drives=sda

# Selinux State
selinux --permissive

%packages
@base
@core
chrony
yum-cron
vim

%end

Ultimately you can modify the ISO file and the isolinux/isolinux.cfg and make it autostart and everything, but for this post it just wasn't the right approach.

If you liked this post please, just kudos it :)

[Feb 10, 2020] UserPjones-BootableCDsForBIOSAndUEFI - Fedora Project Wiki

Feb 10, 2020 | fedoraproject.org

User:Pjones/BootableCDsForBIOSAndUEFI

From Fedora Project Wiki < User:Pjones

Contents

Bootable CDs

In some cases, we want CDs to be bootable by both tradition BIOS and UEFI on the same systems. This means we need to do some special things to the disk.

The primary difference here is how the disc is created with mkisofs

Old BIOS way

With normal BIOS, the way to do this is something like:

mkisofs -U -A "MyLinux_1 x86_64" -V "MyLinux_1 x86_64 Disc 1" \
    -volset "MyLinux_1 x86_64" -J -joliet-long -r -v -T -x ./lost+found \
    -o /home/pjones/MyLinux/1/x86_64/iso/MyLinux-1-x86_64-disc1-dualboot.iso \
    -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 \
    -boot-info-table .

There are sections here, and to understand what changes are necessary for UEFI boot support, they must be identified. The first section is about the entire volume:

mkisofs -U -A "MyLinux_1 x86_64" -V "MyLinux_1 x86_64 Disc 1" \
    -volset "MyLinux_1 x86_64" -J -joliet-long -r -v -T -x ./lost+found \
    -o /home/pjones/MyLinux/1/x86_64/iso/MyLinux-1-x86_64-disc1.iso

This specifies global format options, such as the use of the joliet long filename format, and also the output image. The second section specifies information about how to create the El Torito boot image:

-b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot \
    -boot-load-size 4 -boot-info-table

The last section specifies the tree to find the files for the image:

.
New UEFI/BIOS hybrid method

To make a disk also EFI bootable, it needs an EFI bootable image, such as efiboot.img in our trees, and that needs to be inserted as a second El Torito boot image. To do this, we insert a 4th section between the El Torito section and the section about our tree, which looks like this:

-eltorito-alt-boot -e images/efiboot.img -no-emul-boot

Thus making the full command line look like:

mkisofs -U -A "MyLinux_1 x86_64" -V "MyLinux_1 x86_64 Disc 1" \
    -volset "MyLinux_1 x86_64" -J -joliet-long -r -v -T -x ./lost+found \
    -o /home/pjones/MyLinux/1/x86_64/iso/MyLinux_1-x86_64-disc1-dualboot.iso \
    -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 \
    -boot-info-table -eltorito-alt-boot -e images/efiboot.img -no-emul-boot .
Testing the image

The first thing to do to test images is a simple smoke-test using the "dumpet" tool. Here's what it looks like with a traditional ISO image:

pjones4:/home/pjones/MyLinux/1/x86_64/iso$ dumpet -i MyLinux_1-x86_64-disc1-ftp.iso
Validation Entry:
        Header Indicator: 0x01 (Validation Entry)
        PlatformId: 0x00 (80x86)
        ID: ""
        Checksum: 0x55aa
        Key bytes: 0x55aa
Boot Catalog Default Entry:
        Entry is bootable
        Boot Media emulation type: no emulation
        Media load segment: 0x0 (0000:7c00)
        System type: 0 (0x00)
        Load Sectors: 4 (0x0004)
        Load LBA: 154 (0x0000009a)

There are some important considerations, including:

On a UEFI/BIOS hybrid image, the output will look like this:

pjones4:/home/pjones/MyLinux/1/x86_64/iso$ dumpet -i MyLinux_1-x86_64-disc1-dualboot.iso 
Validation Entry:
        Header Indicator: 0x01 (Validation Entry)
        PlatformId: 0x00 (80x86)
        ID: ""
        Checksum: 0x55aa
        Key bytes: 0x55aa
Boot Catalog Default Entry:
        Entry is bootable
        Boot Media emulation type: no emulation
        Media load segment: 0x0 (0000:7c00)
        System type: 0 (0x00)
        Load Sectors: 4 (0x0004)
        Load LBA: 348 (0x0000015c)
Section Header Entry:
        Header Indicator: 0x91 (Final Section Header Entry)
        PlatformId: 0xef (EFI)
        Section Entries: 1
        ID: ""
Boot Catalog Section Entry:
        Entry is bootable
        Boot Media emulation type: no emulation
        Media load address: 0 (0x0000)
        System type: 0 (0x00)
        Load Sectors: 776 (0x0308)
        Load LBA: 154 (0x0000009a)

The BIOS entry looks the same, except for the Load LBA (the address of the image on the disc), but there's also another Section Header Entry and Boot Catalog Section Entry, which specify the UEFI boot image. The important aspects of this are:

If all these things are correct, an EFI system should see the efiboot.img, and if it is formed correctly, then you've got bootable media on a UEFI machine and BIOS machines.

[Feb 10, 2020] cd - Creating custom DVD for RHEL 7 with kickstart - Stack Overflow

Feb 10, 2020 | stackoverflow.com

> ,

I found the way to create custom DVD from the RHEL7 page.
  1. Mount the downloaded image

    mount -t iso9660 -o loop path/to/image.iso /mnt/iso

  2. Create a working directory - a directory where you want to place the contents of the ISO image.

    mkdir /tmp/ISO

  3. Copy all contents of the mounted image to your new working directory. Make sure to use the -p option to preserve file and directory permissions and ownership.

    cp -pRf /mnt/iso /tmp/ISO

  4. Unmount the image.

    umount /mnt/iso

  5. Make sure your current working directory is the top-level directory of the extracted ISO image - e.g. /tmp/ISO/iso. Create the new ISO image using genisoimage:

    genisoimage -U -r -v -T -J -joliet-long -V "RHEL-7.1 Server.x86_64" -Volset "RHEL-7.1 Server.x86_64" -A "RHEL-7.1 Server.x86_64" -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -eltorito-alt-boot -e images/efiboot.img -no-emul-boot -o ../NEWISO.iso .

Hope the answer will helpful:

[Mar 07, 2019] Section A.15.1, "Advanced Partitioning Example"

Mar 07, 2019 | docs.fedoraproject.org

.

--all
Erases all partitions from the system. Warning This option will erase all disks which can be reached by the installer, including any attached network storage. Use this option with caution.
--drives=
Specifies which drives to clear partitions from. For example, the following clears all the partitions on the first two drives on the primary IDE controller:
clearpart --drives=hda,hdb --all
To clear a multipath device, use the format disk/by-id/scsi- WWID , where WWID is the world-wide identifier for the device. For example, to clear a disk with WWID 58095BEC5510947BE8C0360F604351918 , use:
clearpart --drives=disk/by-id/scsi-58095BEC5510947BE8C0360F604351918
This format is preferable for all multipath devices, but if errors arise, multipath devices that do not use logical volume management (LVM) can also be cleared using the format disk/by-id/dm-uuid-mpath- WWID , where WWID is the world-wide identifier for the device. For example, to clear a disk with WWID 2416CD96995134CA5D787F00A5AA11017 , use:
clearpart --drives=disk/by-id/dm-uuid-mpath-2416CD96995134CA5D787F00A5AA11017
Warning Never specify multipath devices by device names like mpatha . Device names such as this are not specific to a particular disk. The disk named /dev/mpatha during installation might not be the one that you expect it to be. Therefore, the clearpart command could target the wrong disk.
--list=
Specifies which partitions to clear. This option overrides the --all and --linux options if used. Can be used across different drives. For example:
clearpart --list=sda2,sda3,sdb1
--disklabel=
Create a set disk label when relabeling a disk.
--linux
Erases all Linux partitions.
--none
Do not remove any partitions. This is the default behavior - using this option is the same as not using the clearpart command at all.
Note Using the clearpart --all command in a Kickstart file to remove all existing partitions during the installation will cause Anaconda to pause and prompt you for a confirmation. If you need to perform the installation automatically with no interaction, add the zerombr command to your Kickstart file.

[Mar 07, 2019] Kickstart Tutorial Practical Examples for RHEL 7 - CentOS 7 tuxfixer.com

Mar 07, 2019 | www.tuxfixer.com

­ Linux installation can be performed totally unattended using Kickstart file, which contains configuration, required setup and post installation tasks to fully automate installation process without being prompted for any input details. Kickstart file can be placed in the remote repository or can be included in ISO image in order to be read by Anaconda installer during system installation.

In this tutorial we present some practical solutions that can be placed in kickstart file to automate CentOS 7 / Red Hat 7 installation tasks.

At the very beginning let's take a look at this kickstart file: ks.cfg , which is a complete and working set of commands and functions that let us perform hardware detection, unattended disk partitioning, additional RPMs installation, kernel parameters configuration, etc

This file can be used as it is, without any modifications and this will do the whole automated installation job, but let's break it down into pieces to describe particular use cases :

[Mar 06, 2019] Kickstart Tutorial Practical Examples for RHEL 7 - CentOS 7 tuxfixer.com

Mar 06, 2019 | www.tuxfixer.com

­ Linux installation can be performed totally unattended using Kickstart file, which contains configuration, required setup and post installation tasks to fully automate installation process without being prompted for any input details. Kickstart file can be placed in the remote repository or can be included in ISO image in order to be read by Anaconda installer during system installation.

In this tutorial we present some practical solutions that can be placed in kickstart file to automate CentOS 7 / Red Hat 7 installation tasks.

At the very beginning let's take a look at this kickstart file: ks.cfg , which is a complete and working set of commands and functions that let us perform hardware detection, unattended disk partitioning, additional RPMs installation, kernel parameters configuration, etc

This file can be used as it is, without any modifications and this will do the whole automated installation job, but let's break it down into pieces to describe particular use cases :

[Sep 18, 2017] Kickstart File Example

Kickstart File Example

Below is an example of a kickstart file that you can use to install and configure Parallels Cloud Server in unattended mode. You can use this file as the basis for creating your own kickstart files.

# Install Parallels Cloud Server

install

# Uncomment the line below to install Parallels Cloud Server in a completely unattended mode

# cmdline

# Use the path of http://example.com/pcs to get the installation files.

url --url http://example.com/pcs

# Use English as the language during the installation and as the default system language.

lang en_US.UTF-8

# Use the English keyboard type.

keyboard us

# Uncomment the line below to remove all partitions from the SDA hard drive and create these partitions: /boot, /, /vz, and swap.

# clearpart --drives=sda --all --initlabel

# zerombr

part /boot --fstype=ext4 --size=512

part / --fstype=ext4 --size=20096

part /vz --fstype=ext4 --size=40768 --grow

part swap --size=4000

# Use a DHCP server to obtain network configuration.

network --bootproto dhcp

# Set the root password for the server.

rootpw xxxxxxxxx

# Use the SHA-512 encryption for user passwords and enable shadow passwords.

auth --enableshadow --passalgo=sha512

# Set the system time zone to America/New York and the hardware clock to UTC.

timezone --utc America/New_York

# Set sda as the first drive in the BIOS boot order and write the boot record to mbr.

bootloader --location=mbr

# Tell the Parallels Cloud Server installer to reboot the system after installation.

reboot

# Install the Parallels Cloud Server license on the server.

key XXXXXX-XXXXXX-XXXXXX-XXXXXX-XXXXXX

# Create the virt_network1 Virtual Network on the server and associate it with the network adapter eth0.

vznetcfg --net=virt_network1:eth0

# Configure the ip_tables ipt_REJECT ipt_tos ipt_limit modules to be loaded in Containers.

# Use the http://myrepository.com to handle Fedora OS and application templates.

vztturlmap $FC_SERVER http://myrepository.com

# Install the listed EZ templates. Cache all OS templates after installation. Skip the installation of pre-created templates.

nosfxtemplate

%eztemplates --cache

centos-6-x86_64

centos-6-x86

mailman-centos-6-x86_64

mailman-centos-6-x86

# Install the packages for Parallels Cloud Server on the server.

%packages

@base

@core

@vz

@ps

Kickstart file example for installing on EFI-based systems

You can use the file above to install Parallels Cloud Server on BIOS-based systems. For installation on EFI-based systems, you need to modify the following places in the file (the changes are highlighted in bold):

# The following 4 commands are used to remove all partitions from the SDA hard drive and create these partitions: /boot/efi (required for EFI-based systems), /boot, /, /vz, and swap.

# clearpart --drives=sda --all --initlabel

part /boot/efi --fstype=efi --grow --maxsize=200 --size=20

part /boot --fstype=ext4 --size=512

part / --fstype=ext4 --size=20096

part /vz --fstype=ext4 --size=40768 --grow

part swap --size=4000

# Configure the bootloader.

bootloader --location=partition

Kickstart file example for upgrading to Parallels Cloud Server 6.0

Below is an example of a kickstart file you can use to upgrade your system to Parallels Cloud Server 6.0.

# Upgrade to Parallels Cloud Server rather than perform a fresh installation.

upgrade

# Use the path of http://example.com/pcs to get the installation files.

url --url http://example.com/pcs

# Use English as the language during the upgrade and as the default system language.

lang en_US.UTF-8

# Use the English keyboard type.

keyboard us

# Set the system time zone to America/New York and the hardware clock to UTC.

timezone --utc America/New_York

# Upgrade the bootloader configuration.

bootloader --upgrade

[Sep 18, 2017] RHEL ISO with kickstart file

Aug 06, 2017 | unix.stackexchange.com

Hugo , asked Jan 7 '15 at 16:36

I am trying to edit the original RHEL 6.5 DVD (rhel-server-6.5-x86_64-dvd.iso) from redhat in order to add kickstart file on it. The goal is to have one 3.4Go iso with automatic install. And not one boot media and one DVD.

This technique is not supported by redhat officially, but I found a procedure : https://access.redhat.com/solutions/60959

My ks.cfg looks like :

install
cdrom
repo --name="Red Hat Enterprise Linux"  --baseurl=file:/mnt/source --cost=100
repo --name=HighAvailability --baseurl=file:///mnt/source/HighAvailability

I got an error when the installer start : it didn't find the disk Red Hat Enterprise Linux.

I guess this is because installer is not looking on its own media.

Is there a way to achieve this ? Does the cdrom have optional parameter to hard link the device ?

tonioc , answered Jan 7 '15 at 17:30

You don't need to set the repo URLs in ks.cfg, here is an example of kickstart that I use currently with rhel6.
# interactive install from CD-ROM/DVD
interactive
install
cdrom

key --skip
lang en_US.UTF-8
# keyboard us

#
clearpart --all --initlabel
part /boot --fstype ext4 --size=100
part pv.100000 --size=1 --grow
volgroup vg00 --pesize=32768 pv.100000
logvol / --fstype ext4 --name=lvroot --vgname=vg00 --size=15360
logvol swap --fstype swap --name=lvswap --vgname=vg00 --size=2048
logvol /var --fstype ext4 --name=lvvar --vgname=vg00 --size 5120

timezone Europe/Paris
firewall --disabled
authconfig --useshadow --passalgo=sha512
selinux --enforcing

#skipx

# pre-set list of packages/groups to install 
%packages
@core
@server-policy
acpid
device-mapper-multipath
dmidecode
# ... and so on the list of packages/groups I pre-customize (and with - those I don't want)
vsftpd
wget
xfsprogs
-autoconf
-automake
-bc
# ... and so on
#-----------------------------------------------------------------------------
# postinstall, execution avec chroot dans le systeme installé.
%post --interpreter=/bin/sh --log=/root/post_install.log
echo -e "================================================================="
echo -e "       Starting kickStart post install script "

# do some extra stuff here , like mounting cd-rom copying add-ons specific for my product

Hugo , asked Jan 7 '15 at 16:36

I am trying to edit the original RHEL 6.5 DVD (rhel-server-6.5-x86_64-dvd.iso) from redhat in order to add kickstart file on it. The goal is to have one 3.4Go iso with automatic install. And not one boot media and one DVD.

This technique is not supported by redhat officially, but I found a procedure : https://access.redhat.com/solutions/60959

My ks.cfg looks like :

install
cdrom
repo --name="Red Hat Enterprise Linux"  --baseurl=file:/mnt/source --cost=100
repo --name=HighAvailability --baseurl=file:///mnt/source/HighAvailability

I got an error when the installer start : it didn't find the disk Red Hat Enterprise Linux.

I guess this is because installer is not looking on its own media.

Is there a way to achieve this ? Does the cdrom have optional parameter to hard link the device ?

tonioc , answered Jan 7 '15 at 17:30

You don't need to set the repo URLs in ks.cfg, here is an example of kickstart that I use currently with rhel6.
# interactive install from CD-ROM/DVD
interactive
install
cdrom

key --skip
lang en_US.UTF-8
# keyboard us

#
clearpart --all --initlabel
part /boot --fstype ext4 --size=100
part pv.100000 --size=1 --grow
volgroup vg00 --pesize=32768 pv.100000
logvol / --fstype ext4 --name=lvroot --vgname=vg00 --size=15360
logvol swap --fstype swap --name=lvswap --vgname=vg00 --size=2048
logvol /var --fstype ext4 --name=lvvar --vgname=vg00 --size 5120

timezone Europe/Paris
firewall --disabled
authconfig --useshadow --passalgo=sha512
selinux --enforcing

#skipx

# pre-set list of packages/groups to install 
%packages
@core
@server-policy
acpid
device-mapper-multipath
dmidecode
# ... and so on the list of packages/groups I pre-customize (and with - those I don't want)
vsftpd
wget
xfsprogs
-autoconf
-automake
-bc
# ... and so on
#-----------------------------------------------------------------------------
# postinstall, execution avec chroot dans le systeme installé.
%post --interpreter=/bin/sh --log=/root/post_install.log
echo -e "================================================================="
echo -e "       Starting kickStart post install script "

# do some extra stuff here , like mounting cd-rom copying add-ons specific for my product

[Sep 17, 2017] RHEL6 Unable to download kickstart file

Sep 17, 2017 | unix.stackexchange.com
Oops! I didn't mean to do this.
up vote down vote favorite

robertpas , asked Nov 9 '15 at 15:13

In our lab we have a set of scripts that automatically configure a kickstart installation for RHEL5 on HP ProLiant DL380p Gen8. Based on data from several configuration files, it does the following steps:
  1. mounts redhat dvd
  2. modifies isolinux.cfg accordingly
  3. creates ks.cfg
  4. creates a bootdisk with the installation data (isolinux.cfg, ks.cfg, etc)
  5. creates a http server with the bootdisk directory.
  6. mounts the bootdisk through ILO ( /dev/scd1 )
  7. installs RHEL5

Here is the line referring to the kickstart file location :

append initrd=initrd.img ks=hd:scd1:/isolinux/ks.cfg ksdevice=eth4

Everything works well for RHEL5, but there have been requests for RHEL6.

For RHEL6, everything seems to work OK until #7, where it returns the message "unable to download kickstart file" . I have commented some lines in the scripts, eliminating the installation part and leaving only the ILO mount part.

The bootdisk is mounted and accessible on /dev/scd1 . The ks.cfg file is present there. I have also tested and the files from the Kickstart server are accessible with wget .

I have also tried accessing the ks.cfg file through http :

append initrd=initrd.img ks=http://<ip>:<port>/boot/isolinux/ks.cfg ksdevice=eth4

The above part did not work.

But what really vexes me is that RHEL5 works in the same conditions, but RHEL6 does not.

I have been talking to redhat support for a week and they don't seem to know what is wrong.

Any help would be greatly appreciated.

robertpas , answered Nov 11 '15 at 8:11

I have figured out the problem.

There seems to be a difference between RHEL5 and RHEL6 at the installation level.

RHEL5 will detect your physical cdrom and mount it on /dev/scd0 , therefore the location of the mount will be /dev/scd1 . RHEL6 does not seem to do this, therefore the mount location will be /dev/scd0 .

The correct way to declare the ks file location in a case like this is :

append initrd=initrd.img ks=hd:scd0:/isolinux/ks.cfg ksdevice=eth4

I hope someone will find this helpful in the future.

[Aug 10, 2017] Kickstart Problem with --initlabel

Notable quotes:
"... Last edited by phatrik; 08-07-2012 at 11:17 AM . Reason: prefixed with solved ..."
Aug 07, 2012 | www.linuxquestions.org
phatrik
Kickstart: Problem with --initlabel

I'm having a problem when using kickstart to deploy CentOS 6.3 KVM guest OS and no one seems to know why so I figured I'd ask in the KVM SF :-) Details:

- Tyring to install CentOS 6.3
- Doing a netinstall using a FTP site
- The installation is for a guest OS (KVM).

The install is being launched with:

virt-install -n server1.example.com -r 768 -l /media/netinstall -x "ks=ftp://192.168.100.2/pub/ks.cfg"

The install starts and gets to the point where I see "Error processing drive. This device may need to be re-initialized." The relevant part of my KS file:

clearpart --initlabel --all

# Disk partitioning information

part /boot --fstype="ext4" --size=500
part /home --fstype="ext4" --size=2048
part swap --fstype="swap" --size=2048
part / --fstype="ext4" --grow --size=1

When I switch to the 3rd terminal for information, here's what I see:

required disklable type for sda (1) is None
default diskalbel type for sda is msdos
selecting msdos diskalbel for sda based on size

Based on "required diskalbel type for sda (1) is none" I decided to remove the --initlabel parm, however I still face the same problem (prompted to initialize the disk).

TIA

Erik


Last edited by phatrik; 08-07-2012 at 11:17 AM . Reason: prefixed with solved
dyasny 08-07-2012 Registered: Dec 2007 Location: Canada Distribution: RHEL,Fedora Posts: 995
I'd just abandon virt-install and deploy VMs from a template instead. Much faster and easier to do
phatrik 08-07-2012, 08:14

Thank you for your reply, but that's obviously not the answer I'm looking for. Yes I know virt-clone could be used but what I'm truly interested in is getting at the bottom of this problem.

wungad

From RedHat Knowledge base
Issue

The 'clearpart --initlabel' option in a kickstart no longer initializes drives in RHEL 6.3.

Environment
Red Hat Enterprise Linux 6.3
Anaconda (kickstart)

Resolution

Use the 'zerombr' option in the kickstart to initialize disks and create a new partition table.

Use the 'ignoredisk' option in the kickstart to limit which disks are initialized by the 'zerombr' option. The following example will limit initialization to the 'vda' disk only:
zerombr
ignoredisk --only-use=vda

phatrik

Thank you for your reply, that's exactly what I was looking for.

Quote:

Originally Posted by wungad Issue
The 'clearpart --initlabel' option in a kickstart no longer initializes drives in RHEL 6.3.

Environment

Red Hat Enterprise Linux 6.3
Anaconda (kickstart)

Resolution

Use the 'zerombr' option in the kickstart to initialize disks and create a new partition table.
Use the 'ignoredisk' option in the kickstart to limit which disks are initialized by the 'zerombr' option. The following example will limit initialization to the 'vda' disk only:
zerombr
ignoredisk --only-use=vda

[Aug 08, 2017] Kickstart option to set GRUB drive location?

Notable quotes:
"... ignoredisk --drives=sdb ..."
Aug 08, 2017 | www.centos.org

andersbiro " 2010/03/04 12:36:32

Hello, I have successfully created a Centos USB stick installation with an automated kickstart configuration according to the instructions at http://wiki.centos.org/HowTos/InstallFromUSBkey .

Everything works flawlessly with the exception that the installation writes the GRUB Boot Loaders on the USB stick instead of the destination hard drive and hence can only be booted from the USB stick.

Afterwards I can solve this manually by editing grub.conf to point to the hard drive and using the grub utility I can nstall the Grub loader on the hard drive MBR instead and then it boots normally.

The aim is however to create a fully automated installation since the end users in question are expected to be technically proficient so my question is if there is a kickstart option to explicitly write GRUB correctly to the hard drive from the very beginning?

There seems to be a kickstart "bootloader" option but I can not really see any flags that would explicitly set the GRUB on a specified hard drive? Top


AlanBartlett
Forum Moderator
Posts: 9310
Joined: 2007/10/22 11:30:09
Location: ~/Earth/UK/England/Suffolk
Contact: Contact AlanBartlett Website
Re: Kickstart option to set GRUB drive location?

Post by AlanBartlett " 2010/03/04 18:52:16

In the CentOS wiki article that you reference, under the heading Notes , there is a [color=ff1480]cherry-red[/color] block of text. Isn't that appropriate?

If not, do you have any suggestions for improvement to the article? Top


pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact: Contact pschaff Website
Kickstart option to set GRUB drive location?

Post by pschaff " 2010/03/04 21:36:41

andersbiro wrote:
...
There seems to be a kickstart "bootloader" option but I can not really see any flags that would explicitly set the GRUB on a specified hard drive?

How about Kickstart Options : Code: Select all

bootloader (required)
Specifies how the boot loader should be installed. This option is required for both installations and upgrades.

* --append= ? Specifies kernel parameters. To specify multiple parameters, separate them with spaces. For example:

bootloader --location=mbr --append="hdd=ide-scsi ide=nodma"

* --driveorder ? Specify which drive is first in the BIOS boot order. For example:

bootloader --driveorder=sda,hda

* --location= ? Specifies where the boot record is written. Valid values are the following: mbr (the default),
partition (installs the boot loader on the first sector of the partition containing the kernel), or
none (do not install the boot loader).

Still can't guarantee that a totally automated approach is possible, unless the hardware is identical, as the devices and ordering will be system-dependent. Top


andersbiro
Posts: 12
Joined: 2010/02/22 10:07:54
Re: Kickstart option to set GRUB drive location?

Post by andersbiro " 2010/03/08 08:48:17

AlanBartlett wrote:
In the CentOS wiki article that you reference, under the heading Notes , there is a [color=ff1480]cherry-red[/color] block of text. Isn't that appropriate?

If not, do you have any suggestions for improvement to the article?

To my understanding this specific part of the text refers to an interactive installation but since I deal with a fully automatic installation I do not think that part is appropriate so that is why I am looking for corresponding kickstart options to achieve the same thing.
To be fair it also mentions the line bootloader --driveorder=cciss/c0d0,sda --location=mbr" that might be appropriate but since I am not very proficient with completely comprehending the parameters. Top


andersbiro
Posts: 12
Joined: 2010/02/22 10:07:54
Re: Kickstart option to set GRUB drive location?

Post by andersbiro " 2010/03/08 08:58:16

pschaff wrote:
andersbiro wrote:
...
There seems to be a kickstart "bootloader" option but I can not really see any flags that would explicitly set the GRUB on a specified hard drive?

How about Kickstart Options : Code: Select all

bootloader (required)
Specifies how the boot loader should be installed. This option is required for both installations and upgrades.

* --append= ? Specifies kernel parameters. To specify multiple parameters, separate them with spaces. For example:

bootloader --location=mbr --append="hdd=ide-scsi ide=nodma"

* --driveorder ? Specify which drive is first in the BIOS boot order. For example:

bootloader --driveorder=sda,hda

* --location= ? Specifies where the boot record is written. Valid values are the following: mbr (the default),
partition (installs the boot loader on the first sector of the partition containing the kernel), or
none (do not install the boot loader).

I was aware of these parameters but I am not fully sure about how to apply them... the "--location" flag seemed easy enough and also driveorder but the "append" kernel parameters eludes me but perhaps this is not required.

I know that the kernel and Grub part should reside on the first partition of disk "sda" and the USB stick on "sdb" so would setting the "--driveorder=sda,sdb" insure that grub.conf points to the sda disk?

Also, would that automatically write the GRUB loader on "sda" as well or do you need to use the "partition flag" for that? Top


andersbiro
Posts: 12
Joined: 2010/02/22 10:07:54
Re: Kickstart option to set GRUB drive location?

Post by andersbiro " 2010/03/08 12:04:09

As a matter of fact I tried the --driveorder flag and that actually worked as it now can boot directly without USB stick which is a great step forward.
The only remaining obstacle is that somehow the FAT32 partition disappear from the USB stick so it cannot be used for future installations.
This can however be fixed by using FDISK to create a new FAT32 partition in the same space and somehow this also restores the previous file in the partition.

Since the GRUB bootloader seems to be written to the destination disk I must say that I cannot understand at all why the FAT32 partition disappears?
Are additional flags required to prevent this from happening? Top


pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact: Contact pschaff Website
Re: Kickstart option to set GRUB drive location?

Post by pschaff " 2010/03/08 12:51:41

andersbiro wrote:
...
Since the GRUB bootloader seems to be written to the destination disk I must say that I cannot understand at all why the FAT32 partition disappears?
Are additional flags required to prevent this from happening?

I have not seen that happen. You have both FAT32 and ext3 partitions, and the FAT32 one is gone after the install? I'd check the kickstart file carefully to be sure it is not inadvertently messing with the USB drive.

Thanks for reporting back, and please keep us posted. Any recommendations for the Wiki article appreciated. Top


andersbiro
Posts: 12
Joined: 2010/02/22 10:07:54
Re: Kickstart option to set GRUB drive location?

Post by andersbiro " 2010/03/08 14:49:12

I managed to solve the issue by adding the "ignoredisk --drives=sdb" parameter for the USB drive and now the installer leaves the USB stick intact and the installation works flawlessly.
I however still do not know why the installer affected the disk in the first place but this flag did at any rate solve the problem for me. Top
pschaff
Retired Moderator
Posts: 18276
Joined: 2006/12/13 20:15:34
Location: Tidewater, Virginia, North America
Contact: Contact pschaff Website
Re: Kickstart option to set GRUB drive location?

Post by pschaff " 2010/03/08 14:53:40

Thanks for the additional info. Still seems that a general solution is elusive, as there's no guarantee that on a different set of hardware the USB drive will show up as /dev/sdb. Top
nektoid
Posts: 1
Joined: 2012/04/03 17:00:26
Re: Kickstart option to set GRUB drive location?

Post by nektoid " 2012/04/03 17:06:27

Hi. I ran into this recently kickstarting both 5.5 and 6.2 hosts. Kickstarts worked one day and the next the bootloader wanted to be on the usb key, odd. This is was an example of what worked for me with 5.5 where the usb key was consistently seen as sdb. Both at their respective parts in the preamble section of ks.cfg.

#stop writing bootloader to usb
bootloader --driveorder=sda,sdb --location=mbr

#stop erasing my usb stick
ignoredisk --drives=sdb

[Aug 06, 2017] Unable to download the kickstart file

Aug 06, 2017 | community.hpe.com
Hi there
There is a kickstart file on http://10.10.0.3/ks.cfg it opens in the browser fine and I can read the content.
Also wget http://10.10.0.3/ks.cf works flawlessly yet the installation fails with the following error : "Unable to download the kickstart file, please modify the kickstart parameter..."
I'm using apache as a web server.
Any idea what's causing the problem ?
Do I need some special configuration of Apache ?

Jesus is the King Solved! Go to Solution. 0 Kudos Reply

12 REPLIES Michal Kapalka (mikap) Honored Contributor

‎11-15-2010 11:54 PM

‎11-15-2010 11:54 PM

Re: Unable to download the kickstart file
hi,

check this forum thread :

http://web.archiveorange.com/archive/v/YcynVy2jK7BBdYo5BvqY

mikap 0 Kudos Reply Piotr Kirklewski Super Advisor

‎11-16-2010 05:50 AM

‎11-16-2010 05:50 AM

Re: Unable to download the kickstart file
Well - I'm not using NFS here.
So it seems to me that post is irrelevant unless I don't get it. Jesus is the King 0 Kudos Reply Piotr Kirklewski Super Advisor

‎11-16-2010 06:08 AM

‎11-16-2010 06:08 AM

Re: Unable to download the kickstart file
Also I have only one NIC in my VM and I'm not specifying the ksdevice in my ks.cfg .
Should I do that ? Jesus is the King 0 Kudos Reply Matti_Kurkela Honored Contributor

‎11-17-2010 01:52 AM

‎11-17-2010 01:52 AM

Re: Unable to download the kickstart file
You did not mention the name of your Linux distribution, but Kickstart suggests RedHat or one of its derivatives.

RedHat's installer sets up a shell prompt on one of the virtual consoles, and a log or two on other virtual consoles.

You might take a look at the logged messages, and/or use the shell prompt to verify the system has a working network connection.

See paragraph 4.1.1 of this document for a description of the virtual console functionality of the installer (this part of the installer has not changed significantly since RHEL 3):

http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/3/html/Installation_Guide_x8664/ch-guimode.html

Another possibility is that the web server offers the kickstart file using a MIME content type the installer does not like. I guess "text/plain" would be acceptable, but this might not be Apache's default content type for .cfg files.

If this is the case, you might have to add the file type to your Apache configuration:

AddType text/plain .cfg

MK MK 0 Kudos Reply Jimmy Vance HPE Pro

‎11-17-2010 04:06 AM

‎11-17-2010 04:06 AM

Re: Unable to download the kickstart file
You don't mention the server model or distribution version your working with. Even though other systems can access the ks file OK, maybe the system your trying to install on does not have proper NIC drivers during boot to access the ks file?

__________________________________________________
No support by private messages. Please ask the forum! I work for HPE

If you feel this was helpful please click the KUDOS! thumb below! 0 Kudos Reply Piotr Kirklewski Super Advisor

‎11-17-2010 09:47 AM

‎11-17-2010 09:47 AM

Re: Unable to download the kickstart file
I'm trying to install Centos5.5 64-bit
The PXE server is Debian.

vim /tftpboot/pxelinux.cfg/default

### CENTOS 5.5 - CUSTOM ###
LABEL Centos 5.5 x86_64 Custom
kernel CentOS/vmlinuz noapic
append initrd=CentOS/initrd.img ks= http://10.10.0.3/ks.cfg text nofb
TEXT HELP
Customized, unatended installation version of Centos 5.5
ENDTEXT
\n

Did you mean to add this to apache config ? :

DirectoryIndex index.html index.cgi index.pl index.php index.xhtml index.htm index.cfg ks.cfg

Jesus is the King 0 Kudos Reply Jimmy Vance HPE Pro

‎11-17-2010 10:15 AM

‎11-17-2010 10:15 AM

Re: Unable to download the kickstart file

OK, so now we know your working with CentOS

Does the CentOS 5.5 initrd image your booting from contain the correct NIC drivers for the server your trying to install on? You didn't mention the server model.

__________________________________________________
No support by private messages. Please ask the forum! I work for HPE

If you feel this was helpful please click the KUDOS! thumb below! 0 Kudos Reply Piotr Kirklewski Super Advisor

‎11-17-2010 02:30 PM

‎11-17-2010 02:30 PM

Re: Unable to download the kickstart file
It's a VM on ESXi 4.1.
I'm already using the same intrd here:
Label CentOS 5 64-bit installer & rescue
kernel centos5x64/vmlinuz
append initrd=centos5x64/initrd.img text vga=791
\n

I have just copied it to a different dir and started working on the kickstart installation.
The manual installation goes without any problems so I can't see why would it be different for the kickstart.
Jesus is the King 0 Kudos Reply Jimmy Vance HPE Pro

‎11-17-2010 04:56 PM

‎11-17-2010 04:56 PM

Solution
Re: Unable to download the kickstart file
A manual installation from media doesn't matter if it is bare iron, or a VM, the network does not come into play. For bare iron, or a VM, network installation the boot installer needs to be able to access the network to pull the KS file. While your in the installer switch over to one of the other console screens F2, F4, etc and see if the network is functional

__________________________________________________
No support by private messages. Please ask the forum! I work for HPE

If you feel this was helpful please click the KUDOS! thumb below! 1 Kudo Reply Piotr Kirklewski Super Advisor

‎11-18-2010 04:52 PM

‎11-18-2010 04:52 PM

Re: Unable to download the kickstart file
Alt + F3 shows the following message:
ERROR: No network device in choose network device!
ERROR: No network drivers for dooing kickstart
ERROR: Unable to bring up network

Where do I go from there ?

Jesus is the King 0 Kudos Reply Jimmy Vance HPE Pro

‎11-18-2010 05:12 PM

‎11-18-2010 05:12 PM

Re: Unable to download the kickstart file
Hopefully someone with more VMware experience than I have will chime in. I'm not sure what driver you need to load for the virtual NIC VMware presents to the guest OS

__________________________________________________
No support by private messages. Please ask the forum! I work for HPE

If you feel this was helpful please click the KUDOS! thumb below! 0 Kudos Reply DeafFrog Valued Contributor

‎11-22-2010 12:05 AM

‎11-22-2010 12:05 AM

Re: Unable to download the kickstart file
Hi ,

pls check this :

http://www.vmware.com/support/vsphere4/doc/vsp_41_new_feat.html

section "network" > ESXi configuration guide > page 96 .

hope this helps..

Reg. FrogIsDeaf

[Aug 06, 2017] Customising Anaconda uEFI boot menu to include kickstart parameter - Red Hat Customer Portal

Aug 06, 2017 | access.redhat.com
Customising Anaconda uEFI boot menu to include kickstart parameter Latest response March 3 2017 at 6:50 AM Hi

I am producing a remastered RHEL 6.5 which contains a custom kickstart. I have got the ISO to boot using the kickstart from a BIOS boot by making the standard modifications to isolinux.cfg (i.e. "append initrd=initrd.img ks=cdrom:/ks-x86_64.cfg"). However I cannot locate the correct file(s) to perform the same customisation when I boot to UEFI. I can enter the "ks=cdrom:/ks-x86_64.cfg" parameter to the UEFI anaconda boot menu by editing the kernel parameters but I cannot find a way of customising it like you can with editing isolinux.cfg.

Does anyone know how to customise the anaconda boot parameters when using UEFI?

Many thanks Started March 21 2014 at 11:55 AM by Aidan Beeson Community Member 87 points Join the conversation Responses Guru 6863 points 21 March 2014 4:03 PM James Radtke Community Leader Hey Aidan - I don't know this for certain (and don't have time to validate right now) but hopefully to get you moving forward.

Look in /EFI/BOOT in your media. It seems to resemble what is in /isolinux

Specifically, check out BOOTX64.conf

Raw
#debug --graphics
default=0
splashimage=/EFI/BOOT/splash.xpm.gz
timeout 5
hiddenmenu
title Red Hat Enterprise Linux 6.4
    kernel /images/pxeboot/vmlinuz
    initrd /images/pxeboot/initrd.img
title Install system with basic video driver
    kernel /images/pxeboot/vmlinuz xdriver=vesa nomodeset askmethod
    initrd /images/pxeboot/initrd.img
title rescue
    kernel /images/pxeboot/vmlinuz rescue askmethod
    initrd /images/pxeboot/initrd.img

I'll revisit this later if I have something to update/change. But, hopefully this is correct and helpful. ;-)

Community Member 87 points 21 March 2014 4:26 PM Aidan Beeson Hi James,

That does look promising. Bit of a "d'oh" moment as it was kinda obvious really! When I get a chance to get onto the UEFI hardware again I'll have a play and update this thread...

Thanks!

Community Member 87 points 25 March 2014 10:07 AM Aidan Beeson James,

You're correct, the configuration is located in the /EFI/BOOT/BOOTX64.conf.
Unlike the non-efi Anaconda boot it uses a standard grub menu rather than the (slightly) fancier one. To get it to boot anaconda using the kickstart file I've used the following:

Raw
#debug --graphics
default=0
splashimage=/EFI/BOOT/splash.xpm.gz
timeout 60
# hiddenmenu
title Install RHEL with kickstart
    kernel /images/pxeboot/vmlinuz ks=cdrom:/ks-x86_64.cfg
    initrd /images/pxeboot/initrd.img
title Install Standard Red Hat Enterprise Linux OS
    kernel /images/pxeboot/vmlinuz
    initrd /images/pxeboot/initrd.img
title Install system with basic video driver
    kernel /images/pxeboot/vmlinuz xdriver=vesa nomodeset askmethod
    initrd /images/pxeboot/initrd.img
title rescue
    kernel /images/pxeboot/vmlinuz rescue askmethod
    initrd /images/pxeboot/initrd.img

Many thanks

:)

Guru 6863 points 25 March 2014 2:27 PM James Radtke Community Leader Good to hear it. I'm glad we were on the right page. I believe this (uEFI) will start to become more of a hot topic as time goes on. (I know I have a lot to learn yet ;-) Community Member 30 points 9 March 2015 5:33 PM Jun Li Yes, uefi is becoming more popular now, uefi is standard now for HP G9 servers, while IBM/Lenovo x series made uefi standard couple years ago.

Satellite 6 is falling behind, so far, it doesn't support pxe uefi kickstart, reasons are:
1. tftp server doesn't have uefi boot image, only has bios boot image;
2. dhcp server config doesn't have have definition for uefi based pxe request. This actually isn't a satellite/foreman issue, because foreman is missing the function of update dhcpd.conf when a subnet defined.
3. A uefi compatible pxe config file is missing when a new host defined in foreman/satellite.
the one that defined in /var/lib/tftpboot/pxelinux.cfg only works for bios based pxe.

Based on the 3 issues, I got pxe uefi kickstart working this morning, by addressing the above 3 accordingly:

  1. Manually add uefi boot image to ttftp server:

[root@capsule tftpboot]# pwd
/var/lib/tftpboot
[root@capsule tftpboot]# cd efi/
[root@capsule efi]# ls
bootx64.efi efidefault images splash.xpm.gz TRANS.TBL
[root@capsule efi]#
[root@capsule efi]# pwd
/var/lib/tftpboot/efi
[root@capsule efi]# ls
bootx64.efi efidefault images splash.xpm.gz TRANS.TBL
[root@capsule efi]# ls -l images/pxeboot/
total 36644
-r--r--r-- 1 root root 33383449 Mar 6 12:27 initrd.img
-r--r--r-- 1 root root 441 Mar 6 12:27 TRANS.TBL
-r-xr-xr-x 1 root root 4128944 Mar 6 12:27 vmlinuz
[root@capsule efi]#
[root@capsule efi]# cat efidefault

debug --graphics

default=0
splashimage=(nd)/splash.xpm.gz
timeout 5
hiddenmenu
title Red Hat Enterprise Linux 6.5
root (nd)
kernel /images/pxeboot/vmlinuz ks=http://satellite6.example.com:80/unattended/provision?token=fc25b9df-8c28-41cf-af5d-fa42b6401c29 ksdevice=bootif network kssendmac
initrd=/images/pxeboot/initrd.img
IPAPPEND 2
title Install system with basic video driver
kernel /images/pxeboot/vmlinuz xdriver=vesa nomodeset askmethod
initrd /images/pxeboot/initrd.img
title rescue
kernel /images/pxeboot/vmlinuz rescue askmethod
initrd /images/pxeboot/initrd.img
[root@capsule efi]#

  1. Add one section to serve uefi based pxe request, so the cliet will get bootx64.efi boot image instead of pxelinux.0

class "pxeclients" {
match if substring (option vendor-class-identifier, 0, 9) = "PXEClient";
next-server 10.1.1.1;

Raw
              if option arch = 00:06 {
                      filename "efi/bootia32.efi";
              } else if option arch = 00:07 {
                      filename "efi/bootx64.efi";
              } else {
                      filename "pxelinux.0";
              }

}

  1. every time when a new host defined in satellite 6/foreman, you will get a unattended provision url, copy this url, replace the ks url in /var/lib/tftpboot/efi/efidefault,

Now you should be able to kickstart a uefi system via pxe in a satellite 6/capsule environment.

Community Member 95 points 6 March 2015 12:02 AM David Worth Hi,

I am trying to create a custom iso for kickstart builds on servers with UEFI. From looking at the post, it looks like you were able to create a boot iso for EFI. If that is the case, what were the steps that you followed to create it? I am struggling to find good detailed info.

Thanks,
David

Community Member 39 points 9 March 2015 3:35 PM Aidan Beeson Hi David,

There are probably better/different ways of doing this but this is how I got it to work:

  1. Loop mount the install iso.
  2. Create local disk copies of "isolinx", "EFI" and "images" directories.
  3. Modify files in isolinux & EFI directories as required (e.g. isolinux.cfg and EFI/BOOT/BOOTX64.conf)
  4. Create the new ISO:
Raw
 mkisofs -o my.iso \
        -R -J -A "MyProject" \
  -hide-rr-moved \
  -v -d -N \
  -no-emul-boot -boot-load-size 4 -boot-info-table \
  -b isolinux/isolinux.bin \
  -c isolinux/isolinux.boot \
  -eltorito-alt-boot -no-emul-boot  \
  -eltorito-boot images/efiboot.img \
  -x ${mountDIR}/isolinux \
  -x ${mountDIR}/images \
  -x ${mountDIR}/EFI \
  -x .svn \
  -graft-points /path/to/loopmount/install_dvd my_kickstart.cfg=my_kickstart.cfg isolinux/=isolinux images=images EFI=EFI

The isolinux.cfg and BOOTx64.conf should contain a reference to the ks file, for example:

(isolinux.cfg)

Raw
label linux
  menu label ^Install OS using kickstart
  menu default
  kernel vmlinuz
  append initrd=initrd.img ks=cdrom:/my_kickstart.cfg
label vesa
  menu label Install ^standard Red Hat Enterprise Linux OS
  kernel vmlinuz
  append initrd=initrd.img 
label rescue
  menu label ^Rescue installed system
  kernel vmlinuz
  append initrd=initrd.img rescue
label local
  menu label Boot from ^local drive
  localboot 0xffff
label memtest86
  menu label ^Memory test
  kernel memtest
  append -

(BOOTx64.conf)

Raw
  title Install OS using kickstart
        kernel /images/pxeboot/vmlinuz ks=cdrom:/my_kickstart.cfg
        initrd /images/pxeboot/initrd.img
title Install standard Red Hat Enterprise Linux OS
        kernel /images/pxeboot/vmlinuz
        initrd /images/pxeboot/initrd.img
title Install system with basic video driver
        kernel /images/pxeboot/vmlinuz xdriver=vesa nomodeset askmethod
        initrd /images/pxeboot/initrd.img
title rescue
        kernel /images/pxeboot/vmlinuz rescue askmethod
        initrd /images/pxeboot/initrd.img

Hope this helps. I've tested it using a VMware EFI emulation but not in anger on any "real" EFI systems.

Aidan

Community Member 95 points 11 March 2015 8:23 PM David Worth Thanks for the info. We are building new servers on HP gen8 and 9 servers. The Gen9's are defaulting to UEFI. For this go around I reverted back to legacy, but we will have more builds to come. So it would be nice to figure a way to boot and install using UEFI. I am guessing that is the direction hardware vendors are going. Also interesting that it was not too easy to find a lot of good info. Just pieces here and there.

I will give this a try on the next hardware build using EFI.

Thanks again!

Community Member 95 points 22 March 2015 12:44 AM David Worth Hi Aidan

Thanks again for the info. I was troubleshooting why boot from SAN was not working with a HP bl460Gen9 blade. I was trying legacy mode, but would not boot after install from kickstart. Waiting For HP on this issue.

However, I created a dual boot ISO, legacy and EFI. I was able to set the bios to EFI and image the server from kickstart. I just added the following to EFI/BOOT/BOOTX64.conf:

debug --graphics

default=0
splashimage=/EFI/BOOT/splash.xpm.gz
timeout 360
title RHEL 6.6 l00l
kernel /images/pxeboot/vmlinuz ks=nfs:nfsserver:/ifs/data/kickstart/KSConfigs/l001/l001-ks.cfg initrd=rhe6664.img ksdevice=eth0 ip= gateway= netmask=255.255.255.0 dns=
initrd /images/pxeboot/initrd.img
title RHEL 6.6 l002
kernel /images/pxeboot/vmlinuz ks=nfs:nfsserver:/ifs/data/kickstart/KSConfigs/l002/l002-ks.cfg initrd=rhe6664.img ksdevice=eth0 ip= gateway= netmask=255.255.255.0 dns=
initrd /images/pxeboot/initrd.img
title Red Hat Enterprise Linux 6.6
kernel /images/pxeboot/vmlinuz
initrd /images/pxeboot/initrd.img
title Install system with basic video driver
kernel /images/pxeboot/vmlinuz xdriver=vesa nomodeset askmethod
initrd /images/pxeboot/initrd.img
title rescue
kernel /images/pxeboot/vmlinuz rescue askmethod
initrd /images/pxeboot/initrd.img

There was only one instance where the ISO booted up and was went to a grub menu. Not sure why, but rebooted and everything was good. So your steps also work with physical as well.

Regards,
David

Community Member 35 points 18 June 2015 5:38 PM Jose Carlos Alves Hi David,

What you have in your file isolinux/isolinux.cfg?

Regards,
Sara

Community Member 95 points 18 June 2015 10:24 PM David Worth Hi Sarah,

To setup a dual legacy and EFI boot iso, I mount the latest RHEL 6.x dvd and copy the following directories to a work area on my server.

EFI/ images/ isolinux

If you are just setting up legacy boot, you can ignore the EFI and images directories.

Here is an example of what I am putting in the isolinux.cfg

------start of file --------
default vesamenu.c32

prompt 1

timeout 600

display boot.msg

menu background splash.jpg
menu title Welcome to Red Hat Enterprise Linux 6.6!
menu color border 0 #ffffffff #00000000
menu color sel 7 #ffffffff #ff000000
menu color title 0 #ffffffff #00000000
menu color tabmsg 0 #ffffffff #00000000
menu color unsel 0 #ffffffff #00000000
menu color hotsel 0 #ff000000 #ffffffff
menu color hotkey 7 #ffffffff #ff000000
menu color scrollbar 0 #ffffffff #00000000

label linux
menu label ^Install or upgrade an existing system
menu default
kernel vmlinuz
append initrd=initrd.img
label vesa
menu label Install system with ^basic video driver
kernel vmlinuz
append initrd=initrd.img xdriver=vesa nomodeset
label rescue
menu label ^Rescue installed system
kernel vmlinuz
append initrd=initrd.img rescue
label local
menu label Boot from ^local drive
localboot 0xffff
label servera-set-Network
kernel vmlinuz
append ks=nfs:nfsserver.example.com:/kickstart/location/servera-ks.cfg initrd=initrd.img ksdevice=eth0 ip=192.168.1.5 gateway=192.168.1.1 netmask=255.255.255.0 dns=1192.168.1.2
label serverb-dhcp
kernel vmlinuz
append ks=nfs:nfsserver.example.com:/kickstart/location/serverb-ks.cfg initrd=initrd.img ksdevice=eth0

------end of file --------

Then you have to run mkisofs to create the iso.

Hope that helps.

Regards,
David

Community Member 35 points 19 June 2015 8:15 AM Jose Carlos Alves Hi David,

My problema is because I have a HP Gen9 with UEFI and not EFI

I have
images
isolinux

In the isolinux.cfg, I have this

default=0
splashimage=/EFI/BOOT/splash.xpm.gz

prompt 1

timeout 5
hiddenmenu

label ptmtshdpnopp01
kernel vmlinuz
append initrd=initrd.img ksdevice=eth0 ip=10.126.77.11 netmask=255.255.255.224 gateway=10.126.77.1 dns=10.126.26.47 ks=nfs:10.126.58.136:/apps/redhat/ks-rhel-server-6.6-x86_64_hdp.cfg

label ptmtshdpnopp02
kernel vmlinuz

append initrd=initrd.img ksdevice=eth0 ip=10.126.77.12 netmask=255.255.255.224 gateway=10.126.77.1 dns=10.126.26.47 ks=nfs:10.126.58.136:/apps/redhat/ks-rhel-server-6.6-x86_64_hdp.cfg

I create th iso with

mkisofs -N -J -joliet-long -D -V "HADOOP" -o rhel-server-6.6-x86_64-hadoop.iso -b "isolinux/isolinux.bin" -c "isolinux/boot.cat" -hide "isolinux/boot.cat" -no-emul-boot -boot-load-size 4 -boot-info-table isolinux-6.6-x86_64/

But the machine doesn't see the iso

Thanks for the help
Regards,
Sara

Community Member 95 points 19 June 2015 1:18 PM David Worth Hi Sara,

I ran into the same thing earlier this year. We started using Gen9's. We had issues with boot from San and switching them to legacy mode, so we went with EFI, aka UEFI. EFI or UEFI boot is a different method of managing booting the OS. It was developed by HP in the Itanium servers. But you can search for the features and differences with legacy boot.

The way I went after booting with an ISO for kickstart installs is to create a dual boot ISO, legacy and EFI boot. Anything that will boot from legacy mode will read the isolinux.cfg and EFI mode will read the Bootx64.conf.

To create a dual ISO, create directory and copy EFI/ images/ isolinux/ directories from an install DVD. Next all you legacy boot entries will go into the isolinux/isolinux.cfg. You can see the example I have above. For EFI, you will have to edit the EFI/BOOT/BOOTx64.conf. Here is an example of what I put into mine.

-----start------

debug --graphics

default=0
splashimage=/EFI/BOOT/splash.xpm.gz
timeout 900
title Red Hat Enterprise Linux 6.6
kernel /images/pxeboot/vmlinuz
initrd /images/pxeboot/initrd.img
title rescue
kernel /images/pxeboot/vmlinuz rescue askmethod
initrd /images/pxeboot/initrd.img
title server-d
kernel /images/pxeboot/vmlinuz ks=nfs:nfsserver.example.net/kickstart/KSConfigs/server-d-ks.cfg ksdevice=eth0 ip=192.168.5.6 gateway=192.168.5.1 netmask=255.255.255.0 dns=192.168.2.2
initrd /images/pxeboot/initrd.img
title server-e
kernel /images/pxeboot/vmlinuz ks=nfs:nfsserver.example.net/kickstart/KSConfigs/server-e-ks.cfg ksdevice=eth0
initrd /images/pxeboot/initrd.img

------End------
In the example above, I put in an example of setting an IP as well as using DHCP. After you edit your legacy or EFI configs, then you have to create the ISO. Here is what I run to create a dual ISO:

  1. cd into the directory that contains the 3 directories I mentioned earlier.
  2. run > mkisofs -o ../my-iso-name.iso -R -J -A "MyDualISO" -hide-rr-moved -v -d -N -no-emul-boot -boot-load-size 4 -boot-info-table -b isolinux/isolinux.bin -c isolinux/isolinux.boot -eltorito-alt-boot -no-emul-boot -eltorito-boot images/efiboot.img -x ${mountDIR}/isolinux -x ${mountDIR}/images -x ${mountDIR}/EFI .

Also, after this is done, your kickstart will need to be able to work with EFI boots. First, the partition table will need to be gpt. Next, the bootloader location needs to be partition. Last, you will need a partition /boot/efi with fstype as efi and size 200.

If you need help with that, I can send you my disk layout from my kickstart config. Just let me know.

Regards,
David

Community Member 97 points 5 August 2015 7:26 PM Ivan Borghetti Hello David, how are you. I am also trying to create an iso that supports dual boot , i am now testing the UEFI boot and it works however i still need to customize the menu to list my different kickstarts, etc.

After copying the directories i needed i created the iso running mkisofs however i did not have the following lines in my command:

-x ${mountDIR}/isolinux -x ${mountDIR}/images -x ${mountDIR}/EFI .

Would you mind explaining me why those are needed and which would be the $(mountDIR) , i guess is the parent directory where those 3 subdirectories are, right? in my case would be iso

iso_cfg/
├── EFI
│ └── BOOT
├── images
│ └── pxeboot
└── isolinux

thanks in advance

Community Member 95 points 8 August 2015 10:27 AM David Worth Hi Ivan,

I am almost sure you do not need them. The -x is similar to the -m, which if you look in the man page, it allows you to exclude files. I was basing my mkisofs command off the one in this thread above. I thought I removed it from the one I use, but I still have it in.

Try removing it and see what happens. Can you let me know the outcome? Just curious.

Community Member 97 points 10 August 2015 12:12 PM Ivan Borghetti Hello David, thanks for your response, I tried without those parameters and it worked without issues,

thanks again

Community Member 95 points 10 August 2015 1:06 PM David Worth Great. Thanks for letting me know. I will take it out of my build script as well. Community Member 35 points 19 June 2015 2:37 PM Jose Carlos Alves Hi David,

Yes please, let me know what you have in your kickstart config about the disk layout.

Thanks,
Sara

Community Member 95 points 19 June 2015 3:05 PM David Worth Hi Sara,

I am setting up my disk partitioning in a pre section, then writing the disk to a file that gets included. The script will check for all drives and then only select a disk that is greater than 130000MB, roughly 126GB. This is to deal with the ISO, USB, or cdrom that you are using to image the server. It will ignore that and select my disk which is 134GB.

--------start---------

Disk Configuration

%include /tmp/partitioning

End Disk Configuration

%pre --log /root/ks-rhn-pre.log

Find OS disk

tdsk=""
list-harddrives | while read DISK DSIZE
do
#Convert float into int
DSIZEI=${DSIZE%.*}
# get scsi ID for disk
scsi_id="$(/mnt/runtime/lib/udev/scsi_id -gud /dev/${DISK})"
echo "F-$DSIZE I-$DSIZEI-- ID $scsi_id"

Raw
# determine if we should partition this device
###  if disk is smaller than 130000, than change the size in mb to reflect it.
if [ ${DSIZEI} -gt 130000 ]; then
     # add device to ignoredisk --only-use list
     ##the following is for SAN disks##
     tdsk="/dev/disk/by-id/scsi-${scsi_id}"
     ##End SAN Disk###

    ##if using local disks, comment the tdsk above and use this###
    ##tdsk="/dev/$DISK"
    ###End Local disk###

    echo "DISK - $tdsk"
Create GPT partition

echo "creating gpt on ${tdsk}"
parted -s ${tdsk} mklabel gpt

cat << EOF >> /tmp/partitioning
bootloader --location=partition --driveorder=${tdsk}
ignoredisk --only-use=${tdsk}
zerombr
clearpart --linux --drives=${tdsk}

part /boot/efi --fstype=efi --size=200 --ondisk=${tdsk}
part /boot --fstype ext4 --size=512 --ondisk=${tdsk}
part pv.4 --size=100 --grow --ondisk=${tdsk}
volgroup vg00 --pesize=32768 pv.4

logvol / --fstype ext4 --name=lvroot --vgname=vg00 --size=10240
logvol /opt --fstype ext4 --name=lvopt --vgname=vg00 --size=2048
logvol /home --fstype ext4 --name=lvhome --vgname=vg00 --size=2048
logvol /tmp --fstype ext4 --name=lvtmp --vgname=vg00 --size=6144
logvol /var --fstype ext4 --name=lvvar --vgname=vg00 --size=5120
logvol /usr/local --fstype ext4 --name=lvulocal --vgname=vg00 --size=4096
logvol swap --fstype swap --name=lvswap1 --vgname=vg00 --size=16384
logvol swap --fstype swap --name=lvswap2 --vgname=vg00 --size=16384
EOF
exit
fi
done

%end

--------end---------

Also note, I am booting from SAN so this line will work for SAN disks. > tdsk="/dev/disk/by-id/scsi-${scsi_id}"

If you are using local disks or VMware, use this > tdsk="/dev/$DISK"

I added comments to the pre script so you can see where to make changes. Hope that helps.

Regards,
David

Community Member 95 points 19 June 2015 3:18 PM David Worth It seems the formatting of the code is off. Let me try again. Raw
##Disk Configuration##
%include /tmp/partitioning

##End Disk Configuration##

%pre --log /root/ks-rhn-pre.log
##Find OS disk

 tdsk=""
 list-harddrives | while read DISK DSIZE
 do
    #Convert float into int
    DSIZEI=${DSIZE%.*}
    # get scsi ID for disk
    scsi_id="$(/mnt/runtime/lib/udev/scsi_id -gud /dev/${DISK})"
        echo "F-$DSIZE I-$DSIZEI-- ID $scsi_id"

    # determine if we should partition this device
###  if disk is smaller than 130000, than change the size in mb to reflect it.
    if [ ${DSIZEI} -gt 130000 ]; then
         # add device to ignoredisk --only-use list
##the following is for SAN disks##
         tdsk="/dev/disk/by-id/scsi-${scsi_id}"
##End SAN Disk###

    ##if using local disks, comment the tdsk above and use this###
    ##tdsk="/dev/$DISK"
    ###End Local disk###

        echo "DISK - $tdsk"

##Create GPT partition
echo "creating gpt on ${tdsk}"
parted -s ${tdsk} mklabel gpt

cat << EOF >> /tmp/partitioning
bootloader --location=partition --driveorder=${tdsk}
ignoredisk --only-use=${tdsk}
zerombr
clearpart --linux --drives=${tdsk}

part /boot/efi --fstype=efi --size=200 --ondisk=${tdsk}
part /boot --fstype ext4 --size=512 --ondisk=${tdsk}
part pv.4 --size=100 --grow --ondisk=${tdsk}
volgroup vg00 --pesize=32768 pv.4

logvol / --fstype ext4 --name=lvroot --vgname=vg00 --size=10240
logvol /opt --fstype ext4 --name=lvopt --vgname=vg00 --size=2048
logvol /home --fstype ext4 --name=lvhome --vgname=vg00 --size=2048
logvol /tmp --fstype ext4 --name=lvtmp --vgname=vg00 --size=6144
logvol /var --fstype ext4 --name=lvvar --vgname=vg00 --size=5120
logvol /usr/local --fstype ext4 --name=lvulocal --vgname=vg00 --size=4096
logvol swap --fstype swap --name=lvswap1 --vgname=vg00 --size=16384
logvol swap --fstype swap --name=lvswap2 --vgname=vg00 --size=16384
EOF
        exit
     fi
 done

%end

Community Member 35 points 29 June 2015 8:52 AM Jose Carlos Alves Thanks David,

I already installed my machines with your help.

Best regards,
Sara Soares

Community Member 32 points 1 October 2015 6:45 PM Gustavo Vegas Hello everyone,
I have a similar requirement, in our case we use ISO images to kickstart our servers. With pieces of information from this thread as well as some other resources out there, I have been able to get the RHEL6 side working. Now, I am also trying to do this for RHEL7, and things seem to have changed. The BOOTX64.conf seems to be getting ignored and GRUB2/grub.conf seems to be the one been taken into account. Any insights on how to work this out on RHEL7? Any help would be appreciated.

Thanks.

Red Hat Active Contributor 190 points 2 October 2015 1:07 PM Petr Bokoc Hello,

For RHEL7 on UEFI systems, the file you want to modify on the boot media is BOOT/EFI/grub.cfg . You can append the inst.ks= parameter to the line starting with linuxefi in any of the entries. The second entry is selected by default; you can use the set_default= option at the beginning of the file to change that (entries are numbered from 0).

After you change grub.cfg to your preferences, you can follow the instructions in the Anaconda Customization Guide to create a new bootable ISO image with the modified boot menu.

Newbie 11 points 3 March 2017 11:48 AM systeembeheer beeldengeluid Hello, just a update to help a few people along te way on Rhel 7.3 the dual(UEFI/Bios) boot iso, it can be build with a few steps.

Use following steps : Copy the content from a iso boot image say "rhel-server-7.3-x86_64-boot.iso" to your own image directory. Where you modify your dualboot image. Modify the EFI/Boot/grub.cfg for your UEFI boot needs. Modify the isolinux/isolinux.xfg for your BIOS based Boot needs.

Now the right mkisofs command( this one did it for me) Start this in the root of your own image directory mkisofs -U -A "RHEL-7.3 x86_64" -V "RHEL-7.3 x86_64" -volset "RHEL-7.3 x86_64" -J -joliet-long -r -v -T -x ./lost+found \ -o ../Kickstart_lab_7.3-disc1-dualboot.iso -b isolinux/isolinux.bin -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 \ -boot-info-table -eltorito-alt-boot -e images/efiboot.img -no-emul-boot .

The volume name ( "RHEL-7.3 x86_64") may come back to bite you ( haven't tried to change it) This label important in the Uefi part of your dual boot and comes back in the EFI/BOOT/grub.cfg. In two places, first in the search line and second after inst.stage2 parameter in the menu entry.

------------------- snippet grub.cfg------

search --no-floppy --set=root -l 'RHEL-7.3 x86_64'

--### BEGIN /etc/grub.d/10_linux ###-- menuentry 'Install Red Hat Enterprise Linux 7.3' --class fedora --class gnu-linux --class gnu --class os { linuxefi /images/pxeboot/vmlinuz inst.stage2=hd:LABEL=RHEL-7.3\x20x86_64 quiet initrdefi /images/pxeboot/initrd.img

}

After the inst.stage2 you can place your inst.ks parameters you need.

The isolinux/isolinux.cfg has your bios based boot parameter

Have fun.. and good luck

[Aug 06, 2017] Nathan Mike - Senior System Engineer - LPI1-C and CLA-11

Notable quotes:
"... mkdir -p bootdisk/RHEL ..."
"... example: cp -R /mnt/isolinux/* ~/bootdisk/RHEL/ ..."
"... cd ~/bootdisk/RHEL/ ..."
"... example: cp ks.cfg ~/bootdisk/RHEL/ ..."
"... mkisofs -r -T -J -V "RedHat KSBoot" -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -v -o linuxboot.iso . ..."
"... linux ks=cdrom:/ks.cfg ..."
"... linux ks=cdrom:/ks.cfg append ip=<IPaddress> netmask=<netmask> ksdevice=<NICx> ..."
"... example: linux ks=cdrom:/ks.cfg append ip=10.10.10.10 netmask=255.255.255.0 ksdevice=eth0 ..."
Aug 06, 2017 | mikent.wordpress.com
How to create a kickstart ISO boot disk for RedHat Posted by mikent on April 12, 2012 14 Votes


1) logon as root

2) create a directory name bootdisk/RHEL

mkdir -p bootdisk/RHEL

3) copy the directory isolinux from your RedHat DVD or other location containing RedHat binaries in bootdisk/RHEL

example: cp -R /mnt/isolinux/* ~/bootdisk/RHEL/

4) change direcotry to ~/bootdisk/RHEL/

cd ~/bootdisk/RHEL/

5) create (or copy) your ks.cfg (it will be discussed later in another post how to create a kickstart file) in ~/bootdisk/RHEL/

example: cp ks.cfg ~/bootdisk/RHEL/

6) Now, you can create the ISO boot disk as follow (make sure you run the command from ~/bootdisk/RHEL/) :

mkisofs -r -T -J -V "RedHat KSBoot" -b isolinux.bin -c boot.cat -no-emul-boot -boot-load-size 4 -boot-info-table -v -o linuxboot.iso .

7) Burn your iso linuxboot.iso into a blank cd-rom or mount it as it is on a Virtual Machine for example

8) At linux boot prompt, type the following command:

linux ks=cdrom:/ks.cfg

if you need to install using a specific IP address using a specific Ks boot device, type the following:

linux ks=cdrom:/ks.cfg append ip=<IPaddress> netmask=<netmask> ksdevice=<NICx>

example: linux ks=cdrom:/ks.cfg append ip=10.10.10.10 netmask=255.255.255.0 ksdevice=eth0

9) your are done!

[Aug 06, 2017] How can I troubleshoot a failing Linux kickstart installation

Aug 06, 2017 | serverfault.com
down vote favorite I am having some trouble getting my pxebooting kickstart process working.

The script is known to work when installed via a DVD with the local media on the disk. I have updated the script to work with a remote repository and am leveraging PXEBooting so this can be leveraged for my enterprise. The script executes fine up until it starts to download packages.

Checking the log files on the web server hosting the repository, the first file is downloaded successfully with a 200 HTTP code. But the server running the kickstart indicates a failure and attempts to download the package again. I have confirmed this on the web server, as I see multiple requests for the same package repeated, all with the 200 HTTP code. But kickstart indicates that the download failed.

I am using CentOS 5. I copied the entire first DVD (I do not need the OpenOffice suite from the second) to the location on the web server, so the repodata already exists.

I have been able successfully download software from this repository using other systems that have already been built.

No errors appear in any of the log files that I have found on the kickstarted server, no messages are output to the screen. I have not been able to find any means of debugging this issue.

I am hoping that someone here can provide a link or information on how to attain more detailed debugging information to resolve this.

Thank you in advance. linux centos installation kickstart

share improve this question edited Apr 21 '15 at 14:34 ewwhite 162k 64 332 643 asked May 22 '12 at 13:48 Nick V 105
1
Try hitting ALT+F2 and ALT+F3 on the server you are kickstarting to see if it has any additional information that might help. – becomingwisest May 22 '12 at 14:03
If you download the package from that URL, do you get a valid package? – larsks May 22 '12 at 14:22
I have tried ALT+F2 and ALT+F3. F2 brings me to the BusyBox prompt, but no error messages. I have looked through the entire filesystem and nothing. The install logs under /mnt/sysimage/root/ do not even contain information. – Nick V May 22 '12 at 14:31
I am able to download a package from the repository without error. The issue only exists when I attempt to use the repository for installation. I even attempted to run a manual installation from the repository. The image/stage2.img file is loaded, but when it comes time to download packages the behavior is the same. At this point, I have loopback-mounted the first DVD but the same issue exists. (using CentOS 5.8) – Nick V May 22 '12 at 14:32
add a comment |
1 Answer active oldest votes
up vote down vote accepted Can you post an excerpt of your kickstart? What is the relationship between the repository and the system you're building? Same subnet?

I had a period of kickstart installation problems during the middle of the CentOS 5 series. The best thing to do from your standpoint is to check the other virtual terminals during the installation. Are you running the installation in graphical (X Windows) or text mode?

Here's what the different virtual terminals display. You should be able to debug from there.

Alt-F1
The installation dialog when using text or cmdline

Alt-F2
A shell prompt

Alt-F3
The install log displaying messages from install program

Alt-F4
The system log displaying messages from kernel, etc.

Alt-F5
All other messages

Alt-F7
The installation dialog when using the graphical installer

At some point, I was unable to resolve a kickstart performance issue. I ended up changing the installation method to NFS and the issues disappeared. See: CentOS 5.5 remote kickstart installation stalls at "Starting install process." How to debug?

share improve this answer edited Apr 13 at 12:14 Community ♦ 1 answered May 22 '12 at 14:42 ewwhite 162k 64 332 643
For the same mystical reason, the NFS change resolved the issue. – Nick V Aug 6 '12 at 4:33

[Aug 06, 2017] TipsAndTricks-KickStart - CentOS Wiki

Aug 06, 2017 | wiki.centos.org
Tips and tricks for anaconda and kickstart

For full documentations, please see https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/5/html/Installation_Guide/ch-kickstart2.html (CentOS 5), https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/6/html/Installation_Guide/ch-kickstart2.html (CentOS 6) or https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Installation_Guide/chap-kickstart-installations.html (CentOS 7)

Tuning the %packages section

When using %packages to define the set of packages that should be installed there are a number of more or less documented options that can be set:

--resolvedeps
Dependencies between packages will be automatically resolved. This option has been deprecated in Centos 5, dependencies are resolved automatically every time now.
--excludedocs

Skips the installation of files that are marked as documentation (all files that are listed when you do rpm -qld <packagename>)

--nobase
Skips installation of @Base. This won't work unless you know what you're doing as it might leave out packages required by post installation scripts
--ignoremissing
Ignore missing packages and groups instead of asking what to do. This option has been deprecated in Centos 5, dependencies are resolved automatically every time now.

Example of minimal package selection for CentOS 4:

%packages --resolvedeps --excludedocs --nobase
kudzu

please note that essential stuff will be missing. There will be no rpm, no yum, no vim, no dhcp-client and no keyboard layouts. Kudzu is required, because the installer fails if it is missing.

Example of minimal package selection for CentOS 5:

%packages --excludedocs --nobase
@Core

Again, this will leave you with a *very* basic system that will be missing almost every feature you might expect.

The --resolvedeps used with CentOS 4 is not required for CentOS 5 and newer releases as the newer installer always resolves dependencies.

Partitioning

If you start out with a unpartitioned disk, or a virtual machine on a unpartitioned image, use the --initlabel parameter to clearpart to make sure that the disklabel is initialized, or Anaconda will ask you to confirm creation of a disklabel interactively. For instance, to clean all partitions on xvda , and initialize the disklabel if it does not exist yet, you could use:

clearpart --all --initlabel --drives=xvda
Running anaconda in real text-mode

You probably already know that you can make anaconda run with a ncurses interface instead of the X11 interface by adding the line "text" to your kickstart file. But there's another option: install in real shell-like textmode. Replace the "text"-line with a "cmdline"-line in your kickstart file and anaconda will do the whole installation in textmode. Especially when you use %packages --nobase or run complex %post scripts this will probably save hours of debugging, because you can actually see the output of all scripts that run during the installation.

Enable/disable firstboot

You all know firstboot, the druid that helps you to set up the system after install. It can be enabled and disabled by adding either "firstboot --enable" or "firstboot --disable" to the command section of your kickstart file.

What the different terminals display
Alt-F1
The installation dialog when using text or cmdline
Alt-F2
A shell prompt
Alt-F3
The install log displaying messages from install program
Alt-F4
The system log displaying messages from kernel, etc.
Alt-F5
All other messages
Alt-F7
The installation dialog when using the graphical installer
Logging %pre and %post

When using a %pre or %post script you can simply log the output to a file by using --log=/path/to/file

%post --log=/root/my-post-log
echo 'Hello, World!'

Another way of logging and displaying the results on the screen would be the following:

%post
exec < /dev/tty3 > /dev/tty3
chvt 3
echo
echo "################################"
echo "# Running Post Configuration   #"
echo "################################"
(
echo 'Hello, World!'
) 2>&1 | /usr/bin/tee /var/log/post_install.log
chvt 1
Trusted interfaces for firewall configuration

You can use the --trust option to the firewall option multiple times to trust multiple interfaces:

# Enable firewall, open port for ssh and make eth1 and eth2 trusted
firewall --enable --ssh --trust=eth1 --trust=eth2
Use a specific network interface for kickstart

When your system has more than one network interface anaconda asks you which one you'd like to use for the kickstart process. This decision can be made at boot time by adding the ksdevice paramter and setting it accordingly. To run kickstart via eth0 simply add ksdevice=eth0 to the kernel command line.

A second method is using ksdevice=link . In this case anaconda will use the first interface it finds that has a active link.

A third method works if you are doing PXE based installations. Then you add IPAPPEND 2 to the PXE configuration file and use ksdevice=bootif . In this case anaconda will use the interface that did the PXE boot (this does not necessarily needs to be the first one with a active link).

Within the kickstart config itself you need to define the network interfaces using the network statement. If you are using method 2 or 3 then you don't know which device actually will be used. If you don't specify a device for the network statement anaconda will configure the device used for the kickstart process and set it up according to your network statement.

Forcing kickstart to ask for network configuration

Starting at CentOS 5, there a undocumented option that enable a prompt asking for network configuration during the installation. At the network statement, put the query keyword at the --bootproto= networking configuration, as we see below:

network --device=eth0 --bootproto=query

And a dialog box will appear asking for IP addressing, as well the hostname configuration.

Useful collection of ready-made kickstart files

At https://github.com/CentOS/Community-Kickstarts you can find a collection of ready-made kickstart files. Their primary goal is to provide functional sample kickstarts and snippets for the various types of deployments used in the community.

[Aug 06, 2017] Unable to get kickstart file from http webserver

Aug 06, 2017 | superuser.com
up vote down vote favorite I'm trying to get a vm up using a kickstart file. However, whenever the virtual machine initalize, it says it is unable to located the kickstart file from the location provided.

Code to build vm:

virt-install --name guest --ram 2048 --disk /vm/guest.img --location /CentOS-6.6-x86_64-bin-DVD1.iso -x "ks=http://192.168.1.72/engineer.cfg ksdevice=eth0 ip=192.168.0.1 netmask=255.255.255.0 dns=8.8.8.8 gateway=192.168.1.254"

kickstarter file:

#platform=x86, AMD64, or Intel EM64T
#version=DEVEL
# Firewall configuration
firewall --disabled
# Install OS instead of upgrade
install
# Use network installation
url --url="http://192.168.1.72/"
# Root password
rootpw --iscrypted $1$AcXRM2i4$9Wzd1rjvrLNREmeIsM9.W1
# System authorization information
auth  --useshadow  --passalgo=sha512
# Use graphical install
graphical
firstboot --disable
# System keyboard
keyboard us
# System language
lang en_US
# SELinux configuration
selinux --enforcing
# Installation logging level
logging --level=info

# System timezone
timezone  Asia/Singapore
# Network information
network  --bootproto=dhcp --device=eth0 --onboot=on
# System bootloader configuration
bootloader --location=mbr
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all  
# Disk partitioning information
part /boot --fstype="ext4" --size=100
part swap --fstype="swap" --size=512
part / --fstype="ext4" --grow --size=1

%post
echo "ENGINEERING WORKSTATION" > /etc/issue
%end

The file is located at the /var/www/html directory of the webserver.

Any advice on what I may have missed will be greatly appreciated. linux virtual-machine centos httpd kickstart

share improve this question asked Jan 28 '15 at 17:12 user4985 1
add a comment |
1 Answer active oldest votes
up vote down vote Make sure that your .cfg file have right permissions and is readable by other users/systems. You may try to wget or just simply open it from any other PC in your network and see if it works.

If you have permissions problem try to set chmod to 666.

chmod 666

[Nov 18, 2011] ISO Master - GUI Tool to edit ISO Images in openSUSE SUSE & openSUSE

susegeek.com

ISO Master which is claimed to be the best ISO editing tool is a graphical editor for ISO images. ISO Master is useful for extracting, deleting, or adding files and directories to or from an ISO image. ISO Master can read .ISO files (ISO9660, Joliet, RockRidge, and El Torito), most .NRG files, and some single-track .MDF files and can save and only save as .ISO.

The supported operations include, add/delete files and directories under the ISO image, Modify/delete the Boot records. extract files from the ISO etc.

Install ISO Master

Packman as always hosts a 1-click install Yast Metapackage for ISO Master. This installer is supported on openSUSE 11.0, openSUSE 10.3, openSUSE 10.2, and SUSE 10.1 & 10.0

[Nov 18, 2011] Edit and create your bootable iso image – the easy way

Ubuntu and friends
ISO Master

ISO Master allows you to modify the content of an ISO file without damaging the bootrecord and ruining the image's bootable capabilities. If you ever need to add or remove content from a CD Image, then ISO Master is the application you should use!

Creating a custom Red Hat installation DVD

October 2005

How to create a single CD for fast and easy customized installation.

Setting up the build directory:

The first thing to do is to copy all the cdrom ISOs to one location:

mkdir -p /mnt/disk{1,2,3,4}
mount -o loop RHEL4-U1-i386-AS-disc1.iso /mnt/disk1
mount -o loop RHEL4-U1-i386-AS-disc2.iso /mnt/disk2
mount -o loop RHEL4-U1-i386-AS-disc3.iso /mnt/disk3
mount -o loop RHEL4-U1-i386-AS-disc4.iso /mnt/disk4
We now copy all the files from the directories to a single directory: mkdir -p /data/isobuild
rsync -rv /mnt/disk{4,3,2,1}/* /data/isobuild/
We also need to copy across the .diskinfo file that is not caught by our *:
cp /mnt/disk1/.diskinfo /data/isobuild/

The .diskinfo file identifies the CD as being a correct Red Hat Installer disk and is checked by anaconda during the start of the install.

We could now build the DVD as it is but we really should have a fiddle first :-)

Adding more software to the DVD

We could add some of our own rpms to /data/isobuild/RedHat/RPMS; however by just doing this does not make them available at install time. There is an XML file that is read and ensures that the packages are installed in the correct order.

So let us throw a few random packages into the mix:

Add some java:

cp jre-1_5_0_03-linux-i586.rpm /data/isobuild/RedHat/RPMS/
Some encryption for GAIM:
cp gaim-encryption-2.36-3.rf.i386.rpm /data/isobuild/RedHat/RPMS/
Updating the comps.xml file

We need to ensure that the host computer has anaconda and anaconda-runtime installed: up2date anaconda anaconda-runtime

Before we update the XML dependency file we need to sort out package orders. If you have added a lot of new packages you may need to remove some old packages that you have replaced with newer versions to stop conflicts.

So the first command is: PYTHONPATH=/usr/lib/anaconda /usr/lib/anaconda-runtime/pkgorder \ /data/isobuild/ i386 > /data/isobuild/xander-pkgorder

This creates a list of files in the order it needs to install them in the file /data/isobuild/xander-pkgorder. Sometimes an occasional RPM will not provide the information anaconda needs. You can edit the file manually and insert your RPMs at the end.

Next we need to generate the dependency file:

/usr/lib/anaconda-runtime/genhdlist --fileorder /data/isobuild/xander-pkgorder \ /data/isobuild/

You will probably have a few hiccoughs the first time you run these commands. Most may be resolved by adding the missing entries to the pkgorder file or deleting duplicate packages.

Creating an automated installer We could *now* if we wanted to build our DVD; however we can make an automated installer.

So crack open system-config-kickstart and create a kickstart file with all the packages and partitioning etc you need for your systems.

copy the resulting file to /data/isobuild/ks.cfg

we can now edit the file /data/isobuild/isolinux/isolinux.cfg

copy or change the three lines:

label linux
  kernel vmlinuz
  append initrd=initrd.img ramdisk_size=8192
to
label xander
  kernel vmlinuz
  append initrd=initrd.img ramdisk_size=8192 ks=cdrom:/ks.cfg
Then change the default at the top of the file to xander. This means that the default action is to install directly from the DVD using your kickstart file.

Building the DVD iso

Now to build the iso:

cd /data/isobuild

chmod a+w isolinux/isolinux.bin

mkisofs -r -T -J -V "Custom RHEL4 Build" -b isolinux/isolinux.bin \
 -c isolinux/boot.cat -no-emul-boot -boot-load-size 4 \
-boot-info-table -o /data/custom-RHEL4-dvd.iso  /data/isobuild/
Burning the DVD

Now we can burn the image to the CD. I assume the CD writer is already set up on your system. We use cdrecord below, but you can use other programs as well. The command is invoked as:

cdrecord -v speed=4 dev=0,0,0 /data/custom-RHEL4-dvd.iso
The speed and dev options depend on your system. The device for the dev argument can be determined by using the -scanbus option to cdrecord:
cdrecord -scanbus
Using the DVD

Once the image is burned onto the DVD, insert the DVD into the target machine and boot the machine. You should get the custom message that you created earlier. At this point, you can either press Enter at the boot prompt or let it timeout. When it times out it uses the default label, which we specified as ks (Kickstart).

Recommended Links

Google matched content

Softpanorama Recommended

Top articles

Sites

Red Hat documentation

RHEL 7

Older links



Etc

The Last but not Least Technology is dominated by two types of people: those who understand what they do not manage and those who manage what they do not understand ~Archibald Putt. Ph.D


Copyright © 1996-2018 by Dr. Nikolai Bezroukov. www.softpanorama.org was initially created as a service to the (now defunct) UN Sustainable Development Networking Programme (SDNP) in the author free time and without any remuneration. This document is an industrial compilation designed and created exclusively for educational use and is distributed under the Softpanorama Content License. Original materials copyright belong to respective owners. Quotes are made for educational purposes only in compliance with the fair use doctrine.

FAIR USE NOTICE This site contains copyrighted material the use of which has not always been specifically authorized by the copyright owner. We are making such material available to advance understanding of computer science, IT technology, economic, scientific, and social issues. We believe this constitutes a 'fair use' of any such copyrighted material as provided by section 107 of the US Copyright Law according to which such material can be distributed without profit exclusively for research and educational purposes.

This is a Spartan WHYFF (We Help You For Free) site written by people for whom English is not a native language. Grammar and spelling errors should be expected. The site contain some broken links as it develops like a living tree...

You can use PayPal to make a contribution, supporting development of this site and speed up access. In case softpanorama.org is down you can use the at softpanorama.info

Disclaimer:

The statements, views and opinions presented on this web page are those of the author (or referenced source) and are not endorsed by, nor do they necessarily reflect, the opinions of the author present and former employers, SDNP or any other organization the author may be associated with. We do not warrant the correctness of the information provided or its fitness for any purpose.

The site uses AdSense so you need to be aware of Google privacy policy. You you do not want to be tracked by Google please disable Javascript for this site. This site is perfectly usable without Javascript.

Last modified: February 10, 2020