New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !
B2 Building a Custom kernel - menuconfig issue
B2 Building a Custom kernel - menuconfig issue
Hi,
On my Bubba 2 I have installed Wheezy system, without Bubba packages except the kernel.
The kernel is:
Linux b2 3.2.62-1 #1 Mon Aug 25 04:22:40 UTC 2014 ppc GNU/Linux
I want to customize it so it support the rtl8192cu kernel module.
I downloaded the kernel source from here:
https://codeload.github.com/Excito/comm ... 253.2.62-1
and follow the steps described here:
http://wiki.mybubba.org/wiki/index.php? ... tom_kernel
from the header: Customizing the kernel.
When I'm trying to
Load an Alternate Configuration File and enter the following path:
arch/powerpc/configs/bubbatwo_defconfig
I just can't to alter in the textfield the default '.config' filename.
However, there is not any bubbatwo_defconfig file out there.
So how to go further to build my custom kernel?
On my Bubba 2 I have installed Wheezy system, without Bubba packages except the kernel.
The kernel is:
Linux b2 3.2.62-1 #1 Mon Aug 25 04:22:40 UTC 2014 ppc GNU/Linux
I want to customize it so it support the rtl8192cu kernel module.
I downloaded the kernel source from here:
https://codeload.github.com/Excito/comm ... 253.2.62-1
and follow the steps described here:
http://wiki.mybubba.org/wiki/index.php? ... tom_kernel
from the header: Customizing the kernel.
When I'm trying to
Load an Alternate Configuration File and enter the following path:
arch/powerpc/configs/bubbatwo_defconfig
I just can't to alter in the textfield the default '.config' filename.
However, there is not any bubbatwo_defconfig file out there.
So how to go further to build my custom kernel?
Best, Pali
Re: B2 Building a Custom kernel - menuconfig issue
The source you got is a debian source package and is meant to be compiled using 'debuild'. To create a regular source from this you need to:
- apply the patches in the debian/patches folder (in order)
- edit the version info in Makefile to match your current installed kernel
- load the b2-config (which gets created by running the patches)
- enable the module(s) you require
- run make - check link below
Re: B2 Building a Custom kernel - menuconfig issue
Hi,
As Gordon said the package is meant to be built with debian tools. Besides the wiki page needs a serious refresh. Here are some detailed instructions for quickly rebuilding the kernel :
The instructions provided below applies only to this specific version (3.2.62-1). I will update the wiki page with more generic instructions once the excito kernel repository will be usable.
There are two ways to build a custom kernel from this source : the quick, ugly and efficient way - no debian package (which I will detail here) and the more proper way which generates a debian package (which will be refreshed in the wiki later).
To compile a kernel (quick-and-dirty) :
As Gordon said the package is meant to be built with debian tools. Besides the wiki page needs a serious refresh. Here are some detailed instructions for quickly rebuilding the kernel :
The instructions provided below applies only to this specific version (3.2.62-1). I will update the wiki page with more generic instructions once the excito kernel repository will be usable.
There are two ways to build a custom kernel from this source : the quick, ugly and efficient way - no debian package (which I will detail here) and the more proper way which generates a debian package (which will be refreshed in the wiki later).
To compile a kernel (quick-and-dirty) :
- Install dependencies as described in part 'Installing the compilation tools' of the wiki (that part is true)
- Fecth the source from the github tag and apply this patchset :
Code: Select all
patch -Np1 -i debian/patches/0002-Settings-for-marvell-88e1116.patch patch -Np1 -i debian/patches/0003-Marvell-reverse-led-fix.patch patch -Np1 -i debian/patches/0004-Excito-B3-board.patch patch -Np1 -i debian/patches/0005-Ath-regd-optional.patch patch -Np1 -i debian/patches/0006-vsc8601_and_clockskewfix.patch patch -Np1 -i debian/patches/0007-Excito-B2-board.patch patch -Np1 -i debian/patches/0008-Excito-B3-config.patch patch -Np1 -i debian/patches/0009-Excito-B2-config.patch
- You want to compile a b2 kernel, so prepare the environnment :
Code: Select all
export ARCH=powerpc export CROSS_COMPILE=powerpc-linux-gnu-
- Import the b2 configuration :
Code: Select all
make bubbatwo_defconfig
- Personalize the config
Code: Select all
make menuconfig
- Compile the kernel and the modules (add -jX flags to speed up the build if multiple cores available) :
Code: Select all
make uImage make modules
- Create an output directory and install the files there :
Code: Select all
mkdir -p output/boot cp arch/powerpc/boot/uImage output/boot make INSTALL_MOD_PATH=$(pwd)/output modules_install
Re: B2 Building a Custom kernel - menuconfig issue
My problem still exist, namely, in the menuconfig at the step:MouettE wrote: [*]Personalize the configCode: Select all
make menuconfig
Load an Alternate Configuration File
I just can't to alter in the textfield the default '.config' filename and substitute the default '.config' filename with desired 'arch/powerpc/configs/bubbatwo_defconfig'.
Why?
Best, Pali
Re: B2 Building a Custom kernel - menuconfig issue
You don't need to load an alternate config file ; just follow the steps in my post above and forget about the wiki page (except the part 'Installing the compilation tools' to install necessary tools).
Re: B2 Building a Custom kernel - menuconfig issue
OK I will do that today.MouettE wrote:You don't need to load an alternate config file ; just follow the steps in my post above and forget about the wiki page (except the part 'Installing the compilation tools' to install necessary tools).
But I have Bubba 2.
And I do these steps on my Bubba 2.
Shall I install it as you adviced me, namely to just copy the contents of output inside the root of my Bubba 2? Is these last steps for Bubba 2 the same as for Bubba 3?
Best, Pali
Re: B2 Building a Custom kernel - menuconfig issue
If you build directly on your b2 (or your b3) do not define the ARCH and CROSS_COMPILE environment variables. The steps are very similar between the b2 and the b3 ; the configuration file is obviously different and the uImage will be inside arch/arm/boot for the b3 and arch/powerpc/boot for the b2.
Again this is a quick-and-dirty howto so copying the contents of the output folder inside the root of you b2/b3 is not a by-the-book way to install things on a debian system but it will definitely work. As I said do not forget to backup the original /boot/uImage in case your version doesn't boot.
Again this is a quick-and-dirty howto so copying the contents of the output folder inside the root of you b2/b3 is not a by-the-book way to install things on a debian system but it will definitely work. As I said do not forget to backup the original /boot/uImage in case your version doesn't boot.
Re: B2 Building a Custom kernel - menuconfig issue
I did backup the original uImage from the /boot/ directory into a subdirectory in my $HOME/ directory on Bubba 2.MouettE wrote: Voilà you now have a kernel with modules in output. To install it on your b3 just copy the contents of output inside the root of your b3. I strongly recommend to backup the original /boot/uImage file in case you need to go back. If everything is satisfactory, I suggest you remove the kernel package (switch the uImage files before or it will remove your new kernel ; after replace the new uImage file in /boot).
I have now the new kernel uImage in the output/boot/ directory and the new kernel modules in the output/lib/ directory.
I shall now copy these from output/ directory into root of my Bubba 2.
After that I shall reboot my Bubba 2.
What I don't understand here is the sentence 'I suggest you remove the kernel package'
After the
Code: Select all
make uImage
Image Name: Linux-3.2.62
but I have installed the original kernel Linux-3.2.62-1 yet.
So you recommend me to remove the original Linux-3.2.62-1 kernel after reboot with the new kernel uImage?
Second, I don't understand the part '(switch the uImage files before or it will remove your new kernel ; after replace the new uImage file in /boot).'
Please explain it to me.
Best, Pali
Re: B2 Building a Custom kernel - menuconfig issue
If your custom kernel works as expected you should remove the kernel package because it conflicts with your files (the /boot/uImage file). That's my advice but it's not necessary ; however it will prevent some package problems in the future.paulchany wrote:What I don't understand here is the sentence 'I suggest you remove the kernel package'
That's normal ; the appended '-1' indicated a debian build-and-packaged kernel whereas yours is manually build.paulchany wrote:Image Name: Linux-3.2.62
but I have installed the original kernel Linux-3.2.62-1 yet.
These are related ; once you have rebooted yout b2 with your kernel and verified it's working properly perform these steps to remove the original kernel package :paulchany wrote:So you recommend me to remove the original Linux-3.2.62-1 kernel after reboot with the new kernel uImage?
Second, I don't understand the part '(switch the uImage files before or it will remove your new kernel ; after replace the new uImage file in /boot).'
Please explain it to me.
- Backup your NEW /boot/uImage somewhere
- Restore the PREVIOUS uImage in /boot
- remove the bubba3-kernel package with apt-get
- Restore the NEW uImage into /boot
Re: B2 Building a Custom kernel - menuconfig issue
Note of caution:
If you remove the 'bubba3-kernel' package, it will also remove the associated modules. The above therefore should only be done if you're creating an entirely new kernel and its modules. If you're building this on the B2 itself, be prepared that it will take several hours to complete. My suggestion is that you look at that previous link I posted and simply build the module you require.
I don't really know why you can't change what config file you want to use during 'make menuconfig' (are you root?), but you could simply copy bubba2-defconfig to .config prior to starting 'make'. Just do not forget to edit 'Makefile' and set the appropriate value for 'extraversion' (i.e. '-1') in the top of the file.
If you remove the 'bubba3-kernel' package, it will also remove the associated modules. The above therefore should only be done if you're creating an entirely new kernel and its modules. If you're building this on the B2 itself, be prepared that it will take several hours to complete. My suggestion is that you look at that previous link I posted and simply build the module you require.
I don't really know why you can't change what config file you want to use during 'make menuconfig' (are you root?), but you could simply copy bubba2-defconfig to .config prior to starting 'make'. Just do not forget to edit 'Makefile' and set the appropriate value for 'extraversion' (i.e. '-1') in the top of the file.
Re: B2 Building a Custom kernel - menuconfig issue
It is completely independent of whether I'm root or not ( I tried booth ), in menuconfig I just can't to alter the '.config' filename. Is this the case only on my Bubba 2, or on all Bubba 2 ??Gordon wrote:Note of caution:
If you remove the 'bubba3-kernel' package, it will also remove the associated modules. The above therefore should only be done if you're creating an entirely new kernel and its modules. If you're building this on the B2 itself, be prepared that it will take several hours to complete. My suggestion is that you look at that previous link I posted and simply build the module you require.
I don't really know why you can't change what config file you want to use during 'make menuconfig' (are you root?), but you could simply copy bubba2-defconfig to .config prior to starting 'make'. Just do not forget to edit 'Makefile' and set the appropriate value for 'extraversion' (i.e. '-1') in the top of the file.
In Makefile I think the 'extraversion' should be '1', and not '-1'; I set it this way:
Code: Select all
EXTRAVERSION = 1
I stuck at step:
So, what should I edit in these files? ( Naturally, I must to edit some other files because my module is different. )Each editThese are for the edits.Code: Select all
$ cd ~/linux-3.13.0/drivers/scsi/mvsas $ nano mv_sas.h $ nano mv_sas.c
Best, Pali
Re: B2 Building a Custom kernel - menuconfig issue
'-1' is the correct value. This is because extravalue can be anything, from '.1' to ' -1' to '+abc'.
As for editing source code, that doesn't apply to you. The interesting part is this:
In which 'build' is supposed to be a symlink to the kernel source code, but does not exist in the Debian binary release (because it is a binary release, meaning there is no source code to point to).
In your case you could simplify this to:
This should create and install the module files rtl8192c-common.ko, rtl8192cu.ko, rtl_usb.ko and rtlwifi.ko. Don't know the speed of a B2, but this will probably take about 5 minutes to compile.
As for editing source code, that doesn't apply to you. The interesting part is this:
Code: Select all
make -C /lib/modules/$(uname -r)/build M=$(pwd) modules
make -C /lib/modules/$(uname -r)/build M=$(pwd) modules_install
In your case you could simplify this to:
Code: Select all
make menuconfig
make prepare
make M=$(pwd)/drivers/net/wireless/rtlwifi modules
make M=$(pwd)/drivers/net/wireless/rtlwifi modules_install
Re: B2 Building a Custom kernel - menuconfig issue
OKGordon wrote:'-1' is the correct value. This is because extravalue can be anything, from '.1' to ' -1' to '+abc'.
As for editing source code, that doesn't apply to you. The interesting part is this:In which 'build' is supposed to be a symlink to the kernel source code, but does not exist in the Debian binary release (because it is a binary release, meaning there is no source code to point to).Code: Select all
make -C /lib/modules/$(uname -r)/build M=$(pwd) modules make -C /lib/modules/$(uname -r)/build M=$(pwd) modules_install
In your case you could simplify this to:This should create and install the module files rtl8192c-common.ko, rtl8192cu.ko, rtl_usb.ko and rtlwifi.ko. Don't know the speed of a B2, but this will probably take about 5 minutes to compile.Code: Select all
make menuconfig make prepare make M=$(pwd)/drivers/net/wireless/rtlwifi modules make M=$(pwd)/drivers/net/wireless/rtlwifi modules_install
I edited Makefile this way:
Code: Select all
EXTRAVERSION = -1
Code: Select all
make oldconfig
make prepare
make scripts
make menuconfig
make prepare
make M=$(pwd)/drivers/net/wireless/rtlwifi modules
And yes, it takes about 5 minutes to compile.LD [M] /home/csanyipal/BubbaKernelek/LeforditottKernelek/CsakEgyelenKernelModulLeforditasa/community-b3-kernel-debian-1-3.2.62-1/drivers/net/wireless/rtlwifi/rtl8192c/rtl8192c-common.ko
ld: cannot find arch/powerpc/lib/crtsavres.o: No such file or directory
make[1]: *** [/home/csanyipal/BubbaKernelek/LeforditottKernelek/CsakEgyelenKernelModulLeforditasa/community-b3-kernel-debian-1-3.2.62-1/drivers/net/wireless/rtlwifi/rtl8192c/rtl8192c-common.ko] Error 1
make: *** [modules] Error 2
What did I wrong?
I think, I must patch the kernel source and 'make bubbatwo_defconfig' first, right?
Best, Pali
Re: B2 Building a Custom kernel - menuconfig issue
Probably yes. The error is from a missing dependency, so you'll have to run make on that as well. Seems to be some kind of platform special support file and I don't know if that one has other dependencies of its own, but it definitely beats compiling the whole kernel and each and every module that is already on your system.
Re: B2 Building a Custom kernel - menuconfig issue
OK, I move one step further, but stuck again.
Sofar I did these steps:
The output of the last command is:
Can be the 'make oldconfig' omitted and run just the 'make bubbatwo_defconfig'?
Sofar I did these steps:
Code: Select all
tar xvf community-b3-kernel-debian-1-3.2.62-1.tar.gz
cd community-b3-kernel-debian-1-3.2.62-1/
patch -Np1 -i debian/patches/0002-Settings-for-marvell-88e1116.patch
patch -Np1 -i debian/patches/0003-Marvell-reverse-led-fix.patch
patch -Np1 -i debian/patches/0004-Excito-B3-board.patch
patch -Np1 -i debian/patches/0005-Ath-regd-optional.patch
patch -Np1 -i debian/patches/0006-vsc8601_and_clockskewfix.patch
patch -Np1 -i debian/patches/0007-Excito-B2-board.patch
patch -Np1 -i debian/patches/0008-Excito-B3-config.patch
patch -Np1 -i debian/patches/0009-Excito-B2-config.patch
make oldconfig
make bubbatwo_defconfig
make menuconfig
make prepare
make scripts
make M=drivers/net/wireless/rtlwifi modules
How can I run 'make' on crtsavres?Building modules, stage 2.
MODPOST 3 modules
CC drivers/net/wireless/rtlwifi/rtl8192c/rtl8192c-common.mod.o
LD [M] drivers/net/wireless/rtlwifi/rtl8192c/rtl8192c-common.ko
ld: cannot find arch/powerpc/lib/crtsavres.o: No such file or directory
make[1]: *** [drivers/net/wireless/rtlwifi/rtl8192c/rtl8192c-common.ko] Error 1
make: *** [modules] Error 2
Can be the 'make oldconfig' omitted and run just the 'make bubbatwo_defconfig'?
Best, Pali