move blacklisting into separate kickstart include
[ovirt-node-image.git] / ovirt-pxe
blobfacca5b814cf6ff93116e388ee20c5d993e39d0b
1 #!/bin/bash
3 # Create an Ovirt Host PXE boot
4 # Copyright 2008 Red Hat, Inc.
5 # Written by Chris Lalancette <clalance@redhat.com>
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; version 2 of the License.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU Library General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 ME=$(basename "$0")
21 warn() { printf "$ME: $@\n" >&2; }
22 die() { warn "$@"; exit 1; }
24 test $# != 1 && die "Usage: $ME <iso-image>"
26 ISO=$1
27 test ! -r $ISO && die "$ISO is not a readable file"
28 test $( id -u ) -ne 0 && die "$ME must run as root"
30 livecd-iso-to-pxeboot $ISO
32 # append BOOTIF with PXE MAC info
33 f=tftpboot/pxelinux.cfg/default
34 grep -q 'IPAPPEND 2' $f || sed -i '/KERNEL/a \\tIPAPPEND 2' $f