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