Browse code

Cleanup PXE boot config

Dean Troyer authored on 2011/10/12 10:28:39
Showing 1 changed files
... ...
@@ -4,15 +4,8 @@
4 4
 # build_pxe_boot.sh [-k kernel-version] destdir
5 5
 #
6 6
 # Assumes syslinux is installed
7
-# Assumes devstack files are in `pwd`/pxe
8 7
 # Only needs to run as root if the destdir permissions require it
9 8
 
10
-UBUNTU_MIRROR=http://archive.ubuntu.com/ubuntu/dists/natty/main/installer-amd64/current/images/netboot/ubuntu-installer/amd64
11
-
12
-MEMTEST_VER=4.10
13
-MEMTEST_BIN=memtest86+-${MEMTEST_VER}.bin
14
-MEMTEST_URL=http://www.memtest.org/download/${MEMTEST_VER}/
15
-
16 9
 KVER=`uname -r`
17 10
 if [ "$1" = "-k" ]; then
18 11
     KVER=$2
... ...
@@ -30,8 +23,8 @@ for i in memdisk menu.c32 pxelinux.0; do
30 30
 	cp -p /usr/lib/syslinux/$i $DEST_DIR
31 31
 done
32 32
 
33
-DEFAULT=$DEST_DIR/pxelinux.cfg/default
34
-cat >$DEFAULT <<EOF
33
+CFG=$DEST_DIR/pxelinux.cfg/default
34
+cat >$CFG <<EOF
35 35
 default menu.c32
36 36
 prompt 0
37 37
 timeout 0
... ...
@@ -59,7 +52,7 @@ if [ ! -r $PXEDIR/stack-initrd.gz ]; then
59 59
     sudo $PROGDIR/build_ramdisk.sh $PXEDIR/stack-initrd.gz
60 60
 fi
61 61
 cp -p $PXEDIR/stack-initrd.gz $DEST_DIR/ubuntu
62
-cat >>$DEFAULT <<EOF
62
+cat >>$CFG <<EOF
63 63
 
64 64
 LABEL devstack
65 65
     MENU LABEL ^devstack
... ...
@@ -69,48 +62,21 @@ LABEL devstack
69 69
 EOF
70 70
 
71 71
 # Get Ubuntu
72
-if [ -d $PXEDIR ]; then
72
+if [ -d $PXEDIR -a -r $PXEDIR/natty-base-initrd.gz ]; then
73 73
     cp -p $PXEDIR/natty-base-initrd.gz $DEST_DIR/ubuntu
74
-fi
75
-cat >>$DEFAULT <<EOF
74
+    cat >>$CFG <<EOF
76 75
 
77 76
 LABEL ubuntu
78 77
     MENU LABEL ^Ubuntu Natty
79 78
     KERNEL ubuntu/vmlinuz-$KVER
80 79
     APPEND initrd=ubuntu/natty-base-initrd.gz ramdisk_size=419600 root=/dev/ram0
81 80
 EOF
82
-
83
-# Get Memtest
84
-cd $DEST_DIR
85
-if [ ! -r $MEMTEST_BIN ]; then
86
-    wget -N --quiet ${MEMTEST_URL}/${MEMTEST_BIN}.gz
87
-    gunzip $MEMTEST_BIN
88 81
 fi
89
-cat >>$DEFAULT <<EOF
90
-
91
-LABEL memtest
92
-    MENU LABEL ^Memtest86+
93
-    KERNEL $MEMTEST_BIN
94
-EOF
95
-
96
-# Get FreeDOS
97
-mkdir -p $DEST_DIR/freedos
98
-cd $DEST_DIR/freedos
99
-wget -N --quiet http://www.fdos.org/bootdisks/autogen/FDSTD.288.gz
100
-gunzip -f FDSTD.288.gz
101
-cat >>$DEFAULT <<EOF
102
-
103
-LABEL freedos
104
-	MENU LABEL ^FreeDOS bootdisk
105
-	KERNEL memdisk
106
-	APPEND initrd=freedos/FDSTD.288
107
-EOF
108 82
 
109 83
 # Local disk boot
110
-cat >>$DEFAULT <<EOF
84
+cat >>$CFG <<EOF
111 85
 
112 86
 LABEL local
113 87
     MENU LABEL ^Local disk
114
-    MENU DEFAULT
115 88
     LOCALBOOT 0
116 89
 EOF