gen_inst.sh 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. ##
  2. ## Copyright (c) 2016 Minoca Corp. All Rights Reserved.
  3. ##
  4. ## Script Name:
  5. ##
  6. ## gen_inst.sh
  7. ##
  8. ## Abstract:
  9. ##
  10. ## This script generates the install archives.
  11. ##
  12. ## Author:
  13. ##
  14. ## Evan Green 30-Mar-2016
  15. ##
  16. ## Environment:
  17. ##
  18. ## Build
  19. ##
  20. set -e
  21. if test -z "$SRCROOT"; then
  22. echo "Error: SRCROOT must be set."
  23. exit 1
  24. fi
  25. REVISION="0"
  26. WORKING="$SRCROOT/instwork"
  27. if [ -d "$WORKING" ]; then
  28. echo "Removing old $WORKING"
  29. rm -rf "$WORKING"
  30. fi
  31. mkdir "$WORKING"
  32. for arch in x86 x86q armv7 armv6; do
  33. BINROOT=$SRCROOT/${arch}chk/bin
  34. if ! [ -d $BINROOT ] ; then
  35. continue
  36. fi
  37. if [ -r $BINROOT/build-revision ] ; then
  38. rev=`cat $BINROOT/build-revision`
  39. if expr "$rev" \> "$REVISION" ; then
  40. REVISION="$rev"
  41. fi
  42. fi
  43. mkdir -p "$WORKING/$arch"
  44. if [ -r "$BINROOT/distribute/install.img" ]; then
  45. cp -pv "$BINROOT/install.img" "$WORKING/$arch/"
  46. fi
  47. if [ -r "$BINROOT/msetup" ]; then
  48. cp -pv "$BINROOT/msetup" "$WORKING/$arch/"
  49. fi
  50. if [ -r "$SRCROOT/x86chk/msetup_build.exe" ]; then
  51. cp -pv "$SRCROOT/x86chk/msetup_build.exe" "$WORKING/msetup.exe"
  52. fi
  53. done
  54. ##
  55. ## Add the readme file.
  56. ##
  57. DATE=`date "+%B %d, %Y"`
  58. echo "Minoca OS Installer Revision $REVISION.
  59. Created: $DATE
  60. Flavor: $DEBUG" > $WORKING/readme.txt
  61. cat >> $WORKING/readme.txt <<"_EOF"
  62. Website: www.minocacorp.com
  63. Contact Minoca at: info@minocacorp.com
  64. Minoca OS is a leading-edge, highly customizable, general purpose operating
  65. system. It features application level functionality such as virtual memory,
  66. networking, and POSIX compatibility, but at a significantly reduced image and
  67. memory footprint. Unique development, debugging, and real-time profiling tools
  68. make getting to the bottom of issues straightforward and easy. Direct support
  69. from the development team behind Minoca OS simplifies the process of creating
  70. OS images tailored to your application, saving on engineering resources and
  71. development time. Minoca OS is a one-stop shop for systems-level design.
  72. For a more detailed getting started guide, head to
  73. http://www.minocacorp.com/documentation/getting-started
  74. What is this?
  75. =============
  76. This archive contains the generic installation images and setup command line
  77. app for creating custom images of Minoca OS. If you're looking to simply get
  78. a quick bootable image of Minoca OS on a particular platform, this is not the
  79. archive for you. Go download one of our prebuilt images, available for each
  80. supported platform Minoca runs on.
  81. Inside the archive are installation images for each supported processor
  82. architecture. The Minoca native setup program for that architecture is also in
  83. that architecture directory. If you're running setup on Minoca to install
  84. Minoca, use the native setup programs.
  85. Additionally there is a setup command line tool for Windows. Use this if you'd
  86. like to install Minoca onto a removable disk from Windows. It is also possible
  87. to install directly onto your host system. Make sure to create a backup before
  88. trying to create a dual boot scenario. Currently the setup program will
  89. install its own MBR, blowing away the capability to boot back into Windows
  90. without a rescue disk. We recommend installing to removable media (such as a
  91. USB disk or SD card), a blank disk, or a disk file (for use with a VM).
  92. How do I use it?
  93. ================
  94. Run msetup with no arguments to get a list of available installation locations,
  95. including enumerated disks and partitions on the local machine. Use
  96. msetup --help to get a list of command line options and ways to specialize your
  97. image. You can install directly to a removable disk using its device ID number
  98. (eg. msetup -vD -d0x10000).
  99. Example
  100. =======
  101. C:\Users\Evan\Downloads\Minoca-Installer-1341>msetup
  102. Unable to detect platform name.
  103. No destination was specified. Please select one from the following list.
  104. Setup found 6 devices:
  105. DiskId PartID DevType Fmt Type Offset Size Path
  106. ----------------------------------------------------------------------------
  107. CB2C1753 00000000 Disk MBR 0 931G Device 0x0
  108. CB2C1753 00000001 Partition MBR B NTFS 1.0M 100M Device 0x1
  109. CB2C1753 00000002 Partition MBR NTFS 101M 931G Device 0x2
  110. 444A2245 00000000 Disk MBR 0 29G Device 0x10000
  111. 444A2245 00000001 Partition MBR B FAT16 1.0M 10M Device 0x10001
  112. 444A2245 00000000 Partition MBR Minoca 11M 501M Device 0x10002
  113. C:\Users\Evan\Downloads\mbin\Minoca-Installer-1341>msetup -i armv7\install.img -v -l beagleboneblack -D -d0x10000
  114. License
  115. =======
  116. The contents of this archive are licensed under the Creative Commons
  117. Non-Commercial Share-Alike license, which can be found at
  118. http://creativecommons.org/licenses/by-nc-sa/4.0/
  119. Contact
  120. =======
  121. Contact info@minocacorp.com with any questions or concerns.
  122. _EOF
  123. ##
  124. ## Create the archive.
  125. ##
  126. ARCHIVE="Minoca-Installer-$REVISION.zip"
  127. 7za a -tzip -mmt -mx9 -mtc "$ARCHIVE" $WORKING/*
  128. FILE_SIZE=`ls -l $ARCHIVE | \
  129. sed -n 's/[^ ]* *[^ ]* *[^ ]* *[^ ]* *\([0123456789]*\).*/\1/p'`
  130. if test -n "$MBUILD_STEP_ID"; then
  131. python $SRCROOT/client.py --result "$ARCHIVE Size" integer "$FILE_SIZE"
  132. python $SRCROOT/client.py --upload schedule $ARCHIVE $ARCHIVE
  133. echo Uploaded file $ARCHIVE, size $FILE_SIZE
  134. fi
  135. echo "Removing $WORKING"
  136. rm -rf "$WORKING"
  137. echo "Done creating installer archive."