build-for-release 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. #! /bin/bash -
  2. # Specific script for the final Dragora release process.
  3. #
  4. # Copyright (c) 2021-2022 Matias Fonzo, <selk@dragora.org>.
  5. #
  6. # Licensed under the Apache License, Version 2.0 (the "License");
  7. # you may not use this file except in compliance with the License.
  8. # You may obtain a copy of the License at
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. # Unless required by applicable law or agreed to in writing, software
  13. # distributed under the License is distributed on an "AS IS" BASIS,
  14. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. # See the License for the specific language governing permissions and
  16. # limitations under the License.
  17. #
  18. ## ChangeLog (current version is 0.2).
  19. #
  20. #= Version 0.3:
  21. #
  22. # - Use the -f (force) option when building on the phase1.
  23. #
  24. #= Version 0.2:
  25. #
  26. # - Switch /bin/sh to /bin/bash for catching errors on pipes.
  27. #
  28. # - Upgrade packages on 'phase-2' to ensure no dependency on
  29. # /tools (temporary system) or to ensure possible system
  30. # breaks by cutting symbolic links using qi/graft.
  31. #
  32. #= Version 0.1:
  33. #
  34. # - Initial version.
  35. #
  36. set -e -o pipefail
  37. rm -f /build-phase1-log.txt /build-phase2-log.txt
  38. #
  39. # Build all the packages to conform the final system.
  40. #
  41. echo ""
  42. echo "*** Building Dragora for release [phase-1]..."
  43. echo ""
  44. echo "Using 1 parallel job for the compiler."
  45. echo ""
  46. qi order /usr/src/qi/recipes/*.order | \
  47. qi build -f -j1 -p -i - 2>&1 | tee build-phase1-log.txt
  48. #
  49. # Build all the important packages against the final system
  50. #
  51. # Variables.
  52. #
  53. # Parallel jobs for the final system (phase-2)
  54. #
  55. # The default is to use the maximum number of
  56. # processors (physical/threading)
  57. JOBS="${JOBS:-$(nproc)}"
  58. # Declare recipes that do not require reconstruction:
  59. exclude_list='!/pass-?|^data\/|docbook\/|xorg\/doc\/|xorg\/font\/|tde\/tde-i18n|devel\/fortify-headers|kernel\/headers|kernel\/generic|kernel\/buildtree-generic|kernel\/firmware|tools\/dragora-installer/'
  60. echo ""
  61. echo "*** Building Dragora for release [phase-2]..."
  62. echo ""
  63. echo "Using $JOBS parallel job(s) for the compiler."
  64. echo ""
  65. if test -d /tools
  66. then
  67. mv -f /tools /tools-to-be-renamed
  68. sync
  69. fi
  70. qi order /usr/src/qi/recipes/*.order | awk "$exclude_list" | \
  71. qi build -f -j${JOBS} -p -u - 2>&1 | tee build-phase2-log.txt
  72. unset -v JOBS exclude_list
  73. if test -d /tools-to-be-renamed
  74. then
  75. mv -f /tools-to-be-renamed /tools
  76. sync
  77. fi
  78. echo ""
  79. echo "^^^ Done."
  80. echo ""