action.yml 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. name: Setup Baseband Guard (BBG)
  2. description: Download and configure Baseband Guard security module
  3. inputs:
  4. kernel_root:
  5. description: 'Path to kernel root directory'
  6. required: true
  7. defconfig_fragment:
  8. description: 'Path to defconfig fragment file'
  9. required: true
  10. runs:
  11. using: composite
  12. steps:
  13. - name: Download Baseband Guard
  14. shell: bash
  15. working-directory: ${{ inputs.kernel_root }}
  16. run: |
  17. echo "========================================"
  18. echo " Setting up Baseband Guard "
  19. echo "========================================"
  20. curl -LSs https://github.com/vc-teahouse/Baseband-guard/raw/main/setup.sh | bash
  21. echo "✓ Baseband Guard downloaded"
  22. - name: Configure Baseband Guard
  23. shell: bash
  24. working-directory: ${{ inputs.kernel_root }}
  25. run: |
  26. # Add BBG to defconfig
  27. echo "CONFIG_BBG=y" >> "${{ inputs.defconfig_fragment }}"
  28. # Modify security Kconfig to include baseband_guard in LSM
  29. sed -i '/^config LSM$/,/^help$/{ /^[[:space:]]*default/ { /baseband_guard/! s/selinux/selinux,baseband_guard/ } }' common/security/Kconfig
  30. echo "✓ Baseband Guard configured in kernel"
  31. - name: Verify BBG Installation
  32. shell: bash
  33. working-directory: ${{ inputs.kernel_root }}
  34. run: |
  35. if grep -q "baseband_guard" common/security/Kconfig; then
  36. echo "✓ SUCCESS: baseband_guard found in common/security/Kconfig"
  37. grep -n "baseband_guard" common/security/Kconfig || true
  38. else
  39. echo "✗ FAILED: baseband_guard not found in common/security/Kconfig"
  40. exit 1
  41. fi
  42. - name: Extract BBG Version
  43. shell: bash
  44. working-directory: ${{ inputs.kernel_root }}/Baseband-guard
  45. run: |
  46. BBG_COMMIT=$(git rev-parse --short HEAD 2>/dev/null)
  47. BBG_VERSION=$(git rev-list --count HEAD 2>/dev/null)
  48. echo "BBG_COMMIT=$BBG_COMMIT" >> $GITHUB_ENV
  49. echo "BBG_VERSION=$BBG_VERSION" >> $GITHUB_ENV
  50. echo "✓ Baseband Guard Setup Complete"
  51. echo " Version : $BBG_VERSION"
  52. echo " Commit : $BBG_COMMIT"
  53. echo "========================================"