Skip to content

Commit

Permalink
fix: config path compile error
Browse files Browse the repository at this point in the history
  • Loading branch information
bmax committed Nov 22, 2023
1 parent eaa2a41 commit c44f7e2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 16 deletions.
10 changes: 1 addition & 9 deletions kernel/include/preset.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 1 addition & 3 deletions kernel/patch/android/kpuserd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
10 changes: 6 additions & 4 deletions tools/kptools.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit c44f7e2

Please sign in to comment.