WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Latest kernel version building for new audio card driver module  (Read 5174 times)

Offline jgrulich

  • Sr. Member
  • ****
  • Posts: 341
    • GRULICH DESIGN - R&D Lab.
Re: Latest kernel version building for new audio card driver module
« Reply #15 on: May 13, 2015, 03:18:31 PM »
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?

Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1237
Re: Latest kernel version building for new audio card driver module
« Reply #16 on: May 13, 2015, 07:20:54 PM »
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.....

Offline jgrulich

  • Sr. Member
  • ****
  • Posts: 341
    • GRULICH DESIGN - R&D Lab.
Re: Latest kernel version building for new audio card driver module
« Reply #17 on: May 14, 2015, 12:44:51 PM »
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.

Offline jgrulich

  • Sr. Member
  • ****
  • Posts: 341
    • GRULICH DESIGN - R&D Lab.
Re: Latest kernel version building for new audio card driver module
« Reply #18 on: May 16, 2015, 06:42:02 AM »
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:
Code: (bash) [Select]
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:
Code: (bash) [Select]
sudo make modules_install
5) Than compress the kernel modules with:
Code: (bash) [Select]
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:
Code: (bash) [Select]
mksquashfs module module.tcz
 
« Last Edit: May 16, 2015, 06:44:50 AM by jgrulich »