"Fossies" - the Fresh Open Source Software Archive 
Member "fogproject-1.5.9/utils/FOGiPXE/buildipxe.sh" (13 Sep 2020, 3801 Bytes) of package /linux/misc/fogproject-1.5.9.tar.gz:
As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Bash source code syntax highlighting (style:
standard) with prefixed line numbers and
code folding option.
Alternatively you can here
view or
download the uninterpreted source code file.
See also the latest
Fossies "Diffs" side-by-side code changes report for "buildipxe.sh":
1.5.8_vs_1.5.9.
1 #!/bin/bash
2 if [[ -r $1 ]]; then
3 BUILDOPTS="CERT=$1 TRUST=$1"
4 elif [[ -r /opt/fog/snapins/ssl/CA/.fogCA.pem ]]; then
5 BUILDOPTS="CERT=/opt/fog/snapins/ssl/CA/.fogCA.pem TRUST=/opt/fog/snapins/ssl/CA/.fogCA.pem"
6 fi
7 IPXEGIT="https://github.com/ipxe/ipxe"
8
9 # Change directory to base ipxe files
10 SCRIPT=$(readlink -f "$BASH_SOURCE")
11 FOGDIR=$(dirname $(dirname $(dirname "$SCRIPT") ) )
12 BASE=$(dirname "$FOGDIR")
13
14 if [[ -d ${BASE}/ipxe ]]; then
15 cd ${BASE}/ipxe
16 git clean -fd
17 git reset --hard
18 git pull
19 cd src/
20 # make sure this is being re-compiled in case the CA has changed!
21 touch crypto/rootcert.c
22 else
23 git clone ${IPXEGIT} ${BASE}/ipxe
24 cd ${BASE}/ipxe/src/
25 fi
26
27
28 # Get current header and script from fogproject repo
29 echo "Copy (overwrite) iPXE headers and scripts..."
30 cp ${FOGDIR}/src/ipxe/src/ipxescript .
31 cp ${FOGDIR}/src/ipxe/src/ipxescript10sec .
32 cp ${FOGDIR}/src/ipxe/src/config/general.h config/
33 cp ${FOGDIR}/src/ipxe/src/config/settings.h config/
34 cp ${FOGDIR}/src/ipxe/src/config/console.h config/
35
36 # Build the files
37 make EMBED=ipxescript bin/ipxe.iso bin/{undionly,ipxe,intel,realtek}.{,k,kk}pxe bin/ipxe.lkrn bin/ipxe.usb ${BUILDOPTS}
38
39 # Copy files to repo location as required
40 cp bin/ipxe.iso bin/{undionly,ipxe,intel,realtek}.{,k,kk}pxe bin/ipxe.lkrn bin/ipxe.usb ${FOGDIR}/packages/tftp/
41 cp bin/ipxe.lkrn ${FOGDIR}/packages/tftp/ipxe.krn
42
43 # Build with 10 second delay
44 make EMBED=ipxescript10sec bin/ipxe.iso bin/{undionly,ipxe,intel,realtek}.{,k,kk}pxe bin/ipxe.lkrn bin/ipxe.usb ${BUILDOPTS}
45
46 # Copy files to repo location as required
47 cp bin/ipxe.iso bin/{undionly,ipxe,intel,realtek}.{,k,kk}pxe bin/ipxe.lkrn bin/ipxe.usb ${FOGDIR}/packages/tftp/10secdelay/
48 cp bin/ipxe.lkrn ${FOGDIR}/packages/tftp/10secdelay/ipxe.krn
49
50
51
52 # Change to the efi layout
53 if [[ -d ${BASE}/ipxe-efi ]]; then
54 cd ${BASE}/ipxe-efi/
55 git clean -fd
56 git reset --hard
57 git pull
58 cd src/
59 # make sure this is being re-compiled in case the CA has changed!
60 touch crypto/rootcert.c
61 else
62 git clone ${IPXEGIT} ${BASE}/ipxe-efi
63 cd ${BASE}/ipxe-efi/src/
64 fi
65
66 # Get current header and script from fogproject repo
67 echo "Copy (overwrite) iPXE headers and scripts..."
68 cp ${FOGDIR}/src/ipxe/src-efi/ipxescript .
69 cp ${FOGDIR}/src/ipxe/src-efi/ipxescript10sec .
70 cp ${FOGDIR}/src/ipxe/src-efi/config/general.h config/
71 cp ${FOGDIR}/src/ipxe/src-efi/config/settings.h config/
72 cp ${FOGDIR}/src/ipxe/src-efi/config/console.h config/
73
74 # Build the files
75 make EMBED=ipxescript bin-{i386,x86_64}-efi/{snp{,only},ipxe,intel,realtek,ncm--ecm--axge}.efi ${BUILDOPTS}
76 [[ "x$armsupport" == "x1" ]] && make CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64 EMBED=ipxescript bin-arm64-efi/{snp{,only},ipxe,intel,realtek,ncm--ecm--axge}.efi ${BUILDOPTS}
77
78 # Copy the files to upload
79 [[ "x$armsupport" == "x1" ]] && cp bin-arm64-efi/{snp{,only},ipxe,intel,realtek,ncm--ecm--axge}.efi ${FOGDIR}/packages/tftp/arm64-efi/
80 cp bin-i386-efi/{snp{,only},ipxe,intel,realtek,ncm--ecm--axge}.efi ${FOGDIR}/packages/tftp/i386-efi/
81 cp bin-x86_64-efi/{snp{,only},ipxe,intel,realtek,ncm--ecm--axge}.efi ${FOGDIR}/packages/tftp/
82
83 # Build with 10 second delay
84 make EMBED=ipxescript10sec bin-{i386,x86_64}-efi/{snp{,only},ipxe,intel,realtek,ncm--ecm--axge}.efi ${BUILDOPTS}
85 [[ "x$armsupport" == "x1" ]] && make CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64 EMBED=ipxescript10sec bin-arm64-efi/{snp{,only},ipxe,intel,realtek,ncm--ecm--axge}.efi ${BUILDOPTS}
86
87 # Copy the files to upload
88 [[ "x$armsupport" == "x1" ]] && cp bin-arm64-efi/{snp{,only},ipxe,intel,realtek,ncm--ecm--axge}.efi ${FOGDIR}/packages/tftp/10secdelay/arm64-efi/
89 cp bin-i386-efi/{snp{,only},ipxe,intel,realtek,ncm--ecm--axge}.efi ${FOGDIR}/packages/tftp/10secdelay/i386-efi/
90 cp bin-x86_64-efi/{snp{,only},ipxe,intel,realtek,ncm--ecm--axge}.efi ${FOGDIR}/packages/tftp/10secdelay/