pengutronix / genimage

tool to generate multiple filesystem and flash images from a tree
GNU General Public License v2.0
308 stars 110 forks source link

Usage example for existing partition image + second partition contents #55

Closed swltr closed 5 years ago

swltr commented 5 years ago

Maybe I'm missing something, but it's not clear to me how to use genimage in cases in which the image file for one partition is given and the image for a second partition should be created by genimage. In my case, I have an image file (rootfs.ext2) containing the ext3 file system for / (generated by Buildroot), and a directory containing the files that should go into /home in a separate partition.

From the documentation and examples I have read so far, I imagine it should look similar to this:

image compactflash.img {
  hdimage {
  }

  partition root {
    partition-type = 0x83
    bootable = true
    # An existing image of the partition's file system.
    image = "rootfs.ext2"
  }

  partition home {
    partition-type = 0x83
    image = "home.ext3"
    size = 1500M
  }
}

image home.ext3 {
  ext3 {
    label = "home"
  }

  name = "home"
  size = 1500M
  mountpoint = "/home"
}

Is this the proper way to do it? I understand mountpoint is relative to the configured rootpath. Where does genimage expect the file rootfs.ext2, though?

michaelolbrich commented 5 years ago

You don't need to specify the partition size if it is the same as the image size. And the mountpoint is only needed if $rootpath/$mountpoint actually contains something.

Existing input images are located in the configured inputpath or use an absolute path for the filename.