#! /bin/sh /usr/share/dpatch/dpatch-run
## All lines beginning with `## DP:' are a description of the patch.
## DP: change detection for sysfs and sysfs variable names for 2.6.30+ kernels

@DPATCH@
--- ibam-0.5.2/ibam.inl.orig    2010-01-03 12:17:10.000000000 +0100
+++ ibam-0.5.2/ibam.inl 2010-01-03 12:17:19.000000000 +0100
@@ -540,7 +540,7 @@
          
          if(present)
          {
-            in.open((((Path)+battery_entry->d_name)+"/charge_full").c_str());
+            in.open((((Path)+battery_entry->d_name)+"/energy_full").c_str());
             if(!in.fail())
             {
                in>>capacity;
@@ -551,7 +551,7 @@
          
          if(present && capacity)
          {
-            in.open((((Path)+battery_entry->d_name)+"/charge_now").c_str());
+            in.open((((Path)+battery_entry->d_name)+"/energy_now").c_str());
             if(!in.fail())
             {
                in>>remain;
@@ -562,7 +562,7 @@
 
          if(present && capacity)
          {
-            in.open((((Path)+battery_entry->d_name)+"/current_now").c_str());
+            in.open((((Path)+battery_entry->d_name)+"/energy_now").c_str());
             if(!in.fail())
             {
                in>>rate;
@@ -945,7 +945,7 @@
    string sysfs_path = "/sys/class/power_supply"; // ...
    ifstream pmu,acpi,sysfs;
    pmu.open((pmu_path+"/info").c_str());
-   acpi.open((acpi_path+"/info").c_str());
+   acpi.open((acpi_path+"/event").c_str());
    if (pmu.is_open()) {
 #ifdef IBAM_DEBUG
       cout << "using pmu" << endl;
@@ -959,7 +959,7 @@
       acpi.close();
       apm = new acpi_status();
    } else {
-      sysfs.open((sysfs_path+"/BAT1/charge_full").c_str());
+      sysfs.open((sysfs_path+"/BAT0/energy_full").c_str());
       if(sysfs.is_open()) {
 #ifdef IBAM_DEBUG
       cout << "using sysfs" << endl;

