android4.4内核移植

时间:2023-03-10 01:12:06
android4.4内核移植

01 init/目录下Kconfig修改:

956行添加:

config PANIC_TIMEOUT
int "Default panic timeout"
default
help
Set default panic timeout.

02 drivers目录下Kconfig:

添加:

source "drivers/rongpin/Kconfig"

source "drivers/switch/Kconfig"

source "drivers/nfc/Kconfig"

source "drivers/gud/Kconfig"

03 drivers目录下Makefile:

添加:

obj-$(CONFIG_SWITCH)        += switch/
obj-$(CONFIG_MOBICORE_DRIVER) += gud/
obj-$(CONFIG_RPDZKJ_SYSFS) += rongpin/

04 drivers目录下:

将switch,gud,rongpin三个目录拷贝进来(对应原目录)

05

---------------------------------

法二:

(对比法)

荣品的内核源码和从官方下载的内核源码不一样的有如下文件:

一 :arch

01◐arch主目录下:

①除arm、config其他全部删除

②修改config文件,在最后一行:source "kernel/gcov/Kconfig"

添加:

config HAVE_ARCH_SECCOMP_FILTER
bool
help
An arch should select this symbol if it provides all of these things:
- syscall_get_arch()
- syscall_get_arguments()
- syscall_rollback()
- syscall_set_return_value()
- SIGSYS siginfo_t support
- secure_computing is called from a ptrace_event()-safe context
- secure_computing return value is checked and a return value of -
results in the system call being skipped immediately. config SECCOMP_FILTER
def_bool y
depends on HAVE_ARCH_SECCOMP_FILTER && SECCOMP && NET
help
Enable tasks to build secure computing environments defined
in terms of Berkeley Packet Filter programs which implement
task-defined system call filtering polices. See Documentation/prctl/seccomp_filter.txt for details. source "kernel/gcov/Kconfig"

02◐在arch/arm/configs下添加:

①exynos5_defconfig

二:block

1 blk-core.c文件:

①32行添加:

#include <linux/ratelimit.h>  //add by phone at 20151117

②2122行:

switch (error) {
case -ENOLINK:
error_type = "recoverable transport";
break;
case -EREMOTEIO:
error_type = "critical target";
break;
case -EBADE:
error_type = "critical nexus";
break;
case -EIO:
default:
error_type = "I/O";
break;
}
printk(KERN_ERR "end_request: %s error, dev %s, sector %llu\n",
error_type, req->rq_disk ? req->rq_disk->disk_name : "?",
(unsigned long long)blk_rq_pos(req));
}

换成:

switch (error) {
case -ENOLINK:
error_type = "recoverable transport";
break;
case -EREMOTEIO:
error_type = "critical target";
break;
case -EBADE:
error_type = "critical nexus";
break;
case -ETIMEDOUT:
error_type = "timeout";
break;
case -ENOSPC:
error_type = "critical space allocation";
break;
case -ENODATA:
error_type = "critical medium";
break;
case -EIO:
default:
error_type = "I/O";
break;
}
printk_ratelimited(KERN_ERR "end_request: %s error, dev %s, sector %llu\n",
error_type, req->rq_disk ?
req->rq_disk->disk_name : "?",
(unsigned long long)blk_rq_pos(req)); }

2 partition-genneric.c文件下:

①219行,添加:

static int part_uevent(struct device *dev, struct kobj_uevent_env *env)
{
struct hd_struct *part = dev_to_part(dev); add_uevent_var(env, "PARTN=%u", part->partno);
if (part->info && part->info->volname[])
add_uevent_var(env, "PARTNAME=%s", part->info->volname);
return ;
}

②233行添加:

.uevent        = part_uevent,

三:drivers

1 Makefile:

103行添加:

obj-$(CONFIG_SWITCH)        += switch/

139行(最后添加):

obj-$(CONFIG_MOBICORE_DRIVER)    += gud/
obj-$(CONFIG_RPDZKJ_SYSFS) += rongpin/

2 Kconfig:

第3行添加:

source "drivers/rongpin/Kconfig"   //add by phone at 20151117

第100行添加:

source "drivers/switch/Kconfig"   //add by phone at 20151117

第146行添加:

source "drivers/nfc/Kconfig"

source "drivers/gud/Kconfig"

3 将

四:include

五:kernel

六:lib

七:mm

八:net

九:security

------------------