@@ -57,30 +57,10 @@ sw-description attribute overrides the key file's IV for one specific image.
Encryption of UBI volumes
-------------------------
-Due to a limit in the Linux kernel api for UBI volumes, the size reserved to be
-written on disk should be declared before actually write anything.
-Unfortunately, the size of an encrypted image is not know until the complete
-decryption, thus preventing to correctly declare the size of the file to be
-written on disk.
+Due to a limit in the Linux kernel API for UBI volumes, the size reserved to be
+written on disk should be declared before actually writing anything.
-For this reason UBI images can declare the special property "decrypted-size" like
-this:
-
-::
-
- images: ( {
- filename = "rootfs.ubifs.enc";
- volume = "rootfs";
- encrypted = true;
- ivt = "65D793B87B6724BB27954C7664F15FF3";
- properties = {decrypted-size = "104857600";}
- }
- );
-
-The real size of the decrypted image should be calculated and written to the
-sw-description before assembling the cpio archive.
-In this example, 104857600 is the size of the rootfs after the decryption: the
-encrypted size is by the way larger.
+See the property "decrypted-size" in UBI Volume Handler's documentation.
Example sw-description with Encrypted Image
-------------------------------------------
@@ -98,6 +78,7 @@ setting.
filename = "core-image-full-cmdline-beaglebone.ext3.enc";
device = "/dev/mmcblk0p3";
encrypted = true;
+ ivt = "65D793B87B6724BB27954C7664F15FF3";
}
);
}
@@ -228,6 +228,44 @@ should be used with property ``auto-resize``.
}
}
+size properties
+...............
+Due to a limit in the Linux kernel API for UBI volumes, the size reserved to be
+written on disk should be declared before actually writing anything.
+Unfortunately, the size of an encrypted or compressed image is not known until
+the decryption or decompression finished. This prevents correct declaration of
+the file size to be written on disk.
+
+For this reason UBI images can declare the special properties "decrypted-size"
+or "decompressed-size" like this:
+
+::
+
+ images: ( {
+ filename = "rootfs.ubifs.enc";
+ volume = "rootfs";
+ encrypted = true;
+ properties: {
+ decrypted-size = "104857600";
+ }
+ },
+ {
+ filename = "homefs.ubifs.gz";
+ volume = "homefs";
+ properties: {
+ decompressed-size = "420000000";
+ }
+ }
+ );
+
+The real size of the image should be calculated and written to the
+sw-description before assembling the cpio archive.
+In this example, 104857600 is the size of the rootfs after the decryption: the
+encrypted size is by the way larger. The decompressed size is of the homefs is
+420000000.
+
+The sizes are bytes in decimal notation.
+
Lua Handlers
------------