From 7dd20e35b849a80b4209c5f928350af6a64ca928 Mon Sep 17 00:00:00 2001 From: Vyacheslav Cherkashin Date: Thu, 11 Oct 2018 22:27:49 +0300 Subject: [PATCH 01/16] Remove web profiling legacy code Change-Id: I7c5040a2e67da08a286c7ac566a8257d6bda98e6 Signed-off-by: Vyacheslav Cherkashin --- modules/parser/msg_cmd.c | 28 ---------------------------- modules/parser/msg_cmd.h | 2 -- modules/parser/swap_msg_parser.c | 13 ------------- modules/writer/swap_msg.h | 2 -- 4 files changed, 45 deletions(-) diff --git a/modules/parser/msg_cmd.c b/modules/parser/msg_cmd.c index 3572345..d3fef3f 100644 --- a/modules/parser/msg_cmd.c +++ b/modules/parser/msg_cmd.c @@ -29,7 +29,6 @@ #include -#include #include #include "msg_parser.h" #include "msg_buf.h" @@ -40,8 +39,6 @@ #include -static int wrt_launcher_port; - static int set_config(struct conf_data *conf) { int ret; @@ -219,31 +216,6 @@ int msg_swap_inst_remove(struct msg_buf *mb) return app_list_unreg(&app_head); } -void set_wrt_launcher_port(int port) -{ - wrt_launcher_port = port; -} -EXPORT_SYMBOL_GPL(set_wrt_launcher_port); - -#define GET_PORT_DELAY 100 /* msec */ -#define GET_PORT_TIMEOUT 10000 /* msec */ - -int get_wrt_launcher_port(void) -{ - int port; - int timeout = GET_PORT_TIMEOUT; - - do { - port = wrt_launcher_port; - timeout -= GET_PORT_DELAY; - mdelay(GET_PORT_DELAY); - } while (!port && timeout > 0); - - set_wrt_launcher_port(0); - - return port; -} - /** * @brief Initializes commands handling. * diff --git a/modules/parser/msg_cmd.h b/modules/parser/msg_cmd.h index e078169..4317b6c 100644 --- a/modules/parser/msg_cmd.h +++ b/modules/parser/msg_cmd.h @@ -40,7 +40,5 @@ int msg_stop(struct msg_buf *mb); int msg_config(struct msg_buf *mb); int msg_swap_inst_add(struct msg_buf *mb); int msg_swap_inst_remove(struct msg_buf *mb); -int get_wrt_launcher_port(void); -void set_wrt_launcher_port(int port); #endif /* _MSG_CMD_H */ diff --git a/modules/parser/swap_msg_parser.c b/modules/parser/swap_msg_parser.c index eb1abe8..2fd4b4e 100644 --- a/modules/parser/swap_msg_parser.c +++ b/modules/parser/swap_msg_parser.c @@ -56,7 +56,6 @@ enum MSG_ID { MSG_CONFIG = 0x0004, /**< Config message. */ MSG_SWAP_INST_ADD = 0x0008, /**< Swap inst add message. */ MSG_SWAP_INST_REMOVE = 0x0009, /**< Swap inst remove message. */ - MSG_WRT_LAUNCHER_PORT = 0x8001 /**< WRT launcher port. */ }; /** @@ -126,18 +125,6 @@ static int msg_handler(void __user *msg) print_parse_debug("MSG_SWAP_INST_REMOVE. size=%d\n", size); ret = msg_swap_inst_remove(&mb); break; - case MSG_WRT_LAUNCHER_PORT: { - /* TODO: discuss wrt-launcher port transfer */ - int port; - print_parse_debug("MSG_WRT_LAUNCHER_PORT. size=%d\n", size); - port = get_wrt_launcher_port(); - if (copy_to_user(payload, &port, sizeof(port))) { - ret = -EIO; - break; - } - ret = port ? 0 : -EINVAL; - break; - } default: print_err("incorrect message ID [%u]. size=%d\n", msg_id, size); ret = -EINVAL; diff --git a/modules/writer/swap_msg.h b/modules/writer/swap_msg.h index 5d86f95..40a4b83 100644 --- a/modules/writer/swap_msg.h +++ b/modules/writer/swap_msg.h @@ -55,9 +55,7 @@ enum swap_msg_id { MSG_PROC_MAP = 0x0012, MSG_PROC_UNMAP = 0x0013, MSG_PROC_COMM = 0x0014, - MSG_WEB_PROFILING = 0x0015, MSG_NSP = 0x0019, - MSG_WSP = 0x001a, MSG_FBI = 0x0020 }; -- 2.7.4 From 18486d062e89188a4cf8101ef1c7a47c216c7fea Mon Sep 17 00:00:00 2001 From: Vyacheslav Cherkashin Date: Mon, 1 Oct 2018 13:27:35 +0300 Subject: [PATCH 02/16] us_manager: remove old dentry manipulation interface Change-Id: Ib68a78ecc5f97bdfb9cc6f8ec022af6dc3350179 Signed-off-by: Vyacheslav Cherkashin --- modules/us_manager/pf/pf_group.c | 20 --------------- modules/us_manager/pf/pf_group.h | 3 --- modules/us_manager/us_common_file.h | 49 ------------------------------------- 3 files changed, 72 deletions(-) delete mode 100644 modules/us_manager/us_common_file.h diff --git a/modules/us_manager/pf/pf_group.c b/modules/us_manager/pf/pf_group.c index 26684ff..be90f3c 100644 --- a/modules/us_manager/pf/pf_group.c +++ b/modules/us_manager/pf/pf_group.c @@ -43,7 +43,6 @@ #include #include #include -#include #include #include @@ -276,25 +275,6 @@ static void subsequent_install(struct task_struct *task, } -/** - * @brief Get dentry struct by path - * - * @param path Path to file - * @return Pointer on dentry struct on NULL - */ -struct dentry *dentry_by_path(const char *path) -{ - struct dentry *d; - - d = swap_get_dentry(path); - if (d) - dput(d); - - return d; -} -EXPORT_SYMBOL_GPL(dentry_by_path); - - int pfg_msg_cb_set(struct pf_group *pfg, struct pfg_msg_cb *msg_cb) { if (pfg->msg_cb) diff --git a/modules/us_manager/pf/pf_group.h b/modules/us_manager/pf/pf_group.h index f5267aa..01749b9 100644 --- a/modules/us_manager/pf/pf_group.h +++ b/modules/us_manager/pf/pf_group.h @@ -43,9 +43,6 @@ struct pfg_msg_cb { }; -/* FIXME: use swap_get_dentry() and swap_put_dentry() */ -struct dentry *dentry_by_path(const char *path); - struct pf_group *get_pf_group_by_dentry(struct dentry *dentry, void *priv); struct pf_group *get_pf_group_by_tgid(pid_t tgid, void *priv); struct pf_group *get_pf_group_by_comm(char *comm, void *priv); diff --git a/modules/us_manager/us_common_file.h b/modules/us_manager/us_common_file.h deleted file mode 100644 index f18b6ce..0000000 --- a/modules/us_manager/us_common_file.h +++ /dev/null @@ -1,49 +0,0 @@ -/* - * SWAP uprobe manager - * modules/us_manager/us_manager_common_file.h - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. - * - * Copyright (C) Samsung Electronics, 2017 - * - * 2017 Alexander Aksenov: SWAP us_manager implement - * - */ - -#ifndef __US_MANAGER_COMMON_FILE_H__ -#define __US_MANAGER_COMMON_FILE_H__ - -#include -#include - -static inline struct dentry *swap_get_dentry(const char *filepath) -{ - struct path path; - struct dentry *dentry = NULL; - - if (kern_path(filepath, LOOKUP_FOLLOW, &path) == 0) { - dentry = dget(path.dentry); - path_put(&path); - } - - return dentry; -} - -static inline void swap_put_dentry(struct dentry *dentry) -{ - dput(dentry); -} - -#endif /* __US_MANAGER_COMMON_FILE_H__ */ -- 2.7.4 From dc89ac67f914718151dee04a0610925745f98f04 Mon Sep 17 00:00:00 2001 From: Vyacheslav Cherkashin Date: Tue, 27 Nov 2018 13:59:41 +0300 Subject: [PATCH 03/16] Add support kernel v4.14 Change-Id: Id30162600c1c8cfe59a05d5b9cc9131156ee3b91 Signed-off-by: Vyacheslav Cherkashin --- modules/arch/arm/uprobe/swap_uprobe.c | 4 ++++ modules/got_patcher/gt_module.c | 1 + modules/kprobe/swap_td_raw.c | 9 ++++++++- modules/master/wait.h | 10 +++++----- modules/sampler/swap_sampler_module.c | 5 +++++ modules/uprobe/arch/arm/swap-asm/swap_uprobes.c | 4 ++++ modules/us_manager/pf/pf_group.c | 2 ++ modules/us_manager/sspt/sspt_proc.c | 1 + 8 files changed, 30 insertions(+), 6 deletions(-) diff --git a/modules/arch/arm/uprobe/swap_uprobe.c b/modules/arch/arm/uprobe/swap_uprobe.c index c7b2d0f..7955232 100644 --- a/modules/arch/arm/uprobe/swap_uprobe.c +++ b/modules/arch/arm/uprobe/swap_uprobe.c @@ -20,6 +20,10 @@ */ +#include +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) +# include /* for task_pt_regs() */ +#endif #include #include diff --git a/modules/got_patcher/gt_module.c b/modules/got_patcher/gt_module.c index cd6898d..fac053a 100644 --- a/modules/got_patcher/gt_module.c +++ b/modules/got_patcher/gt_module.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include diff --git a/modules/kprobe/swap_td_raw.c b/modules/kprobe/swap_td_raw.c index 9985d06..0715b7c 100644 --- a/modules/kprobe/swap_td_raw.c +++ b/modules/kprobe/swap_td_raw.c @@ -21,7 +21,14 @@ */ -#include +#include + +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) +# include +#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) */ +# include +#endif /* LINUX_VERSION_CODE */ + #include #include "swap_td_raw.h" diff --git a/modules/master/wait.h b/modules/master/wait.h index bb1ca4b..e003027 100644 --- a/modules/master/wait.h +++ b/modules/master/wait.h @@ -28,10 +28,10 @@ int wait_on_atomic_t(atomic_t *val, int (*action)(atomic_t *), unsigned mode) return out_of_line_wait_on_atomic_t(val, action, mode); } -#else /* LINUX_VERSION_CODE < KERNEL_VERSION(3, 11, 0) */ - -#include - -#endif /* LINUX_VERSION_CODE < KERNEL_VERSION(3, 11, 0) */ +#elif LINUX_VERSION_CODE < KERNEL_VERSION(4, 13, 0) +# include +#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 13, 0) */ +# include +#endif /* LINUX_VERSION_CODE */ #endif /* _SWAP_WAIT_H */ diff --git a/modules/sampler/swap_sampler_module.c b/modules/sampler/swap_sampler_module.c index 1b22646..6ac1aae 100644 --- a/modules/sampler/swap_sampler_module.c +++ b/modules/sampler/swap_sampler_module.c @@ -28,6 +28,11 @@ * Timer-based sampling module. */ +#include +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) +# include /* for task_pt_regs() */ +#endif + #include #include #include diff --git a/modules/uprobe/arch/arm/swap-asm/swap_uprobes.c b/modules/uprobe/arch/arm/swap-asm/swap_uprobes.c index 6da9d14..59e7fa9 100644 --- a/modules/uprobe/arch/arm/swap-asm/swap_uprobes.c +++ b/modules/uprobe/arch/arm/swap-asm/swap_uprobes.c @@ -31,6 +31,10 @@ */ +#include +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) +# include /* need for task_pt_regs() */ +#endif /* LINUX_VERSION_CODE */ #include /* need for asm/traps.h */ #include /* need for asm/traps.h */ diff --git a/modules/us_manager/pf/pf_group.c b/modules/us_manager/pf/pf_group.c index be90f3c..867a971 100644 --- a/modules/us_manager/pf/pf_group.c +++ b/modules/us_manager/pf/pf_group.c @@ -33,6 +33,8 @@ #include #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) # include +# include +# include #endif #include "pf_group.h" #include "proc_filters.h" diff --git a/modules/us_manager/sspt/sspt_proc.c b/modules/us_manager/sspt/sspt_proc.c index c06e26e..e4d9159 100644 --- a/modules/us_manager/sspt/sspt_proc.c +++ b/modules/us_manager/sspt/sspt_proc.c @@ -34,6 +34,7 @@ #include #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 11, 0) # include +# include #endif #include #include -- 2.7.4 From 4a9f591cc6b2b90b4595d20bf986ad63c2b4a601 Mon Sep 17 00:00:00 2001 From: Vyacheslav Cherkashin Date: Thu, 13 Dec 2018 22:42:13 +0300 Subject: [PATCH 04/16] Fix memory corruption in the retprobe module Change-Id: Iee6a46fc8c7190a200de0bf94d47e1989e6238f3 Signed-off-by: Vyacheslav Cherkashin --- modules/retprobe/retprobe.c | 1 - 1 file changed, 1 deletion(-) diff --git a/modules/retprobe/retprobe.c b/modules/retprobe/retprobe.c index 9a47ef9..bbefdc4 100644 --- a/modules/retprobe/retprobe.c +++ b/modules/retprobe/retprobe.c @@ -113,7 +113,6 @@ static void retprobe_init(struct sspt_ip *ip) static void retprobe_uninit(struct sspt_ip *ip) { - retprobe_cleanup(&ip->desc->info); } -- 2.7.4 From 8f4c00d2c10af73bed32247f5d0023edac74ae98 Mon Sep 17 00:00:00 2001 From: Vyacheslav Cherkashin Date: Thu, 13 Dec 2018 22:46:15 +0300 Subject: [PATCH 05/16] Fix memory corruption in the fbiprobe module Change-Id: I78ff0c4f425d243477181128e7e5bf6a1095e055 Signed-off-by: Vyacheslav Cherkashin --- modules/fbiprobe/fbiprobe.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/modules/fbiprobe/fbiprobe.c b/modules/fbiprobe/fbiprobe.c index 42f5223..fc07fba 100644 --- a/modules/fbiprobe/fbiprobe.c +++ b/modules/fbiprobe/fbiprobe.c @@ -313,8 +313,6 @@ void fbi_probe_init(struct sspt_ip *ip) void fbi_probe_uninit(struct sspt_ip *ip) { - if (ip != NULL) - fbi_probe_cleanup(&ip->desc->info); } static int fbi_probe_register_probe(struct sspt_ip *ip) -- 2.7.4 From 6cfcfbfe683e2b75e88f22820f63224bb3a5cb0b Mon Sep 17 00:00:00 2001 From: Vyacheslav Cherkashin Date: Thu, 13 Dec 2018 22:49:50 +0300 Subject: [PATCH 06/16] Remove dead code Fields the copy and the cleanup in probe_iface structure already do not used. Therefore, remove them from all source code. Change-Id: Iaa72ddf5bfb999fc07292cf7505ec07320c4380d Signed-off-by: Vyacheslav Cherkashin --- modules/fbiprobe/fbiprobe.c | 70 ----------------------------- modules/preload/preload_probe.c | 39 ---------------- modules/retprobe/retprobe.c | 26 ----------- modules/us_manager/probes/probe_info_new.c | 22 --------- modules/us_manager/probes/register_probes.h | 2 - 5 files changed, 159 deletions(-) diff --git a/modules/fbiprobe/fbiprobe.c b/modules/fbiprobe/fbiprobe.c index fc07fba..c0ce923 100644 --- a/modules/fbiprobe/fbiprobe.c +++ b/modules/fbiprobe/fbiprobe.c @@ -288,24 +288,6 @@ static int fbi_probe_handler(struct uprobe *p, struct pt_regs *regs) } /* FBI probe interfaces */ -void fbi_probe_cleanup(struct probe_info *probe_i) -{ - uint8_t i; - struct fbi_info *fbi_i = &(probe_i->fbi_i); - - for (i = 0; i != fbi_i->var_count; i++) { - if (fbi_i->vars[i].steps != NULL) { - if (fbi_i->vars[i].steps != NULL) - kfree(fbi_i->vars[i].steps); - fbi_i->vars[i].steps = NULL; - fbi_i->vars[i].steps_count = 0; - } - } - - kfree(fbi_i->vars); - fbi_i->vars = NULL; -} - void fbi_probe_init(struct sspt_ip *ip) { ip->uprobe.pre_handler = (uprobe_pre_handler_t)fbi_probe_handler; @@ -330,56 +312,6 @@ static struct uprobe *fbi_probe_get_uprobe(struct sspt_ip *ip) return &ip->uprobe; } -int fbi_probe_copy(struct probe_info *dest, const struct probe_info *source) -{ - uint8_t steps_count; - size_t steps_size; - size_t vars_size; - struct fbi_var_data *vars; - struct fbi_step *steps_source; - struct fbi_step *steps_dest = NULL; - uint8_t i, n; - int ret = 0; - - memcpy(dest, source, sizeof(*source)); - - vars_size = source->fbi_i.var_count * sizeof(*source->fbi_i.vars); - vars = kmalloc(vars_size, GFP_KERNEL); - if (vars == NULL) - return -ENOMEM; - - memcpy(vars, source->fbi_i.vars, vars_size); - - for (i = 0; i != source->fbi_i.var_count; i++) { - steps_dest = NULL; - steps_count = vars[i].steps_count; - steps_size = sizeof(*steps_source) * steps_count; - steps_source = vars[i].steps; - - if (steps_size != 0 && steps_source != NULL) { - steps_dest = kmalloc(steps_size, GFP_KERNEL); - if (steps_dest == NULL) { - print_err("can not alloc data\n"); - n = i; - ret = -ENOMEM; - goto err; - } - - memcpy(steps_dest, steps_source, steps_size); - } - vars[i].steps = steps_dest; - } - - dest->fbi_i.vars = vars; - - return ret; -err: - for (i = 0; i < n; i++) - kfree(vars[i].steps); - kfree(vars); - return ret; -} - /* Register */ static struct probe_iface fbi_probe_iface = { .init = fbi_probe_init, @@ -387,8 +319,6 @@ static struct probe_iface fbi_probe_iface = { .reg = fbi_probe_register_probe, .unreg = fbi_probe_unregister_probe, .get_uprobe = fbi_probe_get_uprobe, - .copy = fbi_probe_copy, - .cleanup = fbi_probe_cleanup }; static int fbiprobe_init(void) diff --git a/modules/preload/preload_probe.c b/modules/preload/preload_probe.c index 3db3fd0..b5bf767 100644 --- a/modules/preload/preload_probe.c +++ b/modules/preload/preload_probe.c @@ -32,17 +32,6 @@ #include "preload.h" #include "preload_module.h" -static int preload_info_copy(struct probe_info *dest, - const struct probe_info *source) -{ - memcpy(dest, source, sizeof(*source)); - - return 0; -} - -static void preload_info_cleanup(struct probe_info *probe_i) -{ -} static struct uprobe *preload_get_uprobe(struct sspt_ip *ip) { @@ -69,8 +58,6 @@ static void preload_init(struct sspt_ip *ip) static void preload_uninit(struct sspt_ip *ip) { pm_uprobe_exit(ip); - - preload_info_cleanup(&ip->desc->info); } static struct probe_iface preload_iface = { @@ -79,22 +66,8 @@ static struct probe_iface preload_iface = { .reg = preload_register_probe, .unreg = preload_unregister_probe, .get_uprobe = preload_get_uprobe, - .copy = preload_info_copy, - .cleanup = preload_info_cleanup }; -static int get_caller_info_copy(struct probe_info *dest, - const struct probe_info *source) -{ - memcpy(dest, source, sizeof(*source)); - - return 0; -} - -static void get_caller_info_cleanup(struct probe_info *probe_i) -{ -} - static struct uprobe *get_caller_get_uprobe(struct sspt_ip *ip) { return &ip->uprobe; @@ -118,8 +91,6 @@ static void get_caller_init(struct sspt_ip *ip) static void get_caller_uninit(struct sspt_ip *ip) { pm_get_caller_exit(ip); - - get_caller_info_cleanup(&ip->desc->info); } static struct probe_iface get_caller_iface = { @@ -128,8 +99,6 @@ static struct probe_iface get_caller_iface = { .reg = get_caller_register_probe, .unreg = get_caller_unregister_probe, .get_uprobe = get_caller_get_uprobe, - .copy = get_caller_info_copy, - .cleanup = get_caller_info_cleanup }; static void get_call_type_init(struct sspt_ip *ip) @@ -140,8 +109,6 @@ static void get_call_type_init(struct sspt_ip *ip) static void get_call_type_uninit(struct sspt_ip *ip) { pm_get_call_type_exit(ip); - - get_caller_info_cleanup(&ip->desc->info); } static struct probe_iface get_call_type_iface = { @@ -150,8 +117,6 @@ static struct probe_iface get_call_type_iface = { .reg = get_caller_register_probe, .unreg = get_caller_unregister_probe, .get_uprobe = get_caller_get_uprobe, - .copy = get_caller_info_copy, - .cleanup = get_caller_info_cleanup }; static void write_msg_init(struct sspt_ip *ip) @@ -167,8 +132,6 @@ static int write_msg_reg(struct sspt_ip *ip) static void write_msg_uninit(struct sspt_ip *ip) { pm_write_msg_exit(ip); - - get_caller_info_cleanup(&ip->desc->info); } static struct probe_iface write_msg_iface = { @@ -177,8 +140,6 @@ static struct probe_iface write_msg_iface = { .reg = write_msg_reg, .unreg = get_caller_unregister_probe, .get_uprobe = get_caller_get_uprobe, - .copy = get_caller_info_copy, - .cleanup = get_caller_info_cleanup }; int register_preload_probes(void) diff --git a/modules/retprobe/retprobe.c b/modules/retprobe/retprobe.c index bbefdc4..990c764 100644 --- a/modules/retprobe/retprobe.c +++ b/modules/retprobe/retprobe.c @@ -33,30 +33,6 @@ #include "rp_msg.h" -static int retprobe_copy(struct probe_info *dest, - const struct probe_info *source) -{ - size_t len; - - memcpy(dest, source, sizeof(*source)); - - len = strlen(source->rp_i.args) + 1; - dest->rp_i.args = kmalloc(len, GFP_ATOMIC); - if (dest->rp_i.args == NULL) - return -ENOMEM; - memcpy(dest->rp_i.args, source->rp_i.args, len); - - return 0; -} - - -static void retprobe_cleanup(struct probe_info *probe_i) -{ - kfree(probe_i->rp_i.args); -} - - - static struct uprobe *retprobe_get_uprobe(struct sspt_ip *ip) { return &ip->retprobe.up; @@ -122,8 +98,6 @@ static struct probe_iface retprobe_iface = { .reg = retprobe_register_probe, .unreg = retprobe_unregister_probe, .get_uprobe = retprobe_get_uprobe, - .copy = retprobe_copy, - .cleanup = retprobe_cleanup }; static int mod_init(void) diff --git a/modules/us_manager/probes/probe_info_new.c b/modules/us_manager/probes/probe_info_new.c index 303f332..801acdd 100644 --- a/modules/us_manager/probes/probe_info_new.c +++ b/modules/us_manager/probes/probe_info_new.c @@ -112,15 +112,6 @@ EXPORT_SYMBOL_GPL(pin_unregister); /* * SWAP_NEW_UP */ -static int up_copy(struct probe_info *dst, const struct probe_info *src) -{ - return 0; -} - -static void up_cleanup(struct probe_info *probe_i) -{ -} - static struct uprobe *up_get_uprobe(struct sspt_ip *ip) { return &ip->uprobe; @@ -151,8 +142,6 @@ static struct probe_iface up_iface = { .reg = up_register_probe, .unreg = up_unregister_probe, .get_uprobe = up_get_uprobe, - .copy = up_copy, - .cleanup = up_cleanup }; @@ -162,15 +151,6 @@ static struct probe_iface up_iface = { /* * SWAP_NEW_URP */ -static int urp_copy(struct probe_info *dst, const struct probe_info *src) -{ - return 0; -} - -static void urp_cleanup(struct probe_info *probe_i) -{ -} - static struct uprobe *urp_get_uprobe(struct sspt_ip *ip) { return &ip->retprobe.up; @@ -213,8 +193,6 @@ static struct probe_iface urp_iface = { .reg = urp_register_probe, .unreg = urp_unregister_probe, .get_uprobe = urp_get_uprobe, - .copy = urp_copy, - .cleanup = urp_cleanup }; diff --git a/modules/us_manager/probes/register_probes.h b/modules/us_manager/probes/register_probes.h index f981056..f07bd04 100644 --- a/modules/us_manager/probes/register_probes.h +++ b/modules/us_manager/probes/register_probes.h @@ -11,8 +11,6 @@ struct probe_iface { int (*reg)(struct sspt_ip *); void (*unreg)(struct sspt_ip *, int); struct uprobe *(*get_uprobe)(struct sspt_ip *); - int (*copy)(struct probe_info *, const struct probe_info *); - void (*cleanup)(struct probe_info *); }; int swap_register_probe_type(enum probe_t probe_type, struct probe_iface *pi); -- 2.7.4 From caefd845383a33a2d11b58debbfe4b5a2c40c7d6 Mon Sep 17 00:00:00 2001 From: Vyacheslav Cherkashin Date: Wed, 12 Dec 2018 22:24:05 +0300 Subject: [PATCH 07/16] Fix dentry leaks from swap_preload module Add missed call probe_info_unit() for deinitialize 'probe_info' Change-Id: I6c9506e64c6ebd2d90b1b1bde6b029d77defba3b Signed-off-by: Vyacheslav Cherkashin --- modules/us_manager/sspt/sspt_file.c | 8 ++------ modules/us_manager/sspt/sspt_ip.c | 2 ++ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/modules/us_manager/sspt/sspt_file.c b/modules/us_manager/sspt/sspt_file.c index 417c949..95decce 100644 --- a/modules/us_manager/sspt/sspt_file.c +++ b/modules/us_manager/sspt/sspt_file.c @@ -217,18 +217,14 @@ void sspt_file_add_ip(struct sspt_file *file, struct img_ip *img_ip) { unsigned long offset = 0; struct sspt_page *page = NULL; - struct sspt_ip *ip = NULL; offset = img_ip->addr & PAGE_MASK; page = sspt_find_page_or_new(file, offset); if (!page) return; - ip = sspt_ip_create(img_ip, page); - if (!ip) - return; - - probe_info_init(ip->desc->type, ip); + /* Created the "ip" automatically added itself to necessary lists */ + sspt_ip_create(img_ip, page); } void sspt_file_on_each_ip(struct sspt_file *file, diff --git a/modules/us_manager/sspt/sspt_ip.c b/modules/us_manager/sspt/sspt_ip.c index e36f80a..94ce357 100644 --- a/modules/us_manager/sspt/sspt_ip.c +++ b/modules/us_manager/sspt/sspt_ip.c @@ -54,6 +54,7 @@ struct sspt_ip *sspt_ip_create(struct img_ip *img_ip, struct sspt_page *page) ip->offset = img_ip->addr & ~PAGE_MASK; ip->desc = img_ip->desc; atomic_set(&ip->usage, 2); /* for 'img_ip' and 'page' */ + probe_info_init(ip->desc->type, ip); /* add to img_ip list */ img_ip_get(img_ip); @@ -74,6 +75,7 @@ static void sspt_ip_free(struct sspt_ip *ip) { WARN_ON(!list_empty(&ip->list) || !list_empty(&ip->img_list)); + probe_info_uninit(ip->desc->type, ip); kfree(ip); } -- 2.7.4 From f3d111ac868a27c3368c7d72b4920067ed65ce43 Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Fri, 4 Jan 2019 15:34:57 +0900 Subject: [PATCH 08/16] Add the swap-modules-tw3 package build For enabling/disabling build of the swap-modules-tw3 package set BUILD_PACKAGE_TW3 to 1/0. Note: based on the commit 1735096b40f5 ("Add the swap-modules-tw2 package build") and kernel version of tw3 is v4.9.y. Change-Id: I885ff6d81ee4a0947b55200764aeef98156e36d7 Signed-off-by: Seung-Woo Kim --- packaging/baselibs.conf | 7 +++++++ packaging/swap-modules.spec | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/packaging/baselibs.conf b/packaging/baselibs.conf index 456e2ed..96df1a9 100644 --- a/packaging/baselibs.conf +++ b/packaging/baselibs.conf @@ -14,6 +14,13 @@ swap-modules-tw2 preun "rm /opt/swap/sdk" +/ +swap-modules-tw3 + provides "swap-modules" + provides "swap-modules = %{version}-%{release}" + post "ln -s /opt/swap/modules/tw3 /opt/swap/sdk" + preun "rm /opt/swap/sdk" + +/ + swap-modules-rpi3 provides "swap-modules" provides "swap-modules = %{version}-%{release}" diff --git a/packaging/swap-modules.spec b/packaging/swap-modules.spec index c90944d..758f676 100755 --- a/packaging/swap-modules.spec +++ b/packaging/swap-modules.spec @@ -20,6 +20,7 @@ Kernel modules for SWAP %define BUILD_PACKAGE_TM1 1 %define BUILD_PACKAGE_TM2 1 %define BUILD_PACKAGE_TW2 1 +%define BUILD_PACKAGE_TW3 1 %define BUILD_PACKAGE_RPI3 1 %define BUILD_PACKAGE_ODROIDXU3 1 %define BUILD_PACKAGE_EMULATOR32 1 @@ -37,6 +38,7 @@ Kernel modules for SWAP %ifnarch aarch64 %define BUILD_PACKAGE_TM2 0 %define BUILD_PACKAGE_TW2 0 + %define BUILD_PACKAGE_TW3 0 %define BUILD_PACKAGE_RPI3 0 %endif %if ! %{with emulator} @@ -69,6 +71,12 @@ cd modules ./pack.sh /tmp/modules/tw2 %endif +%if %{BUILD_PACKAGE_TW3} + ./build.sh --kernel /boot/kernel/devel/kernel-devel-tw3 --arch arm64 clean + ./build.sh --kernel /boot/kernel/devel/kernel-devel-tw3 --arch arm64 compile + ./pack.sh /tmp/modules/tw3 +%endif + %if %{BUILD_PACKAGE_RPI3} ./build.sh --kernel /boot/kernel/devel/kernel-devel-arm64-rpi3 --arch arm64 clean ./build.sh --kernel /boot/kernel/devel/kernel-devel-arm64-rpi3 --arch arm64 compile @@ -103,6 +111,10 @@ mkdir -p %{buildroot}/opt/swap/modules/ mv /tmp/modules/tw2 %{buildroot}/opt/swap/modules/ %endif +%if %{BUILD_PACKAGE_TW3} + mv /tmp/modules/tw3 %{buildroot}/opt/swap/modules/ +%endif + %if %{BUILD_PACKAGE_RPI3} mv /tmp/modules/rpi3 %{buildroot}/opt/swap/modules/ %endif @@ -182,6 +194,28 @@ rm /opt/swap/sdk %endif # BUILD_PACKAGE_TW2 +%if %{BUILD_PACKAGE_TW3} +%package tw3 +Summary: SWAP modules for TW3 +Provides: swap-modules +Provides: swap-modules = %{version}-%{release} +BuildRequires: kernel-devel-exynos9110-tw3 + +%description tw3 +This package provides SWAP modules for TW3 + +%post tw3 +ln -s /opt/swap/modules/tw3 /opt/swap/sdk + +%preun tw3 +rm /opt/swap/sdk + +%files tw3 +%license LICENSE.GPL-2.0+ +/opt/swap/modules/tw3/ +%endif # BUILD_PACKAGE_TW3 + + %if %{BUILD_PACKAGE_RPI3} %package rpi3 Summary: SWAP modules for RPI3 -- 2.7.4 From 5f8f8147b0c4ab1554279ac4570e96b1ac8c6ba6 Mon Sep 17 00:00:00 2001 From: Vyacheslav Cherkashin Date: Wed, 30 Jan 2019 21:28:45 +0300 Subject: [PATCH 09/16] us_manager: fix incorrect counter usage in sspt_proc Change-Id: Ia1b26a2d2f6110187af4efad084e1877e2432eb2 Signed-off-by: Vyacheslav Cherkashin --- modules/us_manager/sspt/sspt_proc.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/modules/us_manager/sspt/sspt_proc.c b/modules/us_manager/sspt/sspt_proc.c index e4d9159..9be8813 100644 --- a/modules/us_manager/sspt/sspt_proc.c +++ b/modules/us_manager/sspt/sspt_proc.c @@ -339,9 +339,11 @@ struct sspt_proc *sspt_proc_get_by_task_or_new(struct task_struct *task) kproc = kproc_by_task(leader); if (kproc->proc) - goto out; + return sspt_proc_get(kproc->proc); proc = sspt_proc_create(leader); + if (proc == NULL) + return NULL; spin_lock(&kproc->lock); if (kproc->proc == NULL) { @@ -358,7 +360,6 @@ struct sspt_proc *sspt_proc_get_by_task_or_new(struct task_struct *task) if (proc) sspt_proc_free(proc); -out: return kproc->proc; } -- 2.7.4 From 3be159f09098c595b7a68813a2d72bc0439b0362 Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Fri, 10 May 2019 18:34:20 +0900 Subject: [PATCH 10/16] Add the swap-modules-rpi3 package build for 32-bit arm Currently, only arm64 build for rpi3 is supported, but rpi3 kernel also support 32-bit arm. To support the 32-bit kernel, add the swap-modules-rpi3 package build for 32-bit arm. Note: new arm built rpm is named with arm arch name because already existing arm64 built, arm repackaged rpm file name has aarch64 arch like swap-modules-rpi3-aarch64. Change-Id: Ica1ab4c28f6bbc71e1fb69bc4c2e3f5b39250a44 Signed-off-by: Seung-Woo Kim --- packaging/swap-modules.spec | 46 +++++++++++++++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 6 deletions(-) diff --git a/packaging/swap-modules.spec b/packaging/swap-modules.spec index 758f676..37b0a09 100755 --- a/packaging/swap-modules.spec +++ b/packaging/swap-modules.spec @@ -21,7 +21,8 @@ Kernel modules for SWAP %define BUILD_PACKAGE_TM2 1 %define BUILD_PACKAGE_TW2 1 %define BUILD_PACKAGE_TW3 1 -%define BUILD_PACKAGE_RPI3 1 +%define BUILD_PACKAGE_RPI3_ARM64 1 +%define BUILD_PACKAGE_RPI3_ARM32 1 %define BUILD_PACKAGE_ODROIDXU3 1 %define BUILD_PACKAGE_EMULATOR32 1 @@ -34,12 +35,13 @@ Kernel modules for SWAP %ifnarch %arm %define BUILD_PACKAGE_TM1 0 %define BUILD_PACKAGE_ODROIDXU3 0 + %define BUILD_PACKAGE_RPI3_ARM32 0 %endif %ifnarch aarch64 %define BUILD_PACKAGE_TM2 0 %define BUILD_PACKAGE_TW2 0 %define BUILD_PACKAGE_TW3 0 - %define BUILD_PACKAGE_RPI3 0 + %define BUILD_PACKAGE_RPI3_ARM64 0 %endif %if ! %{with emulator} %define BUILD_PACKAGE_EMULATOR32 0 @@ -77,12 +79,18 @@ cd modules ./pack.sh /tmp/modules/tw3 %endif -%if %{BUILD_PACKAGE_RPI3} +%if %{BUILD_PACKAGE_RPI3_ARM64} ./build.sh --kernel /boot/kernel/devel/kernel-devel-arm64-rpi3 --arch arm64 clean ./build.sh --kernel /boot/kernel/devel/kernel-devel-arm64-rpi3 --arch arm64 compile ./pack.sh /tmp/modules/rpi3 %endif +%if %{BUILD_PACKAGE_RPI3_ARM32} + ./build.sh --kernel /boot/kernel/devel/kernel-devel-arm-rpi3 --arch arm clean + ./build.sh --kernel /boot/kernel/devel/kernel-devel-arm-rpi3 --arch arm compile + ./pack.sh /tmp/modules/rpi3-arm32 +%endif + %if %{BUILD_PACKAGE_ODROIDXU3} ./build.sh --kernel /boot/kernel/devel/kernel-devel-arm-odroidxu3 --arch arm clean ./build.sh --kernel /boot/kernel/devel/kernel-devel-arm-odroidxu3 --arch arm compile @@ -115,10 +123,14 @@ mkdir -p %{buildroot}/opt/swap/modules/ mv /tmp/modules/tw3 %{buildroot}/opt/swap/modules/ %endif -%if %{BUILD_PACKAGE_RPI3} +%if %{BUILD_PACKAGE_RPI3_ARM64} mv /tmp/modules/rpi3 %{buildroot}/opt/swap/modules/ %endif +%if %{BUILD_PACKAGE_RPI3_ARM32} + mv /tmp/modules/rpi3-arm32 %{buildroot}/opt/swap/modules/ +%endif + %if %{BUILD_PACKAGE_ODROIDXU3} mv /tmp/modules/odroidxu3 %{buildroot}/opt/swap/modules/ %endif @@ -216,7 +228,7 @@ rm /opt/swap/sdk %endif # BUILD_PACKAGE_TW3 -%if %{BUILD_PACKAGE_RPI3} +%if %{BUILD_PACKAGE_RPI3_ARM64} %package rpi3 Summary: SWAP modules for RPI3 Provides: swap-modules @@ -235,7 +247,29 @@ rm /opt/swap/sdk %files rpi3 %license LICENSE.GPL-2.0+ /opt/swap/modules/rpi3/ -%endif # BUILD_PACKAGE_RPI3 +%endif # BUILD_PACKAGE_RPI3_ARM64 + + +%if %{BUILD_PACKAGE_RPI3_ARM32} +%package rpi3-arm +Summary: SWAP modules for RPI3 +Provides: swap-modules +Provides: swap-modules = %{version}-%{release} +BuildRequires: arm-rpi3-linux-kernel-devel + +%description rpi3-arm +This package provides SWAP modules for RPI3 + +%post rpi3-arm +ln -s /opt/swap/modules/rpi3-arm32 /opt/swap/sdk + +%preun rpi3-arm +rm /opt/swap/sdk + +%files rpi3-arm +%license LICENSE.GPL-2.0+ +/opt/swap/modules/rpi3-arm32/ +%endif # BUILD_PACKAGE_RPI3_ARM32 %if %{BUILD_PACKAGE_ODROIDXU3} -- 2.7.4 From 9dbefa5688afe8ac2ba2a29d3410250b95f17bc0 Mon Sep 17 00:00:00 2001 From: Vyacheslav Cherkashin Date: Wed, 22 May 2019 17:12:40 +0900 Subject: [PATCH 11/16] Add support kernel v4.19 Change-Id: Id838ca74209cc3236db0768155aaabbd1e7e4e7e Signed-off-by: Vyacheslav Cherkashin --- modules/arch/arm/probes/compat_arm64.h | 7 +++++++ modules/master/wait.h | 14 ++++++++++++++ modules/parser/usm_msg.c | 20 ++++++++++++++++---- modules/uprobe/arch/arm64/swap-asm/swap_uprobes.c | 1 + 4 files changed, 38 insertions(+), 4 deletions(-) diff --git a/modules/arch/arm/probes/compat_arm64.h b/modules/arch/arm/probes/compat_arm64.h index e85766e..bf4d7b9 100644 --- a/modules/arch/arm/probes/compat_arm64.h +++ b/modules/arch/arm/probes/compat_arm64.h @@ -26,6 +26,13 @@ #ifdef CONFIG_ARM64 +# include +# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0) +# define COMPAT_PSR_MODE_MASK PSR_AA32_MODE_MASK +# define COMPAT_PSR_MODE_USR PSR_AA32_MODE_USR +# define COMPAT_PSR_T_BIT PSR_AA32_T_BIT +# endif /* #if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 19, 0) */ + # define PSR_T_BIT COMPAT_PSR_T_BIT # define ARM_r0 compat_usr(0) diff --git a/modules/master/wait.h b/modules/master/wait.h index e003027..a23f59c 100644 --- a/modules/master/wait.h +++ b/modules/master/wait.h @@ -32,6 +32,20 @@ int wait_on_atomic_t(atomic_t *val, int (*action)(atomic_t *), unsigned mode) # include #else /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 13, 0) */ # include +# if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) +# include +static inline void wake_up_atomic_t(atomic_t *val) +{ + wake_up_var(val); +} + +static inline int wait_on_atomic_t(atomic_t *val, int (*action)(atomic_t *), + unsigned mode) +{ + wait_var_event(val, !atomic_read(val)); + return 0; +} +# endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) */ #endif /* LINUX_VERSION_CODE */ #endif /* _SWAP_WAIT_H */ diff --git a/modules/parser/usm_msg.c b/modules/parser/usm_msg.c index 673fad7..cd96aea 100644 --- a/modules/parser/usm_msg.c +++ b/modules/parser/usm_msg.c @@ -69,9 +69,12 @@ static void kmem_info_fill_common(struct kmem_info *info, struct task_struct *ta static void kmem_info_fill(struct kmem_info *info, struct task_struct *task) { #if defined(CONFIG_ARM) +# if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) +# define VECTORS_BASE CONFIG_VECTORS_BASE +# endif /* LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) */ info->name = "[vectors]"; - info->start = CONFIG_VECTORS_BASE; - info->end = CONFIG_VECTORS_BASE + PAGE_SIZE; + info->start = VECTORS_BASE; + info->end = VECTORS_BASE + PAGE_SIZE; #elif defined(CONFIG_ARM64) if (test_ti_thread_flag(task_thread_info(task), TIF_32BIT)) { info->name = "[vectors]"; @@ -547,6 +550,16 @@ static int is_file_mode(umode_t mode) return S_ISREG(mode); } +static int do_kernel_getsockname(struct socket *sock, struct sockaddr *addr) +{ +#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) + return kernel_getsockname(sock, addr); +#else /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) */ + int addrlen; + return kernel_getsockname(sock, addr, &addrlen); +#endif /* LINUX_VERSION_CODE >= KERNEL_VERSION(4, 17, 0) */ +} + static int pack_osock(void *data, size_t size, int fd, struct file *file, loff_t fsize) { @@ -556,7 +569,6 @@ static int pack_osock(void *data, size_t size, int fd, struct file *file, struct sockaddr *saddr = (struct sockaddr *)&addr; struct sockaddr_in *sin = (struct sockaddr_in *)&addr; int ret_size = sizeof(*pack_sock); - int addrlen; int err; if (size < sizeof(*pack_sock)) @@ -570,7 +582,7 @@ static int pack_osock(void *data, size_t size, int fd, struct file *file, if (!sock) return 0; - kernel_getsockname(sock, saddr, &addrlen); + do_kernel_getsockname(sock, saddr); pack_sock = (struct osock *)data; pack_sock->fd = (u32)fd; diff --git a/modules/uprobe/arch/arm64/swap-asm/swap_uprobes.c b/modules/uprobe/arch/arm64/swap-asm/swap_uprobes.c index d5e2627..09ee042 100644 --- a/modules/uprobe/arch/arm64/swap-asm/swap_uprobes.c +++ b/modules/uprobe/arch/arm64/swap-asm/swap_uprobes.c @@ -22,6 +22,7 @@ #include #include +#include /* needed for asm/traps.h */ #include #include #include -- 2.7.4 From 151a05a5ad16ef6ec3ac86af6005cfddbed30a60 Mon Sep 17 00:00:00 2001 From: Dongkyun Son Date: Mon, 13 Jan 2020 19:23:36 +0900 Subject: [PATCH 12/16] Replace '-Werror' with '-w': Inhibit all warning messages. to ignore kernel warning on GCC9 e.g, include/linux/init.h:342:6: error: 'init_module' specifies less restrictive attribute than its target '__init_mod': 'cold' [-Werror=missing-attributes] [ 27s] 342 | int init_module(void) __attribute__((alias(#initfn))); [ 27s] | ^~~~~~~~~~~ Change-Id: I50242ccd7e154bcdc817d3912e7a20a03a6d8b5f Signed-off-by: Dongkyun Son --- modules/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/build.sh b/modules/build.sh index 5b1e3a5..0a3a9a0 100755 --- a/modules/build.sh +++ b/modules/build.sh @@ -76,7 +76,7 @@ else show_usage_and_exit fi -MCFLAGS="-Werror" +MCFLAGS="-w" CMDLINE_ARGS="" CMDLINE_ARGS="CROSS_COMPILE=${TOOLCHAIN} ARCH=${ARCH} -C ${KERNELDIR}" -- 2.7.4 From c7462563ff366408df34819a941ccb2c4f0ef234 Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Tue, 15 Nov 2022 11:51:54 +0900 Subject: [PATCH 13/16] packaging: Remove rpi3 board support From Tizen 7.5, rpi3 support and its build are removed. So remove swap-modules rpi3 support also. Change-Id: I9e87c269b0dbebde6c5fad45a5bcc539b2041b4a Signed-off-by: Seung-Woo Kim --- packaging/baselibs.conf | 7 ----- packaging/swap-modules.spec | 68 --------------------------------------------- 2 files changed, 75 deletions(-) diff --git a/packaging/baselibs.conf b/packaging/baselibs.conf index 96df1a9..3b2fbdb 100644 --- a/packaging/baselibs.conf +++ b/packaging/baselibs.conf @@ -20,10 +20,3 @@ swap-modules-tw3 post "ln -s /opt/swap/modules/tw3 /opt/swap/sdk" preun "rm /opt/swap/sdk" +/ - -swap-modules-rpi3 - provides "swap-modules" - provides "swap-modules = %{version}-%{release}" - post "ln -s /opt/swap/modules/rpi3 /opt/swap/sdk" - preun "rm /opt/swap/sdk" - +/ diff --git a/packaging/swap-modules.spec b/packaging/swap-modules.spec index 37b0a09..d66c54c 100755 --- a/packaging/swap-modules.spec +++ b/packaging/swap-modules.spec @@ -21,8 +21,6 @@ Kernel modules for SWAP %define BUILD_PACKAGE_TM2 1 %define BUILD_PACKAGE_TW2 1 %define BUILD_PACKAGE_TW3 1 -%define BUILD_PACKAGE_RPI3_ARM64 1 -%define BUILD_PACKAGE_RPI3_ARM32 1 %define BUILD_PACKAGE_ODROIDXU3 1 %define BUILD_PACKAGE_EMULATOR32 1 @@ -35,13 +33,11 @@ Kernel modules for SWAP %ifnarch %arm %define BUILD_PACKAGE_TM1 0 %define BUILD_PACKAGE_ODROIDXU3 0 - %define BUILD_PACKAGE_RPI3_ARM32 0 %endif %ifnarch aarch64 %define BUILD_PACKAGE_TM2 0 %define BUILD_PACKAGE_TW2 0 %define BUILD_PACKAGE_TW3 0 - %define BUILD_PACKAGE_RPI3_ARM64 0 %endif %if ! %{with emulator} %define BUILD_PACKAGE_EMULATOR32 0 @@ -79,18 +75,6 @@ cd modules ./pack.sh /tmp/modules/tw3 %endif -%if %{BUILD_PACKAGE_RPI3_ARM64} - ./build.sh --kernel /boot/kernel/devel/kernel-devel-arm64-rpi3 --arch arm64 clean - ./build.sh --kernel /boot/kernel/devel/kernel-devel-arm64-rpi3 --arch arm64 compile - ./pack.sh /tmp/modules/rpi3 -%endif - -%if %{BUILD_PACKAGE_RPI3_ARM32} - ./build.sh --kernel /boot/kernel/devel/kernel-devel-arm-rpi3 --arch arm clean - ./build.sh --kernel /boot/kernel/devel/kernel-devel-arm-rpi3 --arch arm compile - ./pack.sh /tmp/modules/rpi3-arm32 -%endif - %if %{BUILD_PACKAGE_ODROIDXU3} ./build.sh --kernel /boot/kernel/devel/kernel-devel-arm-odroidxu3 --arch arm clean ./build.sh --kernel /boot/kernel/devel/kernel-devel-arm-odroidxu3 --arch arm compile @@ -123,14 +107,6 @@ mkdir -p %{buildroot}/opt/swap/modules/ mv /tmp/modules/tw3 %{buildroot}/opt/swap/modules/ %endif -%if %{BUILD_PACKAGE_RPI3_ARM64} - mv /tmp/modules/rpi3 %{buildroot}/opt/swap/modules/ -%endif - -%if %{BUILD_PACKAGE_RPI3_ARM32} - mv /tmp/modules/rpi3-arm32 %{buildroot}/opt/swap/modules/ -%endif - %if %{BUILD_PACKAGE_ODROIDXU3} mv /tmp/modules/odroidxu3 %{buildroot}/opt/swap/modules/ %endif @@ -228,50 +204,6 @@ rm /opt/swap/sdk %endif # BUILD_PACKAGE_TW3 -%if %{BUILD_PACKAGE_RPI3_ARM64} -%package rpi3 -Summary: SWAP modules for RPI3 -Provides: swap-modules -Provides: swap-modules = %{version}-%{release} -BuildRequires: arm64-rpi3-linux-kernel-devel - -%description rpi3 -This package provides SWAP modules for RPI3 - -%post rpi3 -ln -s /opt/swap/modules/rpi3 /opt/swap/sdk - -%preun rpi3 -rm /opt/swap/sdk - -%files rpi3 -%license LICENSE.GPL-2.0+ -/opt/swap/modules/rpi3/ -%endif # BUILD_PACKAGE_RPI3_ARM64 - - -%if %{BUILD_PACKAGE_RPI3_ARM32} -%package rpi3-arm -Summary: SWAP modules for RPI3 -Provides: swap-modules -Provides: swap-modules = %{version}-%{release} -BuildRequires: arm-rpi3-linux-kernel-devel - -%description rpi3-arm -This package provides SWAP modules for RPI3 - -%post rpi3-arm -ln -s /opt/swap/modules/rpi3-arm32 /opt/swap/sdk - -%preun rpi3-arm -rm /opt/swap/sdk - -%files rpi3-arm -%license LICENSE.GPL-2.0+ -/opt/swap/modules/rpi3-arm32/ -%endif # BUILD_PACKAGE_RPI3_ARM32 - - %if %{BUILD_PACKAGE_ODROIDXU3} %package odroidxu3 Summary: SWAP modules for ODROIDXU3 -- 2.7.4 From f58ab430e367b438730417438d9de3bc5ca767d8 Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Thu, 17 Nov 2022 13:57:23 +0900 Subject: [PATCH 14/16] packaging: remove unused boards support Remove unused boards support. Odroid-XU3 and TM2 boards didn't support anymore. Before removing linux-exynos, it has to remove these packages. Change-Id: I84a850475c0f3c571a3f46c8b557833e91a0cae9 Signed-off-by: Jaehoon Chung --- packaging/baselibs.conf | 7 ----- packaging/swap-modules.spec | 70 --------------------------------------------- 2 files changed, 77 deletions(-) diff --git a/packaging/baselibs.conf b/packaging/baselibs.conf index 3b2fbdb..f39277f 100644 --- a/packaging/baselibs.conf +++ b/packaging/baselibs.conf @@ -1,12 +1,5 @@ arch aarch64 targets armv7l:aarch64 -swap-modules-tm2 - provides "swap-modules" - provides "swap-modules = %{version}-%{release}" - post "ln -s /opt/swap/modules/tm2 /opt/swap/sdk" - preun "rm /opt/swap/sdk" - +/ - swap-modules-tw2 provides "swap-modules" provides "swap-modules = %{version}-%{release}" diff --git a/packaging/swap-modules.spec b/packaging/swap-modules.spec index d66c54c..0f3fcb6 100755 --- a/packaging/swap-modules.spec +++ b/packaging/swap-modules.spec @@ -18,10 +18,8 @@ Kernel modules for SWAP # 0 - disable # 1 - enable %define BUILD_PACKAGE_TM1 1 -%define BUILD_PACKAGE_TM2 1 %define BUILD_PACKAGE_TW2 1 %define BUILD_PACKAGE_TW3 1 -%define BUILD_PACKAGE_ODROIDXU3 1 %define BUILD_PACKAGE_EMULATOR32 1 @@ -32,10 +30,8 @@ Kernel modules for SWAP %endif %ifnarch %arm %define BUILD_PACKAGE_TM1 0 - %define BUILD_PACKAGE_ODROIDXU3 0 %endif %ifnarch aarch64 - %define BUILD_PACKAGE_TM2 0 %define BUILD_PACKAGE_TW2 0 %define BUILD_PACKAGE_TW3 0 %endif @@ -57,12 +53,6 @@ cd modules ./pack.sh /tmp/modules/tm1 %endif -%if %{BUILD_PACKAGE_TM2} - ./build.sh --kernel /boot/kernel/devel/kernel-devel-arm64-tm2 --arch arm64 clean - ./build.sh --kernel /boot/kernel/devel/kernel-devel-arm64-tm2 --arch arm64 compile - ./pack.sh /tmp/modules/tm2 -%endif - %if %{BUILD_PACKAGE_TW2} ./build.sh --kernel /boot/kernel/devel/kernel-devel-tw2 --arch arm64 clean ./build.sh --kernel /boot/kernel/devel/kernel-devel-tw2 --arch arm64 compile @@ -75,12 +65,6 @@ cd modules ./pack.sh /tmp/modules/tw3 %endif -%if %{BUILD_PACKAGE_ODROIDXU3} - ./build.sh --kernel /boot/kernel/devel/kernel-devel-arm-odroidxu3 --arch arm clean - ./build.sh --kernel /boot/kernel/devel/kernel-devel-arm-odroidxu3 --arch arm compile - ./pack.sh /tmp/modules/odroidxu3 -%endif - %if %{BUILD_PACKAGE_EMULATOR32} ./build.sh --kernel /usr/src/linux-headers --arch i386 clean ./build.sh --kernel /usr/src/linux-headers --arch i386 compile @@ -95,10 +79,6 @@ mkdir -p %{buildroot}/opt/swap/modules/ mv /tmp/modules/tm1 %{buildroot}/opt/swap/modules/ %endif -%if %{BUILD_PACKAGE_TM2} - mv /tmp/modules/tm2 %{buildroot}/opt/swap/modules/ -%endif - %if %{BUILD_PACKAGE_TW2} mv /tmp/modules/tw2 %{buildroot}/opt/swap/modules/ %endif @@ -107,10 +87,6 @@ mkdir -p %{buildroot}/opt/swap/modules/ mv /tmp/modules/tw3 %{buildroot}/opt/swap/modules/ %endif -%if %{BUILD_PACKAGE_ODROIDXU3} - mv /tmp/modules/odroidxu3 %{buildroot}/opt/swap/modules/ -%endif - %if %{BUILD_PACKAGE_EMULATOR32} mv /tmp/modules/emulator32 %{buildroot}/opt/swap/modules/ %endif @@ -137,29 +113,6 @@ rm /opt/swap/sdk /opt/swap/modules/tm1/ %endif # BUILD_PACKAGE_TM1 - -%if %{BUILD_PACKAGE_TM2} -%package tm2 -Summary: SWAP modules for TM2 -Provides: swap-modules -Provides: swap-modules = %{version}-%{release} -BuildRequires: arm64-tm2-linux-kernel-devel - -%description tm2 -This package provides SWAP modules for TM2 - -%post tm2 -ln -s /opt/swap/modules/tm2 /opt/swap/sdk - -%preun tm2 -rm /opt/swap/sdk - -%files tm2 -%license LICENSE.GPL-2.0+ -/opt/swap/modules/tm2/ -%endif # BUILD_PACKAGE_TM2 - - %if %{BUILD_PACKAGE_TW2} %package tw2 Summary: SWAP modules for TW2 @@ -203,29 +156,6 @@ rm /opt/swap/sdk /opt/swap/modules/tw3/ %endif # BUILD_PACKAGE_TW3 - -%if %{BUILD_PACKAGE_ODROIDXU3} -%package odroidxu3 -Summary: SWAP modules for ODROIDXU3 -Provides: swap-modules -Provides: swap-modules = %{version}-%{release} -BuildRequires: arm-odroidxu3-linux-kernel-devel - -%description odroidxu3 -This package provides SWAP modules for ODROIDXU3 - -%post odroidxu3 -ln -s /opt/swap/modules/odroidxu3 /opt/swap/sdk - -%preun odroidxu3 -rm /opt/swap/sdk - -%files odroidxu3 -%license LICENSE.GPL-2.0+ -/opt/swap/modules/odroidxu3/ -%endif # BUILD_PACKAGE_ODROIDXU3 - - %if %{BUILD_PACKAGE_EMULATOR32} %package emulator32 Summary: SWAP modules for Emulator x86 -- 2.7.4 From 75b8c448a7928f2b969c1d5fb2917308c2ecd80a Mon Sep 17 00:00:00 2001 From: Seung-Woo Kim Date: Wed, 23 Nov 2022 13:42:32 +0900 Subject: [PATCH 15/16] packaging: remove unused tw2 board support The tw2 wearable target is replaced with tw3 and not used. Remove build for the tw2 board. Change-Id: Iee53d6bb29cbe5fbe13b435cd56c709bd4780ae8 Signed-off-by: Seung-Woo Kim --- packaging/baselibs.conf | 7 ------- packaging/swap-modules.spec | 34 ---------------------------------- 2 files changed, 41 deletions(-) diff --git a/packaging/baselibs.conf b/packaging/baselibs.conf index f39277f..c0a977c 100644 --- a/packaging/baselibs.conf +++ b/packaging/baselibs.conf @@ -1,12 +1,5 @@ arch aarch64 targets armv7l:aarch64 -swap-modules-tw2 - provides "swap-modules" - provides "swap-modules = %{version}-%{release}" - post "ln -s /opt/swap/modules/tw2 /opt/swap/sdk" - preun "rm /opt/swap/sdk" - +/ - swap-modules-tw3 provides "swap-modules" provides "swap-modules = %{version}-%{release}" diff --git a/packaging/swap-modules.spec b/packaging/swap-modules.spec index 0f3fcb6..8900c7a 100755 --- a/packaging/swap-modules.spec +++ b/packaging/swap-modules.spec @@ -18,7 +18,6 @@ Kernel modules for SWAP # 0 - disable # 1 - enable %define BUILD_PACKAGE_TM1 1 -%define BUILD_PACKAGE_TW2 1 %define BUILD_PACKAGE_TW3 1 %define BUILD_PACKAGE_EMULATOR32 1 @@ -32,7 +31,6 @@ Kernel modules for SWAP %define BUILD_PACKAGE_TM1 0 %endif %ifnarch aarch64 - %define BUILD_PACKAGE_TW2 0 %define BUILD_PACKAGE_TW3 0 %endif %if ! %{with emulator} @@ -53,12 +51,6 @@ cd modules ./pack.sh /tmp/modules/tm1 %endif -%if %{BUILD_PACKAGE_TW2} - ./build.sh --kernel /boot/kernel/devel/kernel-devel-tw2 --arch arm64 clean - ./build.sh --kernel /boot/kernel/devel/kernel-devel-tw2 --arch arm64 compile - ./pack.sh /tmp/modules/tw2 -%endif - %if %{BUILD_PACKAGE_TW3} ./build.sh --kernel /boot/kernel/devel/kernel-devel-tw3 --arch arm64 clean ./build.sh --kernel /boot/kernel/devel/kernel-devel-tw3 --arch arm64 compile @@ -79,10 +71,6 @@ mkdir -p %{buildroot}/opt/swap/modules/ mv /tmp/modules/tm1 %{buildroot}/opt/swap/modules/ %endif -%if %{BUILD_PACKAGE_TW2} - mv /tmp/modules/tw2 %{buildroot}/opt/swap/modules/ -%endif - %if %{BUILD_PACKAGE_TW3} mv /tmp/modules/tw3 %{buildroot}/opt/swap/modules/ %endif @@ -113,28 +101,6 @@ rm /opt/swap/sdk /opt/swap/modules/tm1/ %endif # BUILD_PACKAGE_TM1 -%if %{BUILD_PACKAGE_TW2} -%package tw2 -Summary: SWAP modules for TW2 -Provides: swap-modules -Provides: swap-modules = %{version}-%{release} -BuildRequires: kernel-devel-exynos7270-tw2 - -%description tw2 -This package provides SWAP modules for TW2 - -%post tw2 -ln -s /opt/swap/modules/tw2 /opt/swap/sdk - -%preun tw2 -rm /opt/swap/sdk - -%files tw2 -%license LICENSE.GPL-2.0+ -/opt/swap/modules/tw2/ -%endif # BUILD_PACKAGE_TW2 - - %if %{BUILD_PACKAGE_TW3} %package tw3 Summary: SWAP modules for TW3 -- 2.7.4 From 8e3a3086a5784f45f14787e70975a78fe83f6b7f Mon Sep 17 00:00:00 2001 From: Jaehoon Chung Date: Mon, 17 Jul 2023 10:15:22 +0900 Subject: [PATCH 16/16] packaging: Remove unused packages about TM1/TW3 Remove unused packags about TM1/TW3. TM1/TW3 is not supported anymore since Tizen8.0. Change-Id: Iee9a379649acba966d706624ed2e80c45d3283d9 Signed-off-by: Jaehoon Chung --- packaging/baselibs.conf | 8 ----- packaging/swap-modules.spec | 71 --------------------------------------------- 2 files changed, 79 deletions(-) delete mode 100644 packaging/baselibs.conf diff --git a/packaging/baselibs.conf b/packaging/baselibs.conf deleted file mode 100644 index c0a977c..0000000 --- a/packaging/baselibs.conf +++ /dev/null @@ -1,8 +0,0 @@ -arch aarch64 targets armv7l:aarch64 - -swap-modules-tw3 - provides "swap-modules" - provides "swap-modules = %{version}-%{release}" - post "ln -s /opt/swap/modules/tw3 /opt/swap/sdk" - preun "rm /opt/swap/sdk" - +/ diff --git a/packaging/swap-modules.spec b/packaging/swap-modules.spec index 8900c7a..32e2032 100755 --- a/packaging/swap-modules.spec +++ b/packaging/swap-modules.spec @@ -17,8 +17,6 @@ Kernel modules for SWAP # Setup build config. # 0 - disable # 1 - enable -%define BUILD_PACKAGE_TM1 1 -%define BUILD_PACKAGE_TW3 1 %define BUILD_PACKAGE_EMULATOR32 1 @@ -27,12 +25,6 @@ Kernel modules for SWAP %ifnarch %ix86 %define BUILD_PACKAGE_EMULATOR32 0 %endif -%ifnarch %arm - %define BUILD_PACKAGE_TM1 0 -%endif -%ifnarch aarch64 - %define BUILD_PACKAGE_TW3 0 -%endif %if ! %{with emulator} %define BUILD_PACKAGE_EMULATOR32 0 %endif @@ -45,18 +37,6 @@ Kernel modules for SWAP %build cd modules -%if %{BUILD_PACKAGE_TM1} - ./build.sh --kernel /boot/kernel/devel/kernel-devel-tizen_tm1 --arch arm clean - ./build.sh --kernel /boot/kernel/devel/kernel-devel-tizen_tm1 --arch arm compile - ./pack.sh /tmp/modules/tm1 -%endif - -%if %{BUILD_PACKAGE_TW3} - ./build.sh --kernel /boot/kernel/devel/kernel-devel-tw3 --arch arm64 clean - ./build.sh --kernel /boot/kernel/devel/kernel-devel-tw3 --arch arm64 compile - ./pack.sh /tmp/modules/tw3 -%endif - %if %{BUILD_PACKAGE_EMULATOR32} ./build.sh --kernel /usr/src/linux-headers --arch i386 clean ./build.sh --kernel /usr/src/linux-headers --arch i386 compile @@ -67,61 +47,10 @@ cd modules %install mkdir -p %{buildroot}/opt/swap/modules/ -%if %{BUILD_PACKAGE_TM1} - mv /tmp/modules/tm1 %{buildroot}/opt/swap/modules/ -%endif - -%if %{BUILD_PACKAGE_TW3} - mv /tmp/modules/tw3 %{buildroot}/opt/swap/modules/ -%endif - %if %{BUILD_PACKAGE_EMULATOR32} mv /tmp/modules/emulator32 %{buildroot}/opt/swap/modules/ %endif - -%if %{BUILD_PACKAGE_TM1} -%package tm1 -Summary: SWAP modules for TM1 -Provides: swap-modules -Provides: swap-modules = %{version}-%{release} -BuildRequires: kernel-devel-3.10-sc7730 - -%description tm1 -This package provides SWAP modules for TM1 - -%post tm1 -ln -s /opt/swap/modules/tm1 /opt/swap/sdk - -%preun tm1 -rm /opt/swap/sdk - -%files tm1 -%license LICENSE.GPL-2.0+ -/opt/swap/modules/tm1/ -%endif # BUILD_PACKAGE_TM1 - -%if %{BUILD_PACKAGE_TW3} -%package tw3 -Summary: SWAP modules for TW3 -Provides: swap-modules -Provides: swap-modules = %{version}-%{release} -BuildRequires: kernel-devel-exynos9110-tw3 - -%description tw3 -This package provides SWAP modules for TW3 - -%post tw3 -ln -s /opt/swap/modules/tw3 /opt/swap/sdk - -%preun tw3 -rm /opt/swap/sdk - -%files tw3 -%license LICENSE.GPL-2.0+ -/opt/swap/modules/tw3/ -%endif # BUILD_PACKAGE_TW3 - %if %{BUILD_PACKAGE_EMULATOR32} %package emulator32 Summary: SWAP modules for Emulator x86 -- 2.7.4