common.inc.sh 648 B

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