OpenSDE Framework (without history before r20070)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

97 lines
2.1 KiB

  1. # --- SDE-COPYRIGHT-NOTE-BEGIN ---
  2. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  3. #
  4. # Filename: target/wrt2/build_image.sh
  5. # Copyright (C) 2006 The OpenSDE Project
  6. # Copyright (C) 2004 - 2006 The T2 SDE Project
  7. #
  8. # More information can be found in the files COPYING and README.
  9. #
  10. # This program is free software; you can redistribute it and/or modify
  11. # it under the terms of the GNU General Public License as published by
  12. # the Free Software Foundation; version 2 of the License. A copy of the
  13. # GNU General Public License can be found in the file COPYING.
  14. # --- SDE-COPYRIGHT-NOTE-END ---
  15. . $base/target/share/functions.in
  16. set -e
  17. echo "Preparing root filesystem image from build result ..."
  18. rm -rf $imagelocation{,.squashfs}
  19. mkdir -p $imagelocation ; cd $imagelocation
  20. find $build_root -printf "%P\n" | sed '
  21. # stuff we never need
  22. /^TOOLCHAIN/ d;
  23. /^var\/adm/ d;
  24. /\/include/ d;
  25. /\/src/ d;
  26. /\.a$/ d;
  27. /\.o$/ d;
  28. /\.old$/ d;
  29. /\/games/ d;
  30. /\/local/ d;
  31. /^boot/ d;
  32. # # stuff that would be nice - but is huge and only documentation
  33. /\/man/ d;
  34. /\/doc/ d;
  35. # /etc noise
  36. /^etc\/stone.d/ d;
  37. /^etc\/cron.d/ d;
  38. /^etc\/init.d/ d;
  39. /^etc\/skel/ d;
  40. /^etc\/opt/ d;
  41. /^etc\/conf/ d;
  42. /^etc\/rc.d/ d;
  43. /^opt/ d;
  44. /^\/man\// d;
  45. /terminfo\/a\/ansi$/ { p; d; }
  46. /terminfo\/l\/linux$/ { p; d; }
  47. /terminfo\/x\/xterm$/ { p; d; }
  48. /terminfo\/n\/nxterm$/ { p; d; }
  49. /terminfo\/x\/xterm-color$/ { p; d; }
  50. /terminfo\/x\/xterm-8bit$/ { p; d; }
  51. /terminfo\/x\/screen$/ { p; d; }
  52. /terminfo\/v\/vt100$/ { p; d; }
  53. /terminfo\/v\/vt200$/ { p; d; }
  54. /terminfo\/v\/vt220$/ { p; d; }
  55. /terminfo/ d;
  56. ' > tar.input
  57. copy_with_list_from_file $build_root . $PWD/tar.input
  58. rm tar.input
  59. echo "Preparing root filesystem image from target defined files ..."
  60. rm -f sbin/init ; ln -s minit sbin/init
  61. copy_from_source $base/target/$target/rootfs .
  62. echo "Creating links for identical files ..."
  63. link_identical_files
  64. echo "Creating root filesystem image (squashfs) ..."
  65. if [ "$arch_bigendian" = "yes" ]; then
  66. sqfsopts="-be"
  67. else
  68. sqfsopts="-le"
  69. fi
  70. mksquashfs $imagelocation{,.squashfs} $sqfsopts > /dev/null
  71. du -sh $imagelocation{,.squashfs}
  72. echo "The image is located at $imagelocation.squasfs."