Skip to content
Permalink
master
Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Go to file
 
 
Cannot retrieve contributors at this time
executable file 70 lines (61 sloc) 1.75 KB
#!/bin/bash
# usbip kernel stuff:
# https://sommteck.wordpress.com/2013/07/13/usbip-auf-einem-raspberry-pi-starten/
#
# go for a fast machine and cross compile
# http://sysprogs.com/VisualKernel/tutorials/raspberry/buildkernel/
#
if [ ! -d kernel ]; then
git clone git://github.com/raspberrypi/linux.git kernel
fi
if [ ! -d kernel ]; then
git clone https://github.com/raspberrypi/tools
fi
export CCPREFIX=${PWD}/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-
${CCPREFIX}gcc -v
cp archkernel.config kernel/.config
# go compile
cd kernel
ARCH=arm CROSS_COMPILE=${CCPREFIX} make olddefconfig
grep -v DEBUG_INFO < .config > newconfig
mv newconfig .config
cat >>.config <<_EOF_
CONFIG_DEBUG_INFO=y
CONFIG_USBIP_CORE=m
CONFIG_USBIP_VHCI_HCD=m
CONFIG_USBIP_HOST=m
CONFIG_USBIP_DEBUG=n
_EOF_
ARCH=arm CROSS_COMPILE=${CCPREFIX} make olddefconfig
ARCH=arm CROSS_COMPILE=${CCPREFIX} make -j 30
# done
# now modules
ARCH=arm CROSS_COMPILE=${CCPREFIX} INSTALL_MOD_PATH=../modules make modules_install
# prepare kernel for transfer
cd ../tools/mkimage
# ./imagetool-uncompressed.py ../../linux/arch/arm/boot/zImage
python2.6 ./imagetool-uncompressed.py ../../kernel/arch/arm/boot/zImage
scp kernel.img pipiplus:/tmp
cd ../..
cd modules
tar czf modules.tgz *
scp modules.tgz pipiplus:/tmp
#
ssh raspi; cd /tmp/ mv kernel.img /boot; cd /; tar xcf
#
exitls -l
cd kernel
wget https://raw.github.com/raspberrypi/firmware/master/extra/Module.symvers
zcat /proc/config.gz > .config
cat >>.config <<_EOF_
CONFIG_DEBUG_INFO=y
CONFIG_USBIP_CORE=m
CONFIG_USBIP_VHCI_HCD=m
CONFIG_USBIP_HOST=m
CONFIG_USBIP_DEBUG=n
_EOF_
make oldconfig
make LOCALVERSION=+ modules_prepare
make SUBDIRS=drivers/staging/usbip
make SUBDIRS=drivers/staging/usbip modules_install
depmod -a