Project

General

Profile

Actions

Bug #526

closed

bug in /etc/rc.php_ini_setup

Added by Ganbold Ts over 14 years ago. Updated over 14 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Start date:
04/19/2010
Due date:
% Done:

0%

Estimated time:
Plus Target Version:
Release Notes:
Affected Version:
2.0
Affected Architecture:

Description

There looks like bug in /etc/rc.php_ini_setup.
Faulty code is:

  1. Grab amount of memory that is detected
    if [ -f /var/log/dmesg.boot ]; then
    AVAILMEM=`/bin/cat /var/log/dmesg.boot |/usr/bin/awk '/avail memory/ { print $5 }'| sed 's/(//g'|tail -1`
    else
    AVAILMEM=`/sbin/dmesg -a |/usr/bin/awk '/avail memory/ { print $5 }'| sed 's/(//g'|tail -1`
    fi

Above code produces following output in RouterStation Pro:

[2.0-BETA1][]/root(2): /bin/cat /var/log/dmesg.boot |/usr/bin/awk '/avail memory/ { print $5 }'| sed 's/(//g'|tail -1
118MB)

Old code still works without a problem:

[2.0-BETA1][]/root(3): cat /var/log/dmesg.boot | grep "memory" | grep "avail" | awk '{ print $5 }' | cut -d'(' -f2 | cut -d'M' -f1
118

Actions #1

Updated by Chris Buechler over 14 years ago

  • Target version set to 2.0
  • Affected Version set to 2.0
Actions #2

Updated by Seth Mos over 14 years ago

  • Status changed from New to Feedback

Changed the used awk function to use the byte value and calculate from there.

Alternatively. Provide the strong from

dmesg|grep "avail memory" 

Actions #3

Updated by Ganbold Ts over 14 years ago

works here.

beastie# /bin/cat /var/run/dmesg.boot | /usr/bin/awk '/avail memory/ { memory=($4 / 1048576); printf("%0.0f\n", memory); exit}'
1937
beastie# /sbin/dmesg -a |/usr/bin/awk '/avail memory/ { memory=($4 / 1048576); printf("%0.0f\n", memory); exit}'
1937

It can be closed.

Actions #4

Updated by Chris Buechler over 14 years ago

  • Status changed from Feedback to Resolved
Actions

Also available in: Atom PDF