Add trim command to img2fwup-generated .fw files
This will probably be ignored for most uses of `img2fwup`, but it makes
people feel good who write to media that supports TRIM.
@@ -29,8 +29,12 @@ meta-author = "$USER"
file-resource img {
host-path = "${IMGFILE}"
}
+define-eval(IMG_BLOCKS, "(\${FWUP_SIZE_img} + 511) / 512")
task complete {
- on-resource img { raw_write(0) }
+ on-resource img {
+ trim(0, \${IMG_BLOCKS})
+ raw_write(0)
+ }
}
EOF
