post-build.sh 793 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/sh
  2. linux_image()
  3. {
  4. if grep -Eq "^BR2_LINUX_KERNEL_UIMAGE=y$" ${BR2_CONFIG}; then
  5. echo "uImage"
  6. elif grep -Eq "^BR2_LINUX_KERNEL_IMAGE=y$" ${BR2_CONFIG}; then
  7. echo "Image"
  8. elif grep -Eq "^BR2_LINUX_KERNEL_IMAGEGZ=y$" ${BR2_CONFIG}; then
  9. echo "Image.gz"
  10. else
  11. echo "zImage"
  12. fi
  13. }
  14. generic_getty()
  15. {
  16. if grep -Eq "^BR2_TARGET_GENERIC_GETTY=y$" ${BR2_CONFIG}; then
  17. echo ""
  18. else
  19. echo "s/\s*console=\S*//"
  20. fi
  21. }
  22. PARTUUID="$($HOST_DIR/bin/uuidgen)"
  23. install -d "$TARGET_DIR/boot/extlinux/"
  24. sed -e "$(generic_getty)" \
  25. -e "s/%LINUXIMAGE%/$(linux_image)/g" \
  26. -e "s/%PARTUUID%/$PARTUUID/g" \
  27. "board/orangepi/common/extlinux.conf" > "$TARGET_DIR/boot/extlinux/extlinux.conf"
  28. sed "s/%PARTUUID%/$PARTUUID/g" "board/orangepi/common/genimage.cfg" > "$BINARIES_DIR/genimage.cfg"