-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmkpxecfg.sh
executable file
·43 lines (35 loc) · 1.06 KB
/
mkpxecfg.sh
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
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
set -x
set -e
rm -rf tmp
mkdir tmp
pushd tmp
find ../Firmware -type f -name *.img.gz | sort | while IFS=/ read FOO Firmware BOARD bios VER FILE; do
if echo $BOARD | grep -q ^X10; then
GROUPLENGTH=4
elif echo $BOARD | grep -q ^X; then
GROUPLENGTH=3
else
GROUPLENGTH=2
fi
GROUP=`echo $BOARD | cut -c1-$GROUPLENGTH`
SMNAME=${FILE/.img.gz/}
if [ ! -e ${GROUP}.cfg ]; then
echo "MENU BEGIN $GROUP" > ${GROUP}.cfg
fi
echo "LABEL $SMNAME" >> ${GROUP}.cfg
echo "MENU LABEL Supermicro $BOARD ($VER) ($SMNAME)" >> ${GROUP}.cfg
echo "LINUX memdisk" >> ${GROUP}.cfg
echo "INITRD BooterMicro/Firmware/$BOARD/$bios/$VER/$FILE" >> ${GROUP}.cfg
echo "" >> ${GROUP}.cfg
done
echo 'MENU BEGIN Supermicro Motherboard BIOS/UEFI updates' > ../BooterMicro.cfg
for i in *.cfg; do
echo "MENU END" >> $i
echo "INCLUDE pxelinux.cfg/BooterMicro/$i" >> ../BooterMicro.cfg
done
echo 'MENU END' >> ../BooterMicro.cfg
popd
rm -rf ../pxelinux.cfg/BooterMicro
mv tmp ../pxelinux.cfg/BooterMicro
mv BooterMicro.cfg ../pxelinux.cfg/BooterMicro.cfg