WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Custom kernel  (Read 2050 times)

Offline m00rg

  • Newbie
  • *
  • Posts: 4
Custom kernel
« on: May 21, 2016, 08:49:06 AM »
Hi all,

I am trying to set up a piCore guitar rig using Guitarix. It's all working rather well but with a slightly higher than ideal latency, so I want to move to PREEMP_RT kernel. It's using piCore 7.0 as a base on a rpi2.

As I've struggled with this for a while, I'm starting out with simply trying to use a custom kernel (no PREAMPT_RT) to get that working first, but I'm struggling.
I've followed the rather helpful script in this thread:
http://forum.tinycorelinux.net/index.php?topic=19617.0
and modified it for my needs (posted in full below).

The boot process detects all the USB devices fine, then just stops;
with kernel log level of -3 it gets to :
Starting uDev daemon for hotplug support.... Done.

With a -7 it correctly loads all usb devices that are connected.

I've compiled the kernel and replaced all the modules in the 7.0v7.gz, and that seems to be working fine (with a non-custom initrd I get lots of missing module errors).

Any ideas?

Thank you!
Pete

Code: [Select]
#!/bin/bash
git clone https://github.com/raspberrypi/tools
git clone --depth=1 https://github.com/raspberrypi/linux

cd tools
git pull
cd ..
cd linux
git pull
cd ..

PATH=$PATH:$PWD/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin
OUT=/media/pallen/PICORE
INITPATH=$PWD/Remaster
ORIG=$PWD
KERNEL=4.4.11-v7+
cd linux

make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bcm2709_defconfig
make -j3 ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- bzImage modules dtbs

sudo ../mkknlimg arch/arm/boot/zImage $ORIG/kernel4117v7.img
sudo rm $OUT/overlays/*
sudo cp arch/arm/boot/dts/*.dtb $OUT
sudo cp arch/arm/boot/dts/overlays/*.dtb* $OUT/overlays/
sudo cp arch/arm/boot/dts/overlays/README $OUT/overlays/

# Now gzip the modules, and copy the new modules that were in the original structure
mkdir $ORIG/modules
make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- INSTALL_MOD_PATH=$ORIG/modules modules_install
cd $ORIG/modules
find . -name "*.ko" -exec gzip -f {} \;


mkdir $INITPATH
cd $INITPATH
zcat $OUT/7.0v7.gz | sudo cpio -i -H newc -d

OldModules=$PWD/lib/modules/*
DestDir=$PWD/lib/modules/$KERNEL
NewModules=$ORIG/modules/lib/modules/$KERNEL

mkdir $DestDir

cd $OldModules
IFS=$'\n'

sudo mkdir $DestDir
find . -type d -exec sudo mkdir /$DestDir/{} \;

for f in $(find .)
do
sudo cp $NewModules/$f $DestDir/$f;
done

sudo rm -r $OldModules
cd $ORIG/linux


sudo depmod -a -b $INITPATH $KERNEL
sudo ldconfig -r $INITPATH
cd $INITPATH
sudo find | sudo cpio -o -H newc | gzip -2 > $ORIG/7.0v7.gz
advdef -z4 $ORIG/7.0v7.gz


Offline Paul_123

  • Administrator
  • Hero Member
  • *****
  • Posts: 1267
Re: Custom kernel
« Reply #1 on: May 21, 2016, 10:15:12 AM »
You are probably missing required modules for piCore.  Get a .config from the piCore 7.x kernel.


Offline m00rg

  • Newbie
  • *
  • Posts: 4
Re: Custom kernel
« Reply #2 on: May 25, 2016, 06:41:20 PM »
You are absolutely right, thank you!
All fixed once I start with a 7.0 kernel. Sadly the only thing it didn't do is help with my latency.

Thank you
Pete