make menuconfig changes are reset after running make mrproper.

2,184 views
Skip to first unread message

John Gentilin

unread,
Apr 4, 2013, 8:04:34 PM4/4/13
to cubie...@googlegroups.com
I am trying to build an Android image from the Cubieboard-OpenTv tar file that has GPIO support.
Any of the images I have tried to load so far do not have the
gpio_sunxi module in /system/lib/modules.
I have successfully built and loaded a stock kernel / image from the tar file.

To build a custom kernel, I go to the kernel/cubieboard/common directory, run make menuconfig,
then enable the Device Drivers / Misc Drivers / An ugly sun4i gpio driver. After exiting menuconfig,
I run it again to make sure it was saved, then I run make mrproper but after building the image,
the module is still missing.

If I go back to make menuconfig, I see that my setting for the gpio driver has been reset and it
appears that the reset occurs after running "make mrproper"

Am I doing something wrong here ?

Is the version of the code base more up to date if I pull it from repo, "the google way" or should
it be the same code as what is in the tar file ?

Thank you
John Gentilin

John Gentilin

unread,
Apr 4, 2013, 9:34:00 PM4/4/13
to cubie...@googlegroups.com
So it appears in a normal Linux build, you are supposed to run "make mrproper" prior to "make menuconfig"
since make mrproper deletes the current .config but... If I use the sequence, make mrproper, make menuconfig
then go back to the src root directory and run make -j4, it will complain that I need to make mrproper to continue..

it ultimately fails trying to run this command from the kernel directory
scripts/kconfig/conf --silentoldconfig Kconfig

but at the time of execution, the conf program does not seem to exist there
is a conf.c source file there though,


Here is the output of the compile
CEDARX_PRODUCTOR: GENERIC                  
build/core/Makefile:27: warning: overriding commands for target `out/target/product/cubieboard/system/etc/wifi/wpa_supplicant.conf'                                                                                                                
build/core/base_rules.mk:523: warning: ignoring old commands for target `out/target/product/cubieboard/system/etc/wifi/wpa_supplicant.conf'                                                                                                        
No private recovery resources for TARGET_DEVICE cubieboard                                                               
build/core/tasks/kernel.mk:161: warning: overriding commands for target `out/target/product/cubieboard/kernel'           
build/core/Makefile:27: warning: ignoring old commands for target `out/target/product/cubieboard/kernel'                 
make -C kernel/allwinner/common O=/home/gentijo/android/cubieboard-tv-sdk/out/target/product/cubieboard/obj/KERNEL_OBJ ARCH=arm CROSS_COMPILE=" /home/gentijo/android/cubieboard-tv-sdk/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-" cubieboard_defconfig
make[1]: Entering directory `/home/gentijo/android/cubieboard-tv-sdk/kernel/allwinner/common'
#
# configuration written to .config
#
make[1]: Leaving directory `/home/gentijo/android/cubieboard-tv-sdk/kernel/allwinner/common'
make -C kernel/allwinner/common O=/home/gentijo/android/cubieboard-tv-sdk/out/target/product/cubieboard/obj/KERNEL_OBJ ARCH=arm CROSS_COMPILE=" /home/gentijo/android/cubieboard-tv-sdk/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-" headers_install
make[1]: Entering directory `/home/gentijo/android/cubieboard-tv-sdk/kernel/allwinner/common'
  CHK     include/linux/version.h
make[1]: Leaving directory `/home/gentijo/android/cubieboard-tv-sdk/kernel/allwinner/common'
make -C kernel/allwinner/common O=/home/gentijo/android/cubieboard-tv-sdk/out/target/product/cubieboard/obj/KERNEL_OBJ ARCH=arm CROSS_COMPILE=" /home/gentijo/android/cubieboard-tv-sdk/prebuilt/linux-x86/toolchain/arm-eabi-4.4.3/bin/arm-eabi-" zImage
make[1]: Entering directory `/home/gentijo/android/cubieboard-tv-sdk/kernel/allwinner/common'
scripts/kconfig/conf --silentoldconfig Kconfig
  Using /home/gentijo/android/cubieboard-tv-sdk/kernel/allwinner/common as source for kernel
  /home/gentijo/android/cubieboard-tv-sdk/kernel/allwinner/common is not clean, please run 'make mrproper'
  in the '/home/gentijo/android/cubieboard-tv-sdk/kernel/allwinner/common' directory.
make[2]: *** [prepare3] Error 1
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory `/home/gentijo/android/cubieboard-tv-sdk/kernel/allwinner/common'
make: *** [TARGET_KERNEL_BINARIES] Error 2

Emilio López

unread,
Apr 4, 2013, 10:08:08 PM4/4/13
to cubie...@googlegroups.com, John Gentilin
Hi,

El 04/04/13 22:34, John Gentilin escribi�:
> So it appears in a normal Linux build, you are supposed to run "make
> mrproper" prior to "make menuconfig"
> since make mrproper deletes the current .config but... If I use the
> sequence, make mrproper, make menuconfig
> then go back to the src root directory and run make -j4, it will
> complain that I need to make mrproper to continue..
>

