common.inc.sh 691 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. config() {
  2. :
  3. }
  4. device() {
  5. :
  6. }
  7. factory_image() {
  8. :
  9. }
  10. sysupgrade_image() {
  11. :
  12. }
  13. alias() {
  14. :
  15. }
  16. manifest_alias() {
  17. :
  18. }
  19. packages() {
  20. :
  21. }
  22. factory() {
  23. :
  24. }
  25. sysupgrade() {
  26. :
  27. }
  28. no_opkg() {
  29. :
  30. }
  31. unknown_devices="$DEVICES"
  32. want_device() {
  33. [ "$DEVICES" ] || return 0
  34. local new_devices=''
  35. for device in $unknown_devices; do
  36. if [ "$device" != "$1" ]; then
  37. new_devices="${new_devices:+${new_devices} }$device"
  38. fi
  39. done
  40. unknown_devices=$new_devices
  41. for device in $DEVICES; do
  42. if [ "$device" = "$1" ]; then
  43. return 0
  44. fi
  45. done
  46. return 1
  47. }
  48. check_devices() {
  49. if [ "$unknown_devices" ]; then
  50. echo "Error: unknown devices given: ${unknown_devices}" >&2
  51. exit 1
  52. fi
  53. }