diff --git a/kernel/include/preset.h b/kernel/include/preset.h index 7a64e0f6..a2d79c0f 100644 --- a/kernel/include/preset.h +++ b/kernel/include/preset.h @@ -47,18 +47,10 @@ typedef struct _setup_header_t // 64-bytes #endif #ifndef __ASSEMBLY__ -#ifndef ANDROID struct patch_config { - char val[PATCH_CONFIG_LEN]; + char config_ini_path[256]; }; -#else -struct patch_config -{ - char su_config_file[128]; - char test_kpm_file[128]; -}; -#endif typedef struct patch_config patch_config_t; #else #define patch_config_size (PATCH_CONFIG_LEN) diff --git a/kernel/patch/android/kpuserd.c b/kernel/patch/android/kpuserd.c index 508bdfad..7ab60ba2 100644 --- a/kernel/patch/android/kpuserd.c +++ b/kernel/patch/android/kpuserd.c @@ -25,11 +25,9 @@ static void load_kpuserd_config() set_selinx_allow(current, 1); patch_config_t *config = get_preset_patch_cfg(); - const char *su_config_path = config->su_config_file; - const char *kpm_path = config->test_kpm_file; + const char *su_config_path = config->config_ini_path; log_boot("config path: %s\n", su_config_path); - log_boot("module path: %s\n", kpm_path); // struct file *filp = filp_open(kpm_path, O_RDONLY, 0); // if (IS_ERR(filp)) { diff --git a/tools/kptools.c b/tools/kptools.c index bf09ed39..f2863d28 100644 --- a/tools/kptools.c +++ b/tools/kptools.c @@ -205,10 +205,12 @@ int patch_image() setup_preset_t *preset = (setup_preset_t *)(out_buf + align_image_len + KP_HEADER_SIZE); patch_config_t *config = &preset->patch_config; memset(config, 0, sizeof(patch_config_t)); - // todo - strlcpy(config->su_config_file, "/data/adb/kernelpatch/su.conf", 128); - strlcpy(config->test_kpm_file, "/data/local/tmp/hello.kpm", 128); - + // todo: +#ifdef ANDROID + strlcpy(config->config_ini_path, "/data/adb/kernelpatch/kpinit.ini", sizeof(config->config_ini_path)); +#else + strlcpy(config->config_ini_path, "/etc/kernelpatch/kpinit.ini", sizeof(config->config_ini_path)); +#endif preset->kernel_size = kinfo.kernel_size; preset->start_offset = align_kernel_size; preset->page_shift = kinfo.page_shift;