| 1 | Description: fix autopkgtest failure on 32-bit architectures |
| 2 | The memory calculation system may erroneously attribute far more memory than |
| 3 | is addressable on 32-bit platforms. This adjustment makes sure the calculated |
| 4 | amount of RAM is capped appropriately on such platforms. |
| 5 | Author: Étienne Mollier <[email protected]> |
| 6 | Forwarded: no |
| 7 | Last-Update: 2021-10-06 |
| 8 | --- |
| 9 | This patch header follows DEP-3: http://dep.debian.net/deps/dep3/ |
| 10 | --- bbmap.orig/calcmem.sh |
| 11 | +++ bbmap/calcmem.sh |
| 12 | @@ -209,6 +209,11 @@ |
| 13 | # available (ram - 500k) * 85% / 1024kb = megs of ram to use |
| 14 | # not sure where this formula came from |
| 15 | RAM=$(( ((x-500000)*mult/100)/1024 )) |
| 16 | + # cap to 2.2GiB on 32bit systems |
| 17 | + if [ "$(dpkg-architecture -qDEB_HOST_ARCH_BITS)" = 32 ] \ |
| 18 | + && [ "$RAM" -gt "2000" ] |
| 19 | + then RAM="2000" |
| 20 | + fi |
| 21 | #echo $RAM |
| 22 | fi |
| 23 | #local z="-Xmx${RAM}m" |