mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2025-01-23 11:09:41 -05:00
build: image: Add support for EXT2 and EXT3 file-systems.
* gnu/build/image.scm (make-ext4-image): Rename to ... (make-ext-image): ... it, and pass the file-system type to mke2fs, (make-partition-image): Adapt to call "make-ext-image" if the partition file-system is prefixed by "ext".
This commit is contained in:
parent
1b4fa7851b
commit
16f9124d1f
1 changed files with 10 additions and 8 deletions
|
@ -63,16 +63,18 @@ (define (estimate-partition-size root)
|
|||
take the partition metadata size into account, take a 25% margin."
|
||||
(* 1.25 (file-size root)))
|
||||
|
||||
(define* (make-ext4-image partition target root
|
||||
#:key
|
||||
(owner-uid 0)
|
||||
(owner-gid 0))
|
||||
"Handle the creation of EXT4 partition images. See 'make-partition-image'."
|
||||
(define* (make-ext-image partition target root
|
||||
#:key
|
||||
(owner-uid 0)
|
||||
(owner-gid 0))
|
||||
"Handle the creation of EXT2/3/4 partition images. See
|
||||
'make-partition-image'."
|
||||
(let ((size (partition-size partition))
|
||||
(fs (partition-file-system partition))
|
||||
(label (partition-label partition))
|
||||
(uuid (partition-uuid partition))
|
||||
(options "lazy_itable_init=1,lazy_journal_init=1"))
|
||||
(invoke "mke2fs" "-t" "ext4" "-d" root
|
||||
(invoke "mke2fs" "-t" fs "-d" root
|
||||
"-L" label "-U" (uuid->string uuid)
|
||||
"-E" (format #f "root_owner=~a:~a,~a"
|
||||
owner-uid owner-gid options)
|
||||
|
@ -105,8 +107,8 @@ (define* (make-partition-image partition-sexp target root)
|
|||
(let* ((partition (sexp->partition partition-sexp))
|
||||
(type (partition-file-system partition)))
|
||||
(cond
|
||||
((string=? type "ext4")
|
||||
(make-ext4-image partition target root))
|
||||
((string-prefix? "ext" type)
|
||||
(make-ext-image partition target root))
|
||||
((string=? type "vfat")
|
||||
(make-vfat-image partition target root))
|
||||
(else
|
||||
|
|
Loading…
Reference in a new issue