summaryrefslogtreecommitdiffstats
path: root/tools/i386/netboot/makeImages
blob: 3920547d7369096cd6282dbdb08b540dc05ce766 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
# compile multiple grub stages (1, 2, pxegrub and nbgrub) for all supported network cards
LOCALPATH=`pwd`
PATHGRUB="../grub-0.91" # Path were grub is stored
DRIVERTOCOMPILE=`grep NETBOOT_DRIVERS= ${PATHGRUB}/configure.in | cut -d " " -f 4 | cut -d "." -f 1`

echo "Cleaning old drivers"
for i in `ls`
do
	if [ -d $i ] && [ $i != CVS ]; then
	rm -rf $i
	fi
	
done

cd ${PATHGRUB}

echo "Compiling new ones"
for i in ${DRIVERTOCOMPILE}
	do
	make clean
	./configure --enable-$i --enable-diskless
	make 
	mkdir ${LOCALPATH}/$i
	cp stage1/stage1 ${LOCALPATH}/$i/stage1
	cp stage2/stage2 ${LOCALPATH}/$i/stage2
	cp stage2/pxegrub ${LOCALPATH}/$i/pxegrub
	cp stage2/nbgrub ${LOCALPATH}/$i/nbgrub
	echo "compil done for " $i
done
cp ${PATHGRUB}/grub/grub ${LOCALPATH} -f