diff options
| author | Danny Milosavljevic <dannym@scratchpost.org> | 2017-07-03 13:10:43 +0200 |
|---|---|---|
| committer | Danny Milosavljevic <dannym@scratchpost.org> | 2017-07-03 15:07:25 +0200 |
| commit | 1feb3076cb30e0c1ce1cf435b859e515b0e1c574 (patch) | |
| tree | 3e2a95cb6a5a40da696e90bec3ef1188fadbb64a /gnu/build | |
| parent | 1ec0c1f30ee93bd4224cffe0afb4be54fe8c3eb0 (diff) | |
build: Allow specifying volume-uuid with make-iso9660-image.
* gnu/build/file-systems.scm (iso9660-uuid->string): Export.
* gnu/build/vm.scm (make-iso9660-image): Add volume-uuid.
Diffstat (limited to 'gnu/build')
| -rw-r--r-- | gnu/build/file-systems.scm | 1 | ||||
| -rw-r--r-- | gnu/build/vm.scm | 19 |
2 files changed, 15 insertions, 5 deletions
diff --git a/gnu/build/file-systems.scm b/gnu/build/file-systems.scm index 16160a659b1..b6930497d65 100644 --- a/gnu/build/file-systems.scm +++ b/gnu/build/file-systems.scm | |||
| @@ -48,6 +48,7 @@ | |||
| 48 | string->ext3-uuid | 48 | string->ext3-uuid |
| 49 | string->ext4-uuid | 49 | string->ext4-uuid |
| 50 | string->btrfs-uuid | 50 | string->btrfs-uuid |
| 51 | iso9660-uuid->string | ||
| 51 | 52 | ||
| 52 | bind-mount | 53 | bind-mount |
| 53 | 54 | ||
diff --git a/gnu/build/vm.scm b/gnu/build/vm.scm index 860c98346da..4239bc2fba2 100644 --- a/gnu/build/vm.scm +++ b/gnu/build/vm.scm | |||
| @@ -353,18 +353,27 @@ SYSTEM-DIRECTORY is the name of the directory of the 'system' derivation." | |||
| 353 | (error "failed to create GRUB EFI image")))) | 353 | (error "failed to create GRUB EFI image")))) |
| 354 | 354 | ||
| 355 | (define* (make-iso9660-image grub config-file os-drv target | 355 | (define* (make-iso9660-image grub config-file os-drv target |
| 356 | #:key (volume-id "GuixSD")) | 356 | #:key (volume-id "GuixSD") (volume-uuid #f)) |
| 357 | "Given a GRUB package, creates an iso image as TARGET, using CONFIG-FILE as | 357 | "Given a GRUB package, creates an iso image as TARGET, using CONFIG-FILE as |
| 358 | Grub configuration and OS-DRV as the stuff in it." | 358 | Grub configuration and OS-DRV as the stuff in it." |
| 359 | (let ((grub-mkrescue (string-append grub "/bin/grub-mkrescue"))) | 359 | (let ((grub-mkrescue (string-append grub "/bin/grub-mkrescue"))) |
| 360 | (mkdir-p "/tmp/root/var/run") | 360 | (mkdir-p "/tmp/root/var/run") |
| 361 | (mkdir-p "/tmp/root/run") | 361 | (mkdir-p "/tmp/root/run") |
| 362 | (unless (zero? (system* grub-mkrescue "-o" target | 362 | (unless (zero? (apply system* |
| 363 | (string-append "boot/grub/grub.cfg=" config-file) | 363 | `(,grub-mkrescue "-o" ,target |
| 364 | (string-append "gnu/store=" os-drv "/..") | 364 | ,(string-append "boot/grub/grub.cfg=" config-file) |
| 365 | ,(string-append "gnu/store=" os-drv "/..") | ||
| 365 | "var=/tmp/root/var" | 366 | "var=/tmp/root/var" |
| 366 | "run=/tmp/root/run" | 367 | "run=/tmp/root/run" |
| 367 | "--" "-volid" (string-upcase volume-id))) | 368 | "--" |
| 369 | "-volid" ,(string-upcase volume-id) | ||
| 370 | ,@(if volume-uuid | ||
| 371 | `("-volume_date" "uuid" | ||
| 372 | ,(string-filter (lambda (value) | ||
| 373 | (not (char=? #\- value))) | ||
| 374 | (iso9660-uuid->string | ||
| 375 | volume-uuid))) | ||
| 376 | `())))) | ||
| 368 | (error "failed to create ISO image")))) | 377 | (error "failed to create ISO image")))) |
| 369 | 378 | ||
| 370 | (define* (initialize-hard-disk device | 379 | (define* (initialize-hard-disk device |
