OE info Script

From wiki.emacinc.com
Revision as of 15:30, 8 December 2015 by Jjung (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
TODO: {{#todo: Review (12.08.2015-12:26->JJ+)|Jeffrey Jung|OE 5.0,JJ,MD,MG, Review}}

This page will explain the standard operations of the /usr/bin/oe_info.sh script, as well as its other capabilities.

Background

Provided in all EMAC systems is a executable /usr/bin/oe_info.sh that will display various amounts of information ranging from the version of the filesystem to presenting real-time memory utilization.

General Information

The default operation of the script is to provide information about the system. This includes:

  • Name of the device
  • Device serial number
  • Bootstrap
  • Bootloader Version
  • Kernel version
  • Filesystem version

The output of the script will be saved to the text file /etc/oe_info, but only if the file system has been mounted with write permissions. To do this, simply run root@som9x25:~# mount -o remount,rw / before invoking the oe_info script.

The contents of the /etc/oe_info file will be written in, line-by-line, to /www/pages/oe_info.html. This html document is part of the web server provided on all EMAC devices. To access the page, connect the device to a network and determine its IP address. Enter the IP address to a web browser on the same network and you'll be brought to the homepage of the web server. Go to the OE_INFO tab to view the content of /etc/oe_info within the web browser. If there was an error reading from /etc/oe_info, then the webpage will display an empty box.
Here is an example of what the default, no options passed, output of the script looks like:

root@ipac9x25:~# /usr/bin/oe_info.sh

#################################################### ####################################################
Gathering build information...
Product: ipac9x25 Serial Number: R078000001
Bootstrap: AT91Bootstrap 3.5.3
Bootloader Part# U-Boot 2014.07emac-standard Bootloader Ver#: U-Boot 2014.07emac-standard
Kernel Part#: 3.10.0-emac-standard+c0218784c0 Kernel Ver#: 3.10.0-emac-standard+c0218784c0
Filesystem Part#: Standard image Filesystem Ver#: 5.0.3

#################################################### ####################################################

root@ipac9x25:~#


OE Info Script

Usage of the script is as follows:

/usr/bin/oe_info.sh [option]

Only one option will be evaluated and there are no parameters for these options. For example, running root@som9x25:~# /usr/bin/oe_info.sh -cn will only evaluate c as the option. Similarly, root@som9x25:~# /usr/bin/oe_info.sh -c 123 will not account for 123 as a parameter and just execute with the c option. These options are explained in the following section.

Options

The script allows for -c, -f, -h, -m, -n, -v as options and to be only identified by a single dash ('-'). An invalid option or improper amount of dashes will yield an error and display the proper usage with a list of valid options. When an option is given, the script will perform the desired task and then exit. The system information presented when no option given will not be shown and the /www/pages/oe_info.html will not be updated.

-c, CPU Infomation

This will display the number of CPU cores and threads, the chip architecture with the model name, real-time CPU utilization, and CPU clock speed.

root@ipac9x25:~# /usr/bin/oe_info.sh -c

CPU info:
BogoMIPS : 198.76 Architecture: ARM, Atmel AT91SAM (Device Tree) Number of CPUs: 1 core(s) CPU Utilization: 0.5% Clock speed: 400 MHz

root@ipac9x25:~#


-f, Flash Information

The -f option will show how much space is used and available on the filesystem and display a list of partitions on the system.

root@ipac9x25:~# /usr/bin/oe_info.sh -f

Flash Info:
Filesystem Size Used Available Use% Mounted on /dev/root 922.7M 71.6M 787.4M 8% / devtmpfs 60.9M 4.0K 60.9M 0% /dev /dev/mmcblk0p2 2.5G 4.0M 2.3G 0% /home

tmpfs 61.0M 172.0K 60.9K 0% /run tmpfs 61.0M 28.0K 61.0M 0% /var/volatile
Partitions: major minor #blocks name 31 0 16384 mtdblock0 179 0 3694592 mmcblk0 179 1 976600 mmcklk0p1 179 2 2717984 mmcblk0p2 179 16 16384 mmcblk0boot1 179 8 16384 mmcblk0boot0

root@ipac9x25:~#

-m, Memory Information

Show the total, used, and free memory of the system.

root@ipac9x25:~# /usr/bin/oe_info.sh -m

Memory Info:
Total: 122M Used: 15M Free: 82M

root@ipac9x25:~#

-n, Network Information

For every site connected to a network, its IP address, netmask, gateway, hostname and MAC address will be displayed.

root@ipac9x25:~# /usr/bin/oe_info.sh -n

Network Info:
Connection at eth0 IP address: 10.03.146 Netmask: 255.255.0.0 Gateway: 10.0.2.1 Hostname: ipac9x25 MAC address: 40:D8:55:19:DC:C4
Connection at wlan0 IP address: 10.0.4.148 Netmask: 255.255.0.0 Gateway: 10.0.2.1 Hostname: ipac9x25 MAC address: A8:54:B2:42:89:8D

root@ipac9x25:~#


-v, Invoke All Options

The -v option will act as if repeatedly running the script with c, f, m, n options.

root@som9x25:~# /usr/bin/oe_info.sh -v

CPU info
BogoMIPS : 198.76 Architecture: ARM, Atmel AT91SAM (Device Tree) Number of CPUs: 1 core(s) CPU Utilization: 0.4 % Clock speed: error reading cpuinfo and dmesg for clock speed
Flash Info:
Filesystem Size Used Available Use% Mounted on /dev/root 922.7M 71.6M 787.4M 8% / devtmpfs 60.9M 4.0K 60.9M 0% /dev /dev/mmcblk0p2 2.5G 4.0M 2.3G 0% /home tmpfs 61.0M 172.0K 60.9M 0% /run tmpfs 61.0M 28.0K 61.0M 0% /var/volatile
Partitions: major minor #blocks name
31 0 16384 mtdblock0 179 0 3694592 mmcblk0 179 1 976600 mmcblk0p1 179 2 2717984 mmcblk0p2 179 16 16384 mmcblk0boot1 179 8 16384 mmcblk0boot0
Memory Info:
Total: 122M Used: 15M Free: 82M
Network Info:
Connection at eth0 IP address: 10.0.3.146 Netmask: 255.255.0.0 Gateway: 10.0.2.1 Hostname: ipac9x25 MAC address: 40:D8:55:19:DC:C4
Connection at wlan0 IP address: 10.0.4.148 Netmask: 255.255.0.0 Gateway: 10.0.2.1 Hostname: ipac9x25 MAC address: A8:54:B2:42:89:8D

root@ipac9x25:~#

-h, Help

Display the usage of the script and list the options and their descriptions.

root@ipac9x25:~# /usr/bin/oe_info.sh -h

USAGE:

oe_info.sh [option]

OPTIONS:

-c show cpu info
Display number of CPUs, BogoMIPS, chip arhitecture, CPU utilization, and CPU clock speed
-f flash info
Shows how much space is used and available on the filesystem and provides a list of
partitions found int /proc/partitions
-m show memory info
Display space used and available in main memory
-n network info
-v invoke all options above
-h display usage and options list
root@ipac9x25:~#


Conclusion

This script is a very useful tool when wanting to know specific information quickly. Instead of looking within the print out of ifconfig to determine the IP address, oe_info.sh can present this information in an easier to read mannor

Further Information

Where to Go Next
  • Not really sure what would be good to include here.
Pages with Related Content
  • Not really sure what would be good to include here.