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.

86 lines
2.9 KiB

  1. ;;; GNU Guix --- Functional package management for GNU
  2. ;;; Copyright © 2020 Mathieu Othacehe <m.othacehe@gmail.com>
  3. ;;;
  4. ;;; This file is part of GNU Guix.
  5. ;;;
  6. ;;; GNU Guix is free software; you can redistribute it and/or modify it
  7. ;;; under the terms of the GNU General Public License as published by
  8. ;;; the Free Software Foundation; either version 3 of the License, or (at
  9. ;;; your option) any later version.
  10. ;;;
  11. ;;; GNU Guix is distributed in the hope that it will be useful, but
  12. ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
  13. ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. ;;; GNU General Public License for more details.
  15. ;;;
  16. ;;; You should have received a copy of the GNU General Public License
  17. ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  18. (define-module (gnu image)
  19. #:use-module (guix records)
  20. #:export (partition
  21. partition?
  22. partition-device
  23. partition-size
  24. partition-offset
  25. partition-file-system
  26. partition-file-system-options
  27. partition-label
  28. partition-uuid
  29. partition-flags
  30. partition-initializer
  31. image
  32. image-name
  33. image-format
  34. image-target
  35. image-size
  36. image-operating-system
  37. image-partitions
  38. image-compression?
  39. image-volatile-root?
  40. image-substitutable?))
  41. ;;;
  42. ;;; Partition record.
  43. ;;;
  44. (define-record-type* <partition> partition make-partition
  45. partition?
  46. (device partition-device (default #f))
  47. (size partition-size)
  48. (offset partition-offset (default 0))
  49. (file-system partition-file-system (default "ext4"))
  50. (file-system-options partition-file-system-options
  51. (default '()))
  52. (label partition-label (default #f))
  53. (uuid partition-uuid (default #f))
  54. (flags partition-flags (default '()))
  55. (initializer partition-initializer (default #f)))
  56. ;;;
  57. ;;; Image record.
  58. ;;;
  59. (define-record-type* <image>
  60. image make-image
  61. image?
  62. (name image-name ;symbol
  63. (default #f))
  64. (format image-format) ;symbol
  65. (target image-target
  66. (default #f))
  67. (size image-size ;size in bytes as integer
  68. (default 'guess))
  69. (operating-system image-operating-system ;<operating-system>
  70. (default #f))
  71. (partitions image-partitions ;list of <partition>
  72. (default '()))
  73. (compression? image-compression? ;boolean
  74. (default #t))
  75. (volatile-root? image-volatile-root? ;boolean
  76. (default #t))
  77. (substitutable? image-substitutable? ;boolean
  78. (default #t)))