OpenSDE Framework (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

56 lines
1.9 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: lib/boot/boot.in
  5. # Copyright (C) 2008 The OpenSDE Project
  6. #
  7. # More information can be found in the files COPYING and README.
  8. #
  9. # This program is free software; you can redistribute it and/or modify
  10. # it under the terms of the GNU General Public License as published by
  11. # the Free Software Foundation; version 2 of the License. A copy of the
  12. # GNU General Public License can be found in the file COPYING.
  13. # --- SDE-COPYRIGHT-NOTE-END ---
  14. # by default we will peek the first suitable bootloader found
  15. #
  16. boot_choose_bootloader() { head -n 1; }
  17. # variables
  18. #
  19. bootloader=
  20. # load stuff from the architecture, if anything to load.
  21. [ ! -s "architecture/$arch/boot.in" ] || . "architecture/$arch/boot.in"
  22. # and allow targets to overload these functions and variables
  23. # FIXME: this should honor the target_chain, in reverse order, peeking the first one.
  24. [ ! -s "target/$target/boot.in" ] || . "target/$target/boot.in"
  25. # if the target didn't choose one already, find the suitables and choose one
  26. if [ -z "$bootloader" ]; then
  27. bootloader="$(
  28. ls -1d `sed -n -e 's,^X [^ ]\+ [^ ]\+ \([^ ]\+\) \([^ ]\+\) .* BOOT .*,package/\1/\2/boot/boot.in,p' \
  29. "config/$config/packages"` 2> /dev/null |
  30. cut -d/ -f'2,3' | boot_choose_bootloader )"
  31. fi
  32. # validate the module, and source.
  33. #
  34. if [ -z "$bootloader" ]; then
  35. echo_error "boot: couldn't find any suitable bootloader."
  36. exit 1
  37. elif [ ! -e "package/$bootloader/boot/boot.in" ]; then
  38. echo_error "boot: '$bootloader' is not suitable."
  39. else
  40. echo_status "boot: using $bootloader."
  41. fi
  42. # stub boot_cd_*() functions
  43. #
  44. boot_cd_pre() { echo_warning "No specific boot_cd_pre() available."; }
  45. boot_cd_add() { echo_warning "No specific boot_cd_add() available."; }
  46. boot_cd_post() { echo_warning "No specific boot_cd_post() available."; }
  47. . "package/$bootloader/boot/boot.in"