After configuring your kernel, run

cp .config arch/arm/configs/cubieboard_defconfig

then run make mrproper and after that, build android, and it should
build with your customized kernel configuration.

John Gentilin

unread,
Apr 5, 2013, 1:21:19 AM4/5/13
to cubie...@googlegroups.com
Hi Emillo,

After examining the build script some more, I noticed that the config was being referenced
from the arch/arm/configs/cubieboard_defconfig, actually I think the .config file I was creating
was actually wrong because menuconfig pulls a default config of x86 when there is not existing
.config.

I looked at the config in arch/arm/configs/cubieboard_defconfig and to my surprise the GPIO module is
enabled already but after I build there is no sun4i-gpio.ko, in the out/target/product/cubieboard/system/lib/modules
directory but there is a .o file in the out/target/product/cubieboard/obj/KERNEL_OBJ/drivers/misc driver.
The only kernel module in the modules directory is the sun4i_csi0.ko

Later I noticed that the cubieboard_defconfig defines, CONFIG_SUN4I_GPIO_UGLY=y which should
compile the module as a builtin module which was later confirmed by looking at the modules.builtin
list in the out/target/product/cubieboard/obj/KERNEL_OBJ directory.

I decided to redefine it to be a module just to proved my theory, so I set the cubieboard_defconfig
to have the entry CONFIG_SUN4I_GPIO_UGLY=m, then did a make mrproper at the kernel level
and a make -j4 a the top level. It recompiled the kernel code, but there still wasn't a sun4i-gpio.ko
in the out/target/product/cubieboard/system/lib/module directory. The module was still listed as
a builtin module..

Does it sound like I did something wrong to not get the loadable module ?

-John Gentilin



On Thursday, April 4, 2013 5:04:34 PM UTC-7, John Gentilin wrote:

John Gentilin

unread,
Apr 5, 2013, 2:32:15 AM4/5/13
to cubie...@googlegroups.com
I figured it out, I happened to make a copy of the cubieboard_defconfig file and stored it
at the top of the kernel directory. The make script found that version first before the one
I edited.

Thank you for your help

-John Gentilin

On Thursday, April 4, 2013 5:04:34 PM UTC-7, John Gentilin wrote:
Message has been deleted

Alan Nuñez Dalleto

unread,
Apr 12, 2013, 12:04:11 AM4/12/13
to cubie...@googlegroups.com
Dear John,

You managed to add more functions to the kernel? (GPIO) as you made?

Greetings from Chile.

John Gentilin

unread,
Apr 12, 2013, 2:50:57 AM4/12/13
to cubie...@googlegroups.com
Yes, sort of.. When I started, the GPIO driver did not show up as a module in lsmod
so I assumed it was not compiled in. The end reason was that the module was compiled
as a built in and not a loadable module. The key to getting GPIO to work was to modify the
script.bin file  in the nanda partition.

I was able to compile the GPIO driver as a module vs a built in. To do that you need to
edit the cubieboard_defconfig in the kernel/allwinner/common/arch/arm/configs directory.
I tried to copy that file to the .config file at the top of the kernel directory and use make
menuconfig to edit it, but it did not seem to work. The effect I saw was that make menuconfig
reverted the file back to the default x86 target. The file is not that complex, so you can really
just edit the cubieboard_defconfig in place.

I was able to edit and convert the GPIO module to a loadable module, build the image
deploy and use insmod to load the module on the Cubieboard which was a useful exercise
because now I feel comfortable editing the GPIO module to do a different task and deploy
that kernel

The bottom line, edit the config file in place, then run make mrproper in the top kernel
directory and build the image from the top src directory. Your changes should make it
into the image.

-John Gentilin

Alan Nuñez Dalleto

unread,
Apr 23, 2013, 8:28:58 PM4/23/13
to cubie...@googlegroups.com
Thank you very much for the info but still can not get done.
When compiling android with GPIO driver as a module "SUN4I_GPIO_UGLY = m" create errors at the end of compilation, but if I make the kernel "SUN4I_GPIO_UGLY = y" compiles without problems.
Your you made the compilation with the Source code tarball (Android 4.0.4 + linux-3.0.52)?

All information there on the internet regarding GPIO not for android which makes it difficult to learn for yourself.

If I access the GPIO port on android creare a guide, but I need help for this.

Greetings from Chile.
Message has been deleted

tvsa...@gmail.com

unread,
May 7, 2013, 6:40:21 AM5/7/13
to cubie...@googlegroups.com
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- cubieboard_defconfig menuconfig # this will make valid .config && runs valid make menuconfig

cp .config arch/arm/configs/cubieboard_defconfig # this will copy config to  valid dir for buildind android img

make mrproper #  this will clean .config etc.  (may be "make clean" wiil quickly, you can check it yourself) 

Reply all
Reply to author
Forward
0 new messages