aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2016-09-17 00:05:25 +0200
committerWolfgang Wiedmeyer <wolfgit@wiedmeyer.de>2016-09-17 00:05:25 +0200
commitee861bf1cef81efa5c0db4c5f58e2d619c71406c (patch)
tree0476058efb88c5cc6c0301d39d92eb7619cfde18
parent380b157c841c6cbd97ba9d9066b14e022aca210f (diff)
downloadsystem_core-replicant-6.0-kerneldebug.zip
system_core-replicant-6.0-kerneldebug.tar.gz
system_core-replicant-6.0-kerneldebug.tar.bz2
fixes and debug output for mainline kernelreplicant-6.0-kerneldebug
-rw-r--r--fs_mgr/fs_mgr_main.c1
-rw-r--r--healthd/healthd.cpp1
-rw-r--r--include/cutils/klog.h2
-rw-r--r--init/builtins.cpp1
-rw-r--r--init/init.cpp32
-rw-r--r--init/ueventd.cpp1
-rw-r--r--init/watchdogd.cpp1
-rw-r--r--logwrapper/logwrapper.c1
-rw-r--r--rootdir/init.rc1
9 files changed, 16 insertions, 25 deletions
diff --git a/fs_mgr/fs_mgr_main.c b/fs_mgr/fs_mgr_main.c
index e5a00d5..8a1f27d 100644
--- a/fs_mgr/fs_mgr_main.c
+++ b/fs_mgr/fs_mgr_main.c
@@ -86,7 +86,6 @@ int main(int argc, char *argv[])
struct fstab *fstab=NULL;
klog_init();
- klog_set_level(6);
parse_options(argc, argv, &a_flag, &u_flag, &n_flag, &n_name, &n_blk_dev);
diff --git a/healthd/healthd.cpp b/healthd/healthd.cpp
index 1489912..ad3a099 100644
--- a/healthd/healthd.cpp
+++ b/healthd/healthd.cpp
@@ -352,7 +352,6 @@ int main(int argc, char **argv) {
int ch;
int ret;
- klog_set_level(KLOG_LEVEL);
healthd_mode_ops = &android_ops;
if (!strcmp(basename(argv[0]), "charger")) {
diff --git a/include/cutils/klog.h b/include/cutils/klog.h
index 295d62b..6557716 100644
--- a/include/cutils/klog.h
+++ b/include/cutils/klog.h
@@ -46,6 +46,6 @@ __END_DECLS
#define KLOG_INFO(tag,x...) klog_write(KLOG_INFO_LEVEL, "<6>" tag ": " x)
#define KLOG_DEBUG(tag,x...) klog_write(KLOG_DEBUG_LEVEL, "<7>" tag ": " x)
-#define KLOG_DEFAULT_LEVEL 3 /* messages <= this level are logged */
+#define KLOG_DEFAULT_LEVEL 7 /* messages <= this level are logged */
#endif
diff --git a/init/builtins.cpp b/init/builtins.cpp
index b290ce3..796be11 100644
--- a/init/builtins.cpp
+++ b/init/builtins.cpp
@@ -442,7 +442,6 @@ int do_mount_all(int nargs, char **args)
}
} else if (pid == 0) {
/* child, call fs_mgr_mount_all() */
- klog_set_level(6); /* So we can see what fs_mgr_mount_all() does */
fstab = fs_mgr_read_fstab(args[1]);
child_ret = fs_mgr_mount_all(fstab);
fs_mgr_free_fstab(fstab);
diff --git a/init/init.cpp b/init/init.cpp
index 7c0817b..b32ff92 100644
--- a/init/init.cpp
+++ b/init/init.cpp
@@ -733,37 +733,33 @@ static int keychord_init_action(int nargs, char **args)
return 0;
}
-static void list_block_devices(int fd) {
+static void list_block_devices() {
DIR *dir;
struct dirent *ent;
+ INFO("Printing dev/block\n");
if ((dir = opendir("/dev/block")) != NULL) {
int i = 1;
while ((ent = readdir(dir)) != NULL) {
if (strstr(ent->d_name, "pty") != NULL) continue;
- write(fd, ent->d_name, strlen(ent->d_name));
+ INFO("%s", ent->d_name);
if (i % 10 == 0)
- write(fd, "\n", 1);
+ INFO("\n");
else
- write(fd, " ", 1);
+ INFO(" ");
i++;
}
closedir(dir);
} else {
- const char *msg = "Failed to open /dev\n";
- write(fd, msg, strlen(msg));
+ ERROR("Failed to open /dev\n");
}
- const char *msg2 = "Mounting /system...\n";
- write(fd, msg2, strlen(msg2));
- const char *opts = "";
- int res = mount("/dev/block/mmcblk0p9", "/system", "ext4",
- 0, opts);
+ // INFO("Mounting /system...\n");
+ // const char *opts = "";
+ // int res = mount("/dev/block/mmcblk1p9", "/system", "ext4",
+ // 0, opts);
- char* buf = (char*)malloc(sizeof(char) * 60);
- int size = snprintf(buf, 60, "mount err: %d\n", res);
+ // INFO("mount err: %d\n", res);
- write(fd, buf, size);
- free(buf);
/* int partitions = open("/proc/partitions", O_RDONLY);
char buf[256];
int bytes;
@@ -786,6 +782,8 @@ static int console_init_action(int nargs, char **args)
have_console = 1;
close(fd);
+ list_block_devices();
+
fd = open("/dev/tty0", O_WRONLY | O_CLOEXEC);
if (fd >= 0) {
const char *msg;
@@ -805,7 +803,6 @@ static int console_init_action(int nargs, char **args)
"\n"
" A N D R O I D ";
write(fd, msg, strlen(msg));
- list_block_devices(fd);
close(fd);
}
@@ -1095,8 +1092,7 @@ int main(int argc, char** argv) {
// to the outside world.
open_devnull_stdio();
klog_init();
- klog_set_level(KLOG_NOTICE_LEVEL);
-
+
NOTICE("init%s started!\n", is_first_stage ? "" : " second stage");
if (!is_first_stage) {
diff --git a/init/ueventd.cpp b/init/ueventd.cpp
index 2dd8b01..50ef4f1 100644
--- a/init/ueventd.cpp
+++ b/init/ueventd.cpp
@@ -53,7 +53,6 @@ int ueventd_main(int argc, char **argv)
open_devnull_stdio();
klog_init();
- klog_set_level(KLOG_NOTICE_LEVEL);
NOTICE("ueventd started!\n");
diff --git a/init/watchdogd.cpp b/init/watchdogd.cpp
index 881a4df..8a9d1dc 100644
--- a/init/watchdogd.cpp
+++ b/init/watchdogd.cpp
@@ -30,7 +30,6 @@
int watchdogd_main(int argc, char **argv) {
open_devnull_stdio();
klog_init();
- klog_set_level(KLOG_NOTICE_LEVEL);
int interval = 10;
if (argc >= 2) interval = atoi(argv[1]);
diff --git a/logwrapper/logwrapper.c b/logwrapper/logwrapper.c
index 9e0385d..1443a53 100644
--- a/logwrapper/logwrapper.c
+++ b/logwrapper/logwrapper.c
@@ -66,7 +66,6 @@ int main(int argc, char* argv[]) {
break;
case 'k':
log_target = LOG_KLOG;
- klog_set_level(6);
break;
case '?':
default:
diff --git a/rootdir/init.rc b/rootdir/init.rc
index 78adacc..3d6fb61 100644
--- a/rootdir/init.rc
+++ b/rootdir/init.rc
@@ -129,6 +129,7 @@ on init
mkdir /dev/cpuctl
mount cgroup none /dev/cpuctl cpu
chown system system /dev/cpuctl
+ chmod 0660 /dev/cpuctl
chown system system /dev/cpuctl/tasks
chmod 0666 /dev/cpuctl/tasks
write /dev/cpuctl/cpu.shares 1024