copy-to-kernel.sh 923 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/bash
  2. function usage()
  3. {
  4. echo "$0 <config_dir> <kernel_dir>"
  5. echo " Copy source files and configuration into a kernel tree."
  6. echo " The configuration and list of files to copy is found in <config_dir>."
  7. echo " The target kernel tree is <kernel_dir>."
  8. echo " Before running this script, we recommend that you clean out the old"
  9. echo " destination directories in <kernel_dir>."
  10. }
  11. if [ "$#" -lt 2 ]; then
  12. echo "Not enough arguments"
  13. usage
  14. exit 1
  15. fi
  16. CONFIG=$1
  17. DEST=$2
  18. if [ ! -f "$CONFIG/copy_items.sh" ]; then
  19. echo "$CONFIG does not look like a config directory. copy_items.sh is missing."
  20. usage
  21. exit 1
  22. fi
  23. if [ ! -f "$DEST/Kconfig" ] ; then
  24. echo "$DEST does not look like a kernel directory."
  25. usage
  26. exit 1
  27. fi
  28. function copyfile()
  29. {
  30. src=$1
  31. dest="$DEST/$2"
  32. mkdir -p `dirname $dest`
  33. echo copy $src to $dest
  34. cp $src $dest
  35. chmod u+w $dest
  36. }
  37. source "$CONFIG/copy_items.sh"