What's the correct way to customize kernel config?

262 views
Skip to first unread message

Hongwei Qin

unread,
Sep 7, 2019, 8:05:54 AM9/7/19
to Android-x86
I'm following https://www.android-x86.org/documentation/customize_kernel.html to customize my kernel configuration. However failed.
Here's my workflow (branch Oreo-x86):

cd aosp-x86
source build/envsetup.sh
lunch android_x86_64-userdebug
/usr/bin/make -C kernel O=$OUT/obj/kernel ARCH=x86 menuconfig

Make F2FS build-in. (CONFIG_F2FS=y)

cp $OUT/obj/kernel/.config kernel/arch/x86/configs/QHWconfig
cat kernel/arch/x86/configs/QHWconfig | grep F2FS

showing CONFIG_F2FS_FS=y

make iso_img TARGET_PRODUCT=android_x86 TARGET_KERNEL_CONFIG=QHWconfig

After installed, I boot android with debug mode.
Then:

zcat /proc/config.gz | grep F2FS

It shows me that 'CONFIG_F2FS_FS=m'. This means that the make operation didn't use the config file that I chose.
Any ideas?

BTW, the reason I use /usr/bin/make -C kernel O=$OUT/obj/kernel ARCH=x86 menuconfig instead of make -C kernel O=$OUT/obj/kernel ARCH=x86 menuconfig is that the later will generate an error. I've issued a pull request to https://github.com/android-x86/android-x86.github.io. Please review it, thanks.

Michael Goffioul

unread,
Sep 7, 2019, 8:45:26 AM9/7/19
to andro...@googlegroups.com
Usually I just edit the config files in kernel/arch/x86/configs/ then run "make iso_img".


--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-x86...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/android-x86/eb77a7b1-12e9-4ceb-b788-dc2f81e2a0a0%40googlegroups.com.

Hongwei Qin

unread,
Sep 8, 2019, 9:43:39 AM9/8/19
to Android-x86
Haha, that's a good way indeed.


On Saturday, September 7, 2019 at 8:45:26 PM UTC+8, Michael Goffioul wrote:
Usually I just edit the config files in kernel/arch/x86/configs/ then run "make iso_img".


On Sat, Sep 7, 2019, 8:05 AM Hongwei Qin <glqinh...@gmail.com> wrote:
I'm following https://www.android-x86.org/documentation/customize_kernel.html to customize my kernel configuration. However failed.
Here's my workflow (branch Oreo-x86):

cd aosp-x86
source build/envsetup.sh
lunch android_x86_64-userdebug
/usr/bin/make -C kernel O=$OUT/obj/kernel ARCH=x86 menuconfig

Make F2FS build-in. (CONFIG_F2FS=y)

cp $OUT/obj/kernel/.config kernel/arch/x86/configs/QHWconfig
cat kernel/arch/x86/configs/QHWconfig | grep F2FS

showing CONFIG_F2FS_FS=y

make iso_img TARGET_PRODUCT=android_x86 TARGET_KERNEL_CONFIG=QHWconfig

After installed, I boot android with debug mode.
Then:

zcat /proc/config.gz | grep F2FS

It shows me that 'CONFIG_F2FS_FS=m'. This means that the make operation didn't use the config file that I chose.
Any ideas?

BTW, the reason I use /usr/bin/make -C kernel O=$OUT/obj/kernel ARCH=x86 menuconfig instead of make -C kernel O=$OUT/obj/kernel ARCH=x86 menuconfig is that the later will generate an error. I've issued a pull request to https://github.com/android-x86/android-x86.github.io. Please review it, thanks.

--
You received this message because you are subscribed to the Google Groups "Android-x86" group.
To unsubscribe from this group and stop receiving emails from it, send an email to andro...@googlegroups.com.

Chih-Wei Huang

unread,
Sep 9, 2019, 12:48:29 AM9/9/19
to Android-x86
Hongwei Qin <glqinh...@gmail.com> 於 2019年9月7日 週六 下午8:05寫道:
>
> BTW, the reason I use /usr/bin/make -C kernel O=$OUT/obj/kernel ARCH=x86 menuconfig instead of make -C kernel O=$OUT/obj/kernel ARCH=x86 menuconfig is that the later will generate an error. I've issued a pull request to https://github.com/android-x86/android-x86.github.io. Please review it, thanks.

Thanks! That's because since Android 8 the build system
overrides the make command of the system by its own
make function (to invoke soong rules) which
doesn't recognize the -C option.
I'll add more explanation.


--
Chih-Wei
Android-x86 project
http://www.android-x86.org

Hongwei Qin

unread,
Sep 9, 2019, 10:13:24 AM9/9/19
to andro...@googlegroups.com
The modification of android 8 build system may be an issue for kernel
development.
E.g. I've modified some f2fs source files. Simply using `m -j48
iso_img` to rebuild the image doesn't work. Since the building system
is not sensitive to the modified files.
`echo " " >> kernel/fs/f2fs/Makefile` doesn't work either.
I'm currently using `echo " " >> android-x86_64_defconfig` to force
whole kernel rebuild, which is very time consuming.
Any better solutions?
> --
> You received this message because you are subscribed to the Google Groups "Android-x86" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to android-x86...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/android-x86/CAKc24n0d3HS%3Dj06tHNaZ%2BHz9kLapG8PQdr9ZWh95yV6GF6fWGg%40mail.gmail.com.
Message has been deleted

Chih-Wei Huang

unread,
Sep 9, 2019, 11:38:14 PM9/9/19
to Android-x86
Hongwei Qin <glqinh...@gmail.com> 於 2019年9月9日 週一 下午10:13寫道:
>
> The modification of android 8 build system may be an issue for kernel
> development.
> E.g. I've modified some f2fs source files. Simply using `m -j48
> iso_img` to rebuild the image doesn't work. Since the building system
> is not sensitive to the modified files.
> `echo " " >> kernel/fs/f2fs/Makefile` doesn't work either.
> I'm currently using `echo " " >> android-x86_64_defconfig` to force
> whole kernel rebuild, which is very time consuming.
> Any better solutions?

That's a well-known issue or limitation of the two build systems
(nothing to do with Android 8).
You could trigger kernel rebuilding by

rm $OUT/obj/kernel/.config

or

rm $OUT/kernel
Reply all
Reply to author
Forward
0 new messages