@@ -15,6 +15,13 @@ SQUASHFS_EXCLUDE_DIRS ?= ""
SQUASHFS_CONTENT ?= "${PP_ROOTFS}"
SQUASHFS_CREATION_ARGS ?= ""
+SQUASHFS_THREADS ?= "${@oe.utils.cpu_count(at_least=2)}"
+SQUASHFS_THREADS[vardepvalue] = "1"
+# default according to mksquasfs docs
+SQUASHFS_MEMLIMIT ?= "7982M"
+SQUASHFS_DEFAULTS ?= "-mem ${SQUASHFS_MEMLIMIT} -processors ${SQUASHFS_THREADS}"
+SQUASHFS_DEFAULTS[vardepsexclude] += "SQUASHFS_MEMLIMIT SQUASHFS_THREADS"
+
python __anonymous() {
exclude_directories = d.getVar('SQUASHFS_EXCLUDE_DIRS').split()
if len(exclude_directories) == 0:
@@ -31,5 +38,5 @@ IMAGE_CMD:squashfs[depends] = "${PN}:do_transform_template"
IMAGE_CMD:squashfs() {
${SUDO_CHROOT} /bin/mksquashfs \
'${SQUASHFS_CONTENT}' '${IMAGE_FILE_CHROOT}' \
- -noappend ${SQUASHFS_CREATION_ARGS}
+ -noappend ${SQUASHFS_DEFAULTS} ${SQUASHFS_CREATION_ARGS}
}
This patch makes it possible to control the number of CPUs and the memory usage when generating a squashfs. The variable names used follow the imagetype variable scheme. Signed-off-by: Felix Moessbauer <felix.moessbauer@siemens.com> --- classes/squashfs.bbclass | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)