makeISO 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #! /bin/sh -
  2. #
  3. # Creates packages ISO (from current directory)
  4. #
  5. # Copyright (c) 2019 Matias Fonzo, <selk@dragora.org>.
  6. #
  7. # Licensed under the Apache License, Version 2.0 (the "License");
  8. # you may not use this file except in compliance with the License.
  9. # You may obtain a copy of the License at
  10. #
  11. # http://www.apache.org/licenses/LICENSE-2.0
  12. #
  13. # Unless required by applicable law or agreed to in writing, software
  14. # distributed under the License is distributed on an "AS IS" BASIS,
  15. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16. # See the License for the specific language governing permissions and
  17. # limitations under the License.
  18. set -e
  19. GENISOIMAGE="${GENISOIMAGE:-genisoimage}"
  20. case $1 in
  21. i586)
  22. reflect_arch=i586
  23. exclude_path=x86_64
  24. ;;
  25. x86_64)
  26. reflect_arch=x86_64
  27. exclude_path=i586
  28. ;;
  29. *)
  30. echo "${0##*/}: it requires an argument 'i586' or 'x86_64' for the ISO" 1>&2
  31. exit 1;
  32. esac
  33. ISONAME="${ISONAME:-dragora-3.0_$(date +%Y%m%d)-${reflect_arch}-packages}"
  34. rm -f -v $ISONAME
  35. $GENISOIMAGE -v -o ${ISONAME}.iso \
  36. -A 'Dragora Packages' -V 'Dragora Packages' \
  37. -m '.keep' -m "${0##*/}" -m 'makeTags' \
  38. -x "dragora-*.iso*" -x $exclude_path \
  39. -R -J -U -hide-rr-moved -uid 0 -gid 0 \
  40. -root packages .
  41. echo "Making .sha256 sum for ${ISONAME}.iso ..."
  42. sha256sum ${ISONAME}.iso > ${ISONAME}.iso.sha256