Revision 36d8d02d

b/pc-bios/README
18 18
  https://github.com/dgibson/SLOF, and the image currently in qemu is
19 19
  built from git tag qemu-slof-20110323.
20 20

  
21
- The PXE roms come from Rom-o-Matic gPXE 0.9.9 with BANNER_TIMEOUT=0
22

  
23
  e1000 8086:100E
24
  eepro100 8086:1209 (also used for 8086:1229 and 8086:2449)
25
  ns8390 1050:0940
26
  pcnet32 1022:2000
27
  rtl8139 10ec:8139
28
  virtio 1af4:1000
29

  
30
  http://rom-o-matic.net/
21
- The PXE roms come from the iPXE project. Built with BANNER_TIME 0.
22
  Sources available at http://ipxe.org.  Vendor:Device ID -> ROM mapping:
23

  
24
	8086:100e -> pxe-e1000.rom
25
	8086:1209 -> pxe-eepro100.rom
26
	1050:0940 -> pxe-ne2k_pci.rom
27
	1022:2000 -> pxe-pcnet.rom
28
	10ec:8139 -> pxe-rtl8139.rom
29
	1af4:1000 -> pxe-virtio.rom
31 30

  
32 31
- The S390 zipl loader is an addition to the official IBM s390-tools
33 32
  package. That fork is maintained in its own git repository at:
b/scripts/refresh-pxe-roms.sh
1
#!/bin/bash
2

  
3
# PXE ROM build script
4
#
5
# This program is free software; you can redistribute it and/or modify
6
# it under the terms of the GNU General Public License as published by
7
# the Free Software Foundation; either version 2 of the License, or
8
# (at your option) any later version.
9
#
10
# This program is distributed in the hope that it will be useful,
11
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
# GNU General Public License for more details.
14
#
15
# You should have received a copy of the GNU General Public License
16
# along with this program; if not, see <http://www.gnu.org/licenses/>.
17
#
18
# Copyright (C) 2011 Red Hat, Inc.
19
#   Authors: Alex Williamson <alex.williamson@redhat.com>
20
#
21
# Usage: Run from root of qemu tree
22
# ./scripts/refresh-pxe-roms.sh
23

  
24
QEMU_DIR=$PWD
25
ROM_DIR="pc-bios"
26
BUILD_DIR="roms/ipxe"
27
LOCAL_CONFIG="src/config/local/general.h"
28

  
29
function cleanup ()
30
{
31
    if [ -n "$SAVED_CONFIG" ]; then
32
        cp "$SAVED_CONFIG" "$BUILD_DIR"/"$LOCAL_CONFIG"
33
        rm "$SAVED_CONFIG"
34
    fi
35
    cd "$QEMU_DIR"
36
}
37

  
38
function make_rom ()
39
{
40
    cd "$BUILD_DIR"/src
41

  
42
    BUILD_LOG=$(mktemp)
43

  
44
    echo Building "$2"...
45
    make bin/"$1".rom > "$BUILD_LOG" 2>&1
46
    if [ $? -ne 0 ]; then
47
        echo Build failed
48
        tail --lines=100 "$BUILD_LOG"
49
        rm "$BUILD_LOG"
50
        cleanup
51
        exit 1
52
    fi
53
    rm "$BUILD_LOG"
54

  
55
    cp bin/"$1".rom "$QEMU_DIR"/"$ROM_DIR"/"$2"
56

  
57
    cd "$QEMU_DIR"
58
}
59

  
60
if [ ! -d "$QEMU_DIR"/"$ROM_DIR" ]; then
61
    echo "error: can't find $ROM_DIR directory," \
62
         "run me from the root of the qemu tree"
63
    exit 1
64
fi
65

  
66
if [ ! -d "$BUILD_DIR"/src ]; then
67
    echo "error: $BUILD_DIR not populated, try:"
68
    echo "  git submodule init $BUILD_DIR"
69
    echo "  git submodule update $BUILD_DIR"
70
    exit 1
71
fi
72

  
73
if [ -e "$BUILD_DIR"/"$LOCAL_CONFIG" ]; then
74
    SAVED_CONFIG=$(mktemp)
75
    cp "$BUILD_DIR"/"$LOCAL_CONFIG" "$SAVED_CONFIG"
76
fi
77

  
78
echo "#undef BANNER_TIMEOUT" > "$BUILD_DIR"/"$LOCAL_CONFIG"
79
echo "#define BANNER_TIMEOUT 0" >> "$BUILD_DIR"/"$LOCAL_CONFIG"
80

  
81
IPXE_VERSION=$(cd "$BUILD_DIR" && git describe --tags)
82
if [ -z "$IPXE_VERSION" ]; then
83
    echo "error: unable to retrieve git version"
84
    cleanup
85
    exit 1
86
fi
87

  
88
echo "#undef PRODUCT_NAME" >> "$BUILD_DIR"/"$LOCAL_CONFIG"
89
echo "#define PRODUCT_NAME \"iPXE $IPXE_VERSION\"" >> "$BUILD_DIR"/"$LOCAL_CONFIG"
90

  
91
make_rom 8086100e pxe-e1000.rom
92
make_rom 80861209 pxe-eepro100.rom
93
make_rom 10500940 pxe-ne2k_pci.rom
94
make_rom 10222000 pxe-pcnet.rom
95
make_rom 10ec8139 pxe-rtl8139.rom
96
make_rom 1af41000 pxe-virtio.rom
97

  
98
echo done
99
cleanup

Also available in: Unified diff