Hi Andreas,

Ah, so my `(use-modules)` needed A, not B.
Ie the `image` form is coming from `gnu.image`, not `gnu.system.image`.
But then what is the difference between these two modules?
When would I use `gnu.system.image` instead of `gnu.image`?

A. (gnu image)
B. (gnu system image)

Either way, I've gotten a step further.
But I've run across another problem building a Qemu VM image.
The vm definition in C gives me the error in D. Anything that I'm missing?

C
(use-modules (gnu)
             (gnu image)
             (gnu system vm)
             (gnu system)
             (gnu system file-systems))

(load "system.scm")

(define (boot-partition size)
  (file-system
     (mount-point "/boot")
     (device "/dev/vda1")
     (type "ext4")))

(define (root-partition size)
  (file-system
     (mount-point "/")
     (device "/dev/vda1")
     (type "ext4")))

(define vm-image
  (image
   (operating-system physical-operating-system)
   (format 'compressed-qcow2)
   (size (* 10 (expt 2 30)))
   (partitions
    (list (boot-partition (* 1 (expt 2 30)))
          (root-partition (* 9 (expt 2 30)))))))

vm-image


D
$ guix system image -t qcow2 vm.scm
Backtrace:
In guix/status.scm:
    859:3 19 (_)
    839:4 18 (call-with-status-report _ _)
In guix/scripts/system.scm:
   1318:4 17 (_)
In ice-9/boot-9.scm:
  1752:10 16 (with-exception-handler _ _ #:unwind? _ # _)
In guix/store.scm:
   689:37 15 (thunk)
   1330:8 14 (call-with-build-handler #<procedure 7f8e82ced090 at g…> …)
  2210:25 13 (run-with-store #<store-connection 256.100 7f8e7e2b0910> …)
In guix/scripts/system.scm:
    858:2 12 (_ _)
In guix/store.scm:
  2038:13 11 (_ #<store-connection 256.100 7f8e7e2b0910>)
In guix/gexp.scm:
   300:51 10 (_)
In unknown file:
           9 (with-fluids* (#<fluid 7f8e94df84a0>) (#f) #<procedure …>)
In guix/gexp.scm:
   750:29  8 (_)
In gnu/system/image.scm:
  1010:15  7 (_)
   943:32  6 (operating-system-for-image #<<image> name: #f format: …>)
   892:28  5 (image->root-file-system #<<image> name: #f format: com…>)
    349:6  4 (find-root-partition _)
In srfi/srfi-1.scm:
   730:15  3 (find #<procedure root-partition? (partition)> _)
In gnu/system/image.scm:
   345:16  2 (root-partition? #<<file-system> device: "/dev/vda1" mo…>)
In ice-9/boot-9.scm:
  1685:16  1 (raise-exception _ #:continuable? _)
  1685:16  0 (raise-exception _ #:continuable? _)

ice-9/boot-9.scm:1685:16: In procedure raise-exception:
In procedure partition-flags: Wrong type argument: #<<file-system> device:
"/dev/vda1" mount-point: "/boot" type: "ext4" flags: () options: #f mount?:
#t mount-may-fail?: #f needed-for-boot?: #f check?: #t
skip-check-if-clean?: #t repair: preen create-mount-point?: #f
dependencies: () shepherd-requirements: () location: ((filename .
"/home/twashing/dotfiles/vm.scm") (line . 44) (column . 2))>

Tim


On Mon, 9 Dec 2024 at 04:27, Andreas Enge <andr...@enge.fr> wrote:

> Hello Tim,
>
> Am Sun, Dec 08, 2024 at 07:29:47PM -0500 schrieb Timothy Washington:
> > (define vm-image
> >   (image
> >    (operating-system physical-operating-system)
> >    (format qcow2-image-type)
> >    (size (* 10 (expt 2 30)))))
>
> looking at the code, I see this in gnu/image.scm:
> (define-record-type* <image>
>   image make-image
>   image?
>   (name               image-name ;symbol
>                       (default #false))
>   (format             image-format                ;symbol
>                       (sanitize validate-image-format))
> ...
>
> and a bit above:
> ;; The supported image formats.
> (define-set-sanitizer validate-image-format format
>   (disk-image compressed-qcow2 docker iso9660 tarball wsl2))
>
> So my guess is that 'compressed-qcow2 would be the value to put there.
>
> Andreas
>
>

Reply via email to