image: Add partition offset support.
* gnu/image.scm (partition-offset): New procedure, (<partition>)[offset]: new field. * gnu/system/image.scm (system-disk-image): Apply the partition offset.
This commit is contained in:
		
							parent
							
								
									edb0366c16
								
							
						
					
					
						commit
						1b4fa7851b
					
				
					 2 changed files with 10 additions and 2 deletions
				
			
		| 
						 | 
					@ -22,6 +22,7 @@
 | 
				
			||||||
            partition?
 | 
					            partition?
 | 
				
			||||||
            partition-device
 | 
					            partition-device
 | 
				
			||||||
            partition-size
 | 
					            partition-size
 | 
				
			||||||
 | 
					            partition-offset
 | 
				
			||||||
            partition-file-system
 | 
					            partition-file-system
 | 
				
			||||||
            partition-label
 | 
					            partition-label
 | 
				
			||||||
            partition-uuid
 | 
					            partition-uuid
 | 
				
			||||||
| 
						 | 
					@ -47,6 +48,7 @@
 | 
				
			||||||
  partition?
 | 
					  partition?
 | 
				
			||||||
  (device      partition-device (default #f))
 | 
					  (device      partition-device (default #f))
 | 
				
			||||||
  (size        partition-size)
 | 
					  (size        partition-size)
 | 
				
			||||||
 | 
					  (offset      partition-offset (default #f))
 | 
				
			||||||
  (file-system partition-file-system (default "ext4"))
 | 
					  (file-system partition-file-system (default "ext4"))
 | 
				
			||||||
  (label       partition-label (default #f))
 | 
					  (label       partition-label (default #f))
 | 
				
			||||||
  (uuid        partition-uuid (default #f))
 | 
					  (uuid        partition-uuid (default #f))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -243,11 +243,17 @@ used in the image."
 | 
				
			||||||
      ;; Return the genimage partition configuration for PARTITION.
 | 
					      ;; Return the genimage partition configuration for PARTITION.
 | 
				
			||||||
      (let ((label (partition-label partition))
 | 
					      (let ((label (partition-label partition))
 | 
				
			||||||
            (dos-type (partition->dos-type partition))
 | 
					            (dos-type (partition->dos-type partition))
 | 
				
			||||||
            (image (partition-image partition)))
 | 
					            (image (partition-image partition))
 | 
				
			||||||
 | 
					            (offset (partition-offset partition)))
 | 
				
			||||||
        #~(format #f "~/partition ~a {
 | 
					        #~(format #f "~/partition ~a {
 | 
				
			||||||
                                      ~/~/partition-type = ~a
 | 
					                                      ~/~/partition-type = ~a
 | 
				
			||||||
                                      ~/~/image = \"~a\"
 | 
					                                      ~/~/image = \"~a\"
 | 
				
			||||||
                                      ~/}"  #$label #$dos-type #$image)))
 | 
					                                      ~/~/offset = \"~a\"
 | 
				
			||||||
 | 
					                                      ~/}"
 | 
				
			||||||
 | 
					                  #$label
 | 
				
			||||||
 | 
					                  #$dos-type
 | 
				
			||||||
 | 
					                  #$image
 | 
				
			||||||
 | 
					                  #$(or offset 0))))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    (let* ((format (image-format image))
 | 
					    (let* ((format (image-format image))
 | 
				
			||||||
           (image-type (format->image-type format))
 | 
					           (image-type (format->image-type format))
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Reference in a new issue