install_build.sh 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. #!/bin/sh
  2. ## Copyright (c) 2014 Minoca Corp. All Rights Reserved.
  3. ##
  4. ## Script Name:
  5. ##
  6. ## install_build.sh
  7. ##
  8. ## Abstract:
  9. ##
  10. ## This script installs the previously extracted latest build.
  11. ##
  12. ## Author:
  13. ##
  14. ## Evan Green 19-May-2014
  15. ##
  16. ## Environment:
  17. ##
  18. ## Minoca Build
  19. ##
  20. set -e
  21. if test -z "$ARCH"; then
  22. echo "ARCH must be set."
  23. exit 1
  24. fi
  25. if test -z "$DEBUG"; then
  26. echo "DEBUG must be set."
  27. exit 1
  28. fi
  29. export TMPDIR=$PWD
  30. export TEMP=$TMPDIR
  31. ##
  32. ## Make sure the appropriate files have been extracted.
  33. ##
  34. error=''
  35. if ! test -d ./bin; then
  36. error="Missing bin directory."
  37. fi
  38. if ! test -x ./bin/msetup; then
  39. error="Missing setup."
  40. fi
  41. if ! test -r ./bin/install.img; then
  42. error="Missing install.img."
  43. fi
  44. if test -n "$error"; then
  45. echo $error
  46. pwd
  47. echo ls -la .
  48. ls -la .
  49. echo ls -la ./bin
  50. ls -la ./bin
  51. exit 1
  52. fi
  53. cd ./bin
  54. ##
  55. ## Determine whether or not to install the target with kernel debugging enabled.
  56. ##
  57. DEBUG_FLAG=''
  58. if test x$DEBUG = xchk; then
  59. DEBUG_FLAG='-D'
  60. fi
  61. ##
  62. ## If an alternate root was specified, then add that to the build.
  63. ##
  64. AUTO_ROOT_ARGS=
  65. if [ -n "$AUTO_ROOT" ]; then
  66. AUTO_ROOT_ARGS="--script=./auto_root_script"
  67. echo "$AUTO_ROOT" > ./auto_root
  68. ##
  69. ## This script copies the auto_root file in the current directory to
  70. ## /auto/auto_root at the setup destination.
  71. ##
  72. cat > ./auto_root_script <<_EOS
  73. AutoRootCopy = {
  74. "Destination": "/apps/auto/auto_root",
  75. "Source": "./auto_root",
  76. "SourceVolume": -1,
  77. };
  78. SystemPartition["Files"] += [AutoRootCopy];
  79. _EOS
  80. fi
  81. echo "Running msetup -v $DEBUG_FLAG $AUTO_ROOT_ARGS --autodeploy"
  82. msetup -v $DEBUG_FLAG $AUTO_ROOT_ARGS --autodeploy
  83. echo "Done running setup."