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

rauc files {} directive does not exclude files from rootpath #77

Closed thirtythreeforty closed 4 years ago

thirtythreeforty commented 5 years ago

When using a vfat image, I can add a files { ... } directive that overrides the mountpoint setting and only includes the specified files:

image boot.vfat {
  vfat {
    files = {
      zImage
    }
  }
}

But when I try the same thing with a rauc image, the generated bundle does not exclude rootpath files; rootfs.squashfs is alongside /bin, /etc, etc. This effectively doubles the size of the image.

image update.raucb {
  rauc {
    files = {
      rootfs.squashfs,
      boot.vfat,
    }
    manifest = "(snip)"
    key = "(snip)"
    cert = "(snip)"
  }
}

I can work around this behavior by running this configuration separate from all my other ones, and specifying an empty rootpath. But I expected files to work the same as in vfat. Is this intended behavior or a bug?

thirtythreeforty commented 5 years ago

If it's a bug, I'm happy to work on a fix. Just wanted to know if I'm holding it wrong.

michaelolbrich commented 5 years ago

I think you are correct. But I've not used this in a while. I'll talk to some more people to see what they think.

michaelolbrich commented 5 years ago

I got some feedback, and we all agreed, that you are correct. So a patch would be great. Either copy the files to tmpdir()/<something> or use mountpath() directly if no extra files are specified. Make sure the path is unique (maybe rauc-<image-name> or something like that, to ensure that creating two rauc bundles at the same time works as well.