common.inc.sh 633 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. if [ "$DEVICES" ]; then
  26. has_devices=1
  27. else
  28. has_devices=
  29. fi
  30. want_device() {
  31. [ "$has_devices" ] || return 0
  32. local new_devices=''
  33. local ret=1
  34. for device in $DEVICES; do
  35. if [ "$device" = "$1" ]; then
  36. ret=0
  37. else
  38. new_devices="${new_devices:+${new_devices} }$device"
  39. fi
  40. done
  41. DEVICES=$new_devices
  42. return $ret
  43. }
  44. check_devices() {
  45. [ "$has_devices" ] || return 0
  46. if [ "$DEVICES" ]; then
  47. echo "Error: unknown devices given: $DEVICES" >&2
  48. exit 1
  49. fi
  50. }