%define engineer_mode off
%endif
+%define battery_module on
+
%cmake \
-DTZ_SYS_ETC=%TZ_SYS_ETC \
-DCMAKE_INSTALL_PREFIX=%{_prefix} \
-DARCH_BIT=%{ARCH_BIT} \
-DDPMS=%{DPMS} \
-DENGINEER_MODE=%{engineer_mode} \
- -DBATTERY_MODULE=on \
+ -DBATTERY_MODULE=%{battery_module} \
-DDISPLAY_MODULE=on \
-DEXTCON_MODULE=on \
-DIR_MODULE=on \
%config %{_sysconfdir}/dbus-1/system.d/org.tizen.system.deviced.conf
%config %{_sysconfdir}/deviced/cpu.conf
%config %{_sysconfdir}/deviced/power.conf
+%if %{?battery_module} == on
%config %{_sysconfdir}/deviced/battery.conf
+%endif
# usbhost_test
%{_sysconfdir}/deviced/usb-host-test/test_gadget.gs
%{_bindir}/usb-host-ffs-test-daemon
#include "core/common.h"
#include "core/config-parser.h"
#include "core/device-notifier.h"
+#ifdef BATTERY_MODULE
#include "battery/power-supply.h"
+#endif
#include "power/power-handler.h"
#define CLOG_SAVE_FILE "/var/log/critical-log.log"
localtime_r((time_t *)&tspec.tv_sec, &tm_now);
strftime(str_time, sizeof(str_time), CLOG_TIME_FORMAT, &tm_now);
snprintf(str_msec, sizeof(str_msec), ":%03ld|", tspec.tv_nsec / 1000000);
+#ifdef BATTERY_MODULE
snprintf(str_buff, sizeof(str_buff), "%s%s[%d]%s BAT(P:%s S:%s C:%d M:%d Chg_ON:%d)\n",
str_time, str_msec, getpid(), input,
battery.power_source_s,
battery.capacity,
battery.misc,
battery.charger_charging);
+#else
+ snprintf(str_buff, sizeof(str_buff), "%s%s[%d]%s\n",
+ str_time, str_msec, getpid(), input);
+#endif
_D("%s", str_buff);
msg->log = strdup(str_buff);
msg->type = tag->type;
return ret;
}
+#ifdef BATTERY_MODULE
static int clog_battery_health(void *data)
{
char clog[CLOG_MSG_MAX] = {0,};
return clog_execute((void *)clog);
}
+#endif
static void clog_save_log(void)
{
static void clog_init(void *none)
{
register_notifier(DEVICE_NOTIFIER_BOOTING_DONE, clog_booting_done);
+#ifdef BATTERY_MODULE
register_notifier(DEVICE_NOTIFIER_BATTERY_HEALTH, clog_battery_health);
register_notifier(DEVICE_NOTIFIER_BATTERY_PRESENT, clog_battery_present);
+#endif
register_notifier(DEVICE_NOTIFIER_CRITICAL_LOG, clog_common_log);
register_notifier(DEVICE_NOTIFIER_POWEROFF, clog_power_off);
if (config_parse(CLOG_CONF_FILE, clog_load_config, NULL) < 0)
static void clog_exit(void *data)
{
+#ifdef BATTERY_MODULE
unregister_notifier(DEVICE_NOTIFIER_BATTERY_HEALTH, clog_battery_health);
unregister_notifier(DEVICE_NOTIFIER_BATTERY_PRESENT, clog_battery_present);
+#endif
unregister_notifier(DEVICE_NOTIFIER_CRITICAL_LOG, clog_common_log);
unregister_notifier(DEVICE_NOTIFIER_POWEROFF, clog_power_off);
free_clog_data();