Guest User

fogproject keyboard issues

a guest
Aug 21st, 2025
335
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.29 KB | None | 0 0
  1. #!/bin/bash
  2. if [[ -r $1 ]]; then
  3. cert=$1
  4. elif [[ -r /opt/fog/snapins/ssl/CA/.fogCA.pem ]]; then
  5. cert="/opt/fog/snapins/ssl/CA/.fogCA.pem"
  6. fi
  7.  
  8. BUILDOPTS="CERT=${cert} TRUST=${cert}"
  9. IPXEGIT="https://github.com/ipxe/ipxe"
  10.  
  11. # Change directory to base ipxe files
  12. SCRIPT=$(readlink -f "$BASH_SOURCE")
  13. FOGDIR=$(dirname $(dirname $(dirname "$SCRIPT") ) )
  14. BASE=$(dirname "$FOGDIR")
  15.  
  16. if [[ -d ${BASE}/ipxe ]]; then
  17. cd ${BASE}/ipxe
  18. git clean -fd
  19. git reset --hard
  20. git pull
  21. cd src/
  22. # make sure this is being re-compiled in case the CA has changed!
  23. touch crypto/rootcert.c
  24. else
  25. git clone ${IPXEGIT} ${BASE}/ipxe
  26. cd ${BASE}/ipxe/src/
  27. fi
  28.  
  29.  
  30. # Get current header and script from fogproject repo
  31. echo "Copy (overwrite) iPXE headers and scripts..."
  32. cp ${FOGDIR}/src/ipxe/src/Makefile.housekeeping .
  33. cp ${FOGDIR}/src/ipxe/src/ipxescript .
  34. cp ${FOGDIR}/src/ipxe/src/ipxescript10sec .
  35. cp ${FOGDIR}/src/ipxe/src/config/general.h config/
  36. cp ${FOGDIR}/src/ipxe/src/config/settings.h config/
  37. cp ${FOGDIR}/src/ipxe/src/config/console.h config/
  38. # For BIOS builds, disable USB_HCD_USBIO as it's EFI-specific
  39. sed -i 's+#define USB_HCD_USBIO+//#define USB_HCD_USBIO+g' config/usb.h
  40.  
  41. # Build the files
  42. make -j$(nproc) EMBED=ipxescript bin/ipxe.iso bin/{undionly,ipxe,intel,realtek}.{,k,kk}pxe bin/ipxe.lkrn bin/ipxe.usb ${BUILDOPTS}
  43. [[ $? -eq 0 ]] || exit 40
  44.  
  45. # Copy files to repo location as required
  46. cp bin/ipxe.iso bin/{undionly,ipxe,intel,realtek}.{,k,kk}pxe bin/ipxe.lkrn bin/ipxe.usb ${FOGDIR}/packages/tftp/
  47. cp bin/ipxe.lkrn ${FOGDIR}/packages/tftp/ipxe.krn
  48.  
  49. # Build with 10 second delay
  50. make -j$(nproc) EMBED=ipxescript10sec bin/ipxe.iso bin/{undionly,ipxe,intel,realtek}.{,k,kk}pxe bin/ipxe.lkrn bin/ipxe.usb ${BUILDOPTS}
  51. [[ $? -eq 0 ]] || exit 48
  52.  
  53. # Copy files to repo location as required
  54. cp bin/ipxe.iso bin/{undionly,ipxe,intel,realtek}.{,k,kk}pxe bin/ipxe.lkrn bin/ipxe.usb ${FOGDIR}/packages/tftp/10secdelay/
  55. cp bin/ipxe.lkrn ${FOGDIR}/packages/tftp/10secdelay/ipxe.krn
  56.  
  57. # Change to the efi layout
  58. if [[ -d ${BASE}/ipxe-efi ]]; then
  59. cd ${BASE}/ipxe-efi/
  60. git clean -fd
  61. git reset --hard
  62. git pull
  63. cd src/
  64. # make sure this is being re-compiled in case the CA has changed!
  65. touch crypto/rootcert.c
  66. else
  67. git clone ${IPXEGIT} ${BASE}/ipxe-efi
  68. cd ${BASE}/ipxe-efi/src/
  69. fi
  70.  
  71. # Get current header and script from fogproject repo
  72. echo "Copy (overwrite) iPXE headers and scripts..."
  73. cp ${FOGDIR}/src/ipxe/src-efi/Makefile.housekeeping .
  74. cp ${FOGDIR}/src/ipxe/src-efi/ipxescript .
  75. cp ${FOGDIR}/src/ipxe/src-efi/ipxescript10sec .
  76. cp ${FOGDIR}/src/ipxe/src-efi/config/general.h config/
  77. cp ${FOGDIR}/src/ipxe/src-efi/config/settings.h config/
  78. cp ${FOGDIR}/src/ipxe/src-efi/config/console.h config/
  79. # For EFI builds, enable USB_HCD_USBIO for keyboard support and disable conflicting USB_EFI
  80. sed -i 's+//#define USB_HCD_USBIO+#define USB_HCD_USBIO+g' config/usb.h
  81. sed -i 's+//#undef USB_KEYBOARD+#define USB_KEYBOARD+g' config/usb.h
  82. sed -i 's+//#undef USB_EFI+#undef USB_EFI+g' config/usb.h
  83.  
  84. # Build the files
  85. make -j$(nproc) EMBED=ipxescript bin-{i386,x86_64}-efi/{snp{,only},ipxe,intel,realtek}.efi ${BUILDOPTS}
  86. [[ $? -eq 0 ]] || exit 80
  87.  
  88. # Apply USB configuration for ARM64 build
  89. make -j$(nproc) CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64 EMBED=ipxescript bin-arm64-efi/{snp{,only},ipxe,intel,realtek}.efi ${BUILDOPTS}
  90. [[ $? -eq 0 ]] || exit 82
  91.  
  92. # Copy the files to upload
  93. cp bin-arm64-efi/{snp{,only},ipxe,intel,realtek}.efi ${FOGDIR}/packages/tftp/arm64-efi/
  94. cp bin-i386-efi/{snp{,only},ipxe,intel,realtek}.efi ${FOGDIR}/packages/tftp/i386-efi/
  95. cp bin-x86_64-efi/{snp{,only},ipxe,intel,realtek}.efi ${FOGDIR}/packages/tftp/
  96.  
  97. # Build with 10 second delay
  98. make -j$(nproc) EMBED=ipxescript10sec bin-{i386,x86_64}-efi/{snp{,only},ipxe,intel,realtek}.efi ${BUILDOPTS}
  99. [[ $? -eq 0 ]] || exit 91
  100.  
  101. make -j$(nproc) CROSS_COMPILE=aarch64-linux-gnu- ARCH=arm64 EMBED=ipxescript10sec bin-arm64-efi/{snp{,only},ipxe,intel,realtek}.efi ${BUILDOPTS}
  102. [[ $? -eq 0 ]] || exit 93
  103.  
  104. # Copy the files to upload
  105. cp bin-arm64-efi/{snp{,only},ipxe,intel,realtek}.efi ${FOGDIR}/packages/tftp/10secdelay/arm64-efi/
  106. cp bin-i386-efi/{snp{,only},ipxe,intel,realtek}.efi ${FOGDIR}/packages/tftp/10secdelay/i386-efi/
  107. cp bin-x86_64-efi/{snp{,only},ipxe,intel,realtek}.efi ${FOGDIR}/packages/tftp/10secdelay/
Advertisement
Add Comment
Please, Sign In to add comment