【问题标题】:Android Installing kernel with custom configAndroid 使用自定义配置安装内核
【发布时间】:2014-05-08 15:12:08
【问题描述】:

我想在我的三星 i9300 上安装不同的内核(启用了一些配置标志)

到目前为止,我已经安装了自定义 ROM

Slim-4.4.2.build.3-OFFICIAL-3091

到目前为止,它使用以下内核版本:

$ adb shell
shell@android:/ $ uname -a
Linux localhost 3.0.80+ #1 SMP PREEMPT Sat Feb 15 15:10:26 CET 2014 armv7l GNU/Linux

我创建 kernel.zip 的source 的内核版本有一个更新的版本:

.../kernel_samsung_smdk4412$ gedit Makefile 
VERSION = 3
PATCHLEVEL = 0
SUBLEVEL = 80
EXTRAVERSION =
NAME = Sneaky Weasel
...

我使用以下工具链成功构建了内核:

1)

git clone https://android.googlesource.com/platform/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7

2)

sudo gedit .bashrc

export PATH=${PATH}:~/arm-linux-androideabi-4.7/bin

3)

cd /kernel_samsung_smdk4412/

make clean -j4 ARCH=arm CROSS_COMPILE=arm-linux-androideabi-

make ARCH=arm CROSS_COMPILE=arm-linux-androideabi- slim_i9300_defconfig

make -j4 ARCH=arm CROSS_COMPILE=arm-linux-androideabi-

我使用this guide 创建可闪存的 zip 文件。 它使用 koush 的 AnyKernel 来安装带有 TWRP 2.6.3.1 的新内核

updater-script 到目前为止看起来像这样:

ui_print("AnyKernel Updater by Koush.");
ui_print("Extracting System Files...");
set_progress(1.000000);
mount("ext4", "EMMC", "/dev/block/mmcblk0p9", "/system");
package_extract_dir("system", "/system");
unmount("/system");
ui_print("Extracting Kernel files...");
package_extract_dir("kernel", "/tmp");
ui_print("Installing kernel...");
set_perm(0, 0, 0777, "/tmp/dump_image");
set_perm(0, 0, 0777, "/tmp/mkbootimg.sh");
set_perm(0, 0, 0777, "/tmp/mkbootimg");
set_perm(0, 0, 0777, "/tmp/unpackbootimg");
run_program("/tmp/dump_image", "boot", "/tmp/boot.img");
run_program("/tmp/unpackbootimg", "/tmp/boot.img", "/tmp/");
run_program("/tmp/mkbootimg.sh");
write_raw_image("/tmp/newboot.img", "boot");
ui_print("Done!");

由于我为 i9300 找到了 here 的内容,因此编辑了第 4 行。

当我通过 TWRP 刷新 zip 时,一切似乎都很好,但是当重新启动系统时,旧内核版本和安装日期显示在设置的“关于手机”部分中。

我错过了什么?

【问题讨论】:

  • 可能你没有覆盖内核。如果你想确定你可以查看 /proc/version 这是一个直接的内核接口,所以应该是确定的。
  • 感谢您的回复。当然我没有覆盖内核,那是我的问题!但我不知道为什么我没有。通过 TWRP 安装没有失败,所以安装似乎成功了。所以我很困惑。

标签: android linux-kernel


【解决方案1】:

我没有使用 AnyKernel 来刷新 zImage,而是使用 this guide 从 zImage 中创建了一个 boot.img,然后在我的 i9300 上通过 heimdall 刷新它:

user@ubuntu1210:~/bootimg_tools$ perl split_bootimg.pl boot.img


user@ubuntu1210:~/bootimg_tools$ perl unpack_ramdisk boot.img-ramdisk.gz ramdisk


user@ubuntu1210:~/bootimg_tools$ perl repack_ramdisk ramdisk boot.img-ramdisk.cpio.gz


user@ubuntu1210:~/bootimg_tools$ cp /home/user/kernel_samsung_smdk4412/arch/arm/boot/zImage boot.img-kernel


user@ubuntu1210:~/bootimg_tools$ ./mkbootimg --kernel boot.img-kernel --ramdisk boot.img-ramdisk.cpio.gz --cmdline 'console=null androidboot.hardware=qcom user_debug=31 zcache' --base 0x80200000 --pagesize 2048 -o boot.img


user@ubuntu1210:~/bootimg_tools$ adb reboot bootloader

user@ubuntu1210:~/bootimg_tools$ sudo heimdall flash --BOOT boot.img --verbose

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2014-05-03
    • 2023-03-16
    • 2012-03-10
    • 1970-01-01
    • 2018-10-06
    • 1970-01-01
    • 1970-01-01
    • 2016-09-26
    相关资源
    最近更新 更多