Describe the bug
unsquashfs >= 4.7 fails on devices with less than 683MB RAM, breaking rauc info.
Background information
i.MX27 device with 128 MiB RAM
RAUC 1.15.1
unsquashfs 4.7.5
Yocto Wrynose
To Reproduce
Steps to reproduce the behavior:
- Copy a valid bundle to the target
- Run
rauc info on the bundle
Expected behavior
The usual output of rauc info
Logs
rauc info mybundle.raucb fails with
rauc-Message: 14:00:44.858: Using central status file /data/rauc.status
rauc-Message: 14:00:44.920: Using system config file /etc/rauc/system.conf
rauc-Message: 14:00:44.924: Reading bundle: mybundle.raucb
rauc-Message: 14:00:45.392: Verifying bundle signature...
rauc-Message: 14:00:51.959: Verified detached signature by '...'
Total memory requested is more than 75% of physical memory.
Unsquashfs uses memory to cache data from disk to optimise performance.
It is pointless to ask it to use more than this amount of memory, as this
causes thrashing and it is thus self-defeating.
FATAL ERROR: Requested memory size too large
Failed to extract manifest from bundle: Failed to run unsquashfs: Child process exited with code 1
Additional context
I've bisected the unsquashfs failure to a stricter check that was introduced in plougher/squashfs-tools@fc06653. The default for fragment_buffer_size and data_buffer_size is 256 each, so for the 75% check to pass, "physical memory" must be at least 683M. On my device unsquashfs calculates 116M.
The failure can be avoided by passing a smaller buffer size to unsquashfs with e.g., -mem 2. That is the minimal size it accepts and still works fine for retrieving the manifest.
Suggestions
One could
- add the
-mem 2 option to the hardcoded unsquashfs command line in rauc
- allow adding unsquashfs options in rauc.conf
- Remove the unsquashfs dependency and just mount the bundle instead
- leave it up to users to patch unsquashfs on affected devices.
Describe the bug
unsquashfs >= 4.7 fails on devices with less than 683MB RAM, breaking rauc info.
Background information
i.MX27 device with 128 MiB RAM
RAUC 1.15.1
unsquashfs 4.7.5
Yocto Wrynose
To Reproduce
Steps to reproduce the behavior:
rauc infoon the bundleExpected behavior
The usual output of
rauc infoLogs
rauc info mybundle.raucbfails withAdditional context
I've bisected the unsquashfs failure to a stricter check that was introduced in plougher/squashfs-tools@fc06653. The default for
fragment_buffer_sizeanddata_buffer_sizeis 256 each, so for the 75% check to pass, "physical memory" must be at least 683M. On my device unsquashfs calculates 116M.The failure can be avoided by passing a smaller buffer size to unsquashfs with e.g.,
-mem 2. That is the minimal size it accepts and still works fine for retrieving the manifest.Suggestions
One could
-mem 2option to the hardcoded unsquashfs command line in rauc