Codebase list partman-auto / fbf2acf
Determine memory size for RAM-dependent recipe elements more accurately on i386 (LP: #604765). Colin Watson 12 years ago
2 changed file(s) with 22 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
0 partman-auto (100) UNRELEASED; urgency=low
1
2 * Merge from Ubuntu:
3 - Determine memory size for RAM-dependent recipe elements more
4 accurately on i386 (LP: #604765).
5
6 -- Colin Watson <[email protected]> Sun, 24 Jul 2011 15:54:13 +0100
7
08 partman-auto (99) unstable; urgency=low
19
210 * Add mipsel/loongson-2f recipes.
2626 unnamed=0
2727
2828 decode_recipe () {
29 local ignore ram line word min factor max fs iflabel label -
29 local ignore ram line word min factor max fs iflabel label map map_end -
3030 ignore="${2:+${2}ignore}"
3131 unnamed=$(($unnamed + 1))
32 ram=$(grep ^Mem: /proc/meminfo | { read x y z; echo $y; }) # in bytes
32 ram=
33 for map in /sys/firmware/memmap/*; do
34 [ -d "$map" ] || continue
35 if [ "$(cat $map/type)" = "System RAM" ]; then
36 map_start="$(printf %d "$(cat $map/start)")"
37 map_end="$(printf %d "$(cat $map/end)")"
38 ram="$(expr "${ram:-0}" + \
39 "$map_end" - "$map_start" + 1)"
40 fi
41 done
42 if [ -z "$ram" ]; then
43 ram=$(grep ^Mem: /proc/meminfo | { read x y z; echo $y; }) # in bytes
44 fi
3345 if [ -z "$ram" ]; then
3446 ram=$(grep ^MemTotal: /proc/meminfo | { read x y z; echo $y; })000
3547 fi