Tiny Core Linux
Tiny Core Base => Raspberry Pi => Topic started by: jgrulich on May 09, 2015, 02:45:47 PM
-
I need to add new drivers for my audio card. I've used the kernel patch which works well in the Rasbian.
Guess that the kernel source is the same and after patching when I'll use the .config for TC than it may work.
There need to be some additional setup, or script to modify the kernel structure hence the system runs in the RAM and that the modules format is different. I may try-fail test a lot, but the only side effect is that the kernel make takes around 10 hours.
Regards,
Jan
-
piCore is running on stock Raspberry Pi kernel, the only patch is the 192kbps/24bit HDMI audio patch, with a different .config than Raspbian has.
10hours? Is it on Raspberry? I'm crosscompiling kernel on x86 machine. It takes 10 minutes on my current machine, less than an hour on my old Linux server.
-
Yes, I'm compiling it on Raspberry. Don't have PC for cross compilation.
What's the difference between the Rasbian and TC then, when the kernel is the same?
As we've discussed some time ago, the modules are different because the kernel is different. But now you say that it's the same.
-
For Rasbian kernel build I've used these steps:
git clone --depth=1 https://github.com/raspberrypi/linux
cd linux
git am /home/pi/*.patch
make bcmrpi_defconfig
make
sudo make modules_install
mkknlimg arch/arm/boot/zImage /boot/kernel.img
But this gives regular kernel image with the overlay support and regular .ko modules.
-
As we've discussed some time ago, the modules are different because the kernel is different. But now you say that it's the same.
In the opening post you were talking about kernel source. piCore kernel source is the same as Raspbian source from GitHub, as I wrote already. Of course compiled kernel is different and modules are not compatible.
-
OK than, if the kernel source is the same, the kernel compilation need to be different to get different results. What setup to use to get the difference? Is somewhere tutorial what to modify for the kernel compilation? I was looking in the forum, but lo lucky.
BTW, is there some difference from standard setup when cross-compiling on the PC booted live TC from CD?
-
What difference? As I already wrote few posts back the .config and the HDMI audio patch. For info on cross compilation see
http://elinux.org/Raspberry_Pi_Kernel_Compilation#2._Cross_compiling_from_Linux
-
The different dedicated setup to get the TC kernel and modules and not Rasbian kernel file and modules.
-
The different dedicated setup to get the TC kernel and modules and not Rasbian kernel file and modules.
You are just getting hung up in terminology.
TC uses the identical Kernel Code that Rasbian uses. However it is compiled with a different .config. As many items are compiled as modules to reduce the kernel size, and then the initrd only includes the bare minimum modules to start the Rpi
In theory, if you have a new kernel module for your sound card, it should be simple to just compile that modules and then build and extension and load it.....however kernels are very finicky when you try to add modules that were compiled on a different machine. A number of us have tried and have been spotty at results.
So that leaves you with remastering piCore. Replacing the kernel and the initrd on the boot SDcard with your kernel and all of your modules. Take a look at remastering in the wiki. http://wiki.tinycorelinux.net/wiki:remastering
You will also have to rebuild any kernel module extensions. Like alsa-modules.
-
Hence I have the kernel patch, I need to patch the kernel and than make modules. I've made it with Rasbian and it works.
The same I need for TC. Hence I already have patched kernel source for Rasbian, the only what I need is the .config file for TC to make new kernel and modules. But how to get this .config? I was looking for it, but no lucky. If you have it, please share, or provide more info where to get it.
-
Kernel source, config, etc is available for armv6 at:
http://tinycorelinux.net/6.x/armv6/release/src/kernel/
Alternativele execute
zcat /proc/config.gz
in a terminal on running system. Please note armv6 and armv7 kernels are different with different .config file.
-
Yes, I know about this source, but for this patch I need to update to the latest kernel, means 3.18.12.
I've used the kernel source from github.com/raspberrypi/linux and .config genereated by running:
make bcmrpi_defconfig
May I use you 3.18.10 .config even for this last kernel?
-
May I use you 3.18.10 .config even for this last kernel?
Yes
-
After several hours of compilation i fails with error:
scripts/link-vmlinux.sh: trap: line 113: ERR: invalid signal specification
Makefile:923: receipe for target 'vmlinux' failed
make: *** [vmlinux] Error 1
Any idea what's wrong?
-
That script requires bash.
-
Thank's now it works, but now the mkknlimg fails because grep doesn't support -abo function.
And finally how to select the minimal set of modules whch are mandatory. Is there some switch, or script?
-
Thank's now it works, but now the mkknlimg fails because grep doesn't support -abo function.
And finally how to select the minimal set of modules whch are mandatory. Is there some switch, or script?
By default grep is supplied by busybox, you can install the grep extension to get the full gnu version.
As far as remastering, the best thing to do is unpack the original initrd, replace the modules 1 for 1 with your modules. Then re-pack the initrd......do the same for the module extensions.....
-
Thank's, it works. But only to replace all the hundreds of modules is not very comfortable and is too time consuming.
The same when I like to install new module extensions, I need first to install it, than replace all the modules and that rebuild the extension. I guess that there need to be some script to automate it.
-
For those who like to build new kernel, or update. This is the quick summary:
1) take the fresh image on at least 2GB DS card and expand with sudo fdisk /dev/mmcblk0 and sudo resize2fs /dev/mmcblk0p2
2) install compile-essentials, pkg-config, bash, grep, gzip, squashfs-tools and linux-3.18.y_api_headers and download mkknlimg
3) follow the steps:
mkdir /mnt/mmcblk0p2/pi
cd /mnt/mmcblk0p2/pi
sudo git clone --depth=1 https://github.com/raspberrypi/linux
cd /mnt/mmcblk0p2/pi/linux
sudo zcat /proc/config.gz > ./.config
sudo chown -R tc:staff ./linux
make
sudo make dtbs_install
mkknlimg arch/arm/boot/zImage /mnt/mmcblk0p2/pi/kernel.img
4) Backup the original kernel modules and build new ones:
sudo make modules_install
5) Than compress the kernel modules with:
sudo gzip -r ./kernel
6) Remaster the initrd file only with the minimum modules. Use the old backup for reference.
7) Another needed modules may be loaded via the tcz extension which may be created like this:
mksquashfs module module.tcz