📄 buildtoolchain-step05-kernelsourceheaders
字号:
#!/bin/bash# buildtoolchain-step05-kernelsourceheaders v1.22 10/15/02 # www.embeddedlinuxinterfacing.com## The original location of this script is# http://www.embeddedlinuxinterfacing.com/chapters/03/buildtoolchain## Copyright (C) 2001 by Craig Hollabaugh# See buildtoolchain script for General Public License statementif [ ! $BUILDTOOLCHAINENV ]then. ./buildtoolchain-environment $1fi## Step 5 - Setup Kernel Source and Headers#date "+%x %X - Started: $0"date "+%x %X - Started: $0" >> $SRCFILELOC/output-build-statusecho Setting up $KERNELVERSION source and headers for $TARGETcd $SRCFILELOCecho Removing $SRCFILELOC/linuxrm -rf linux $KERNELVERSIONecho Extracting $KERNELVERSION.tar.gztar zxf $KERNELVERSION.tar.gz# old kernel tar files etracted into linux, new ones extract # into linux-2.4.4, for examplemv linux $KERNELVERSION cd $KERNELVERSION if [ $KERNELPATCH1 ]then echo Patching with $KERNELPATCH1 gzip -cd ../$KERNELPATCH1 | patch -p1fiif [ $KERNELPATCH2 ]then echo Patching with $KERNELPATCH2 gzip -cd ../$KERNELPATCH2 | patch -p1fiif [ $KERNELPATCH3 ]then echo Patching with $KERNELPATCH3 gzip -cd ../$KERNELPATCH3 | patch -p1fi# save the existing kernel configuration if it existscd $SRCFILELOCif [ -f $PREFIX/src/$TARGET/.config ]then echo Saving $PREFIX/src/$TARGET/.config mv $PREFIX/src/$TARGET/.config /tmp/config.originalfi# remove all the exist kernel source code for this targetecho Removing $PREFIX/src/$TARGETrm -rf $PREFIX/src/$TARGETecho Creating $PREFIX/src/$TARGETmv $KERNELVERSION $PREFIX/src/$TARGETcd $PREFIX/src/$TARGETif [ -f /tmp/config.original ]then echo Saving $PREFIX/src/$TARGET/.config as $PREFIX/src/$TARGET/config.original mv /tmp/config.original $PREFIX/src/$TARGET/config.originalfimake mrproper sed "s/ARCH :=.*$/ARCH := $ARCH/1" Makefile > /tmp/Makefilecp /tmp/Makefile Makefilesed "s/CROSS_COMPILE.*=.*$/CROSS_COMPILE = $TARGET-/1" Makefile > /tmp/Makefilecp /tmp/Makefile Makefilemake mrproper# use the target board defconfig if defined, otherwise have the user go through make menuconfigif [ $TARGETBOARD ]then make $TARGETBOARD"_config" yes n | make oldconfigelse make menuconfigfimake depif [ ! -e $PREFIX/$TARGET ]then mkdir $PREFIX/$TARGETfirm -rf $PREFIX/$TARGET/includemkdir $PREFIX/$TARGET/includecp -dR $PREFIX/src/$TARGET/include/asm-$ARCH $PREFIX/$TARGET/include/asmcp -dR $PREFIX/src/$TARGET/include/linux $PREFIX/$TARGET/include/linux date "+%x %X - Completed: $0"date "+%x %X - Completed: $0" >> $SRCFILELOC/output-build-status#beepecho -e "\07"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -