1.安装交叉编译环境
root@iZ252f8y3biZ:~# mkdir nanopc
root@iZ252f8y3biZ:~# cd nanopc/
root@iZ252f8y3biZ:~/nanopc# git clone https://github.com/friendlyarm/prebuilts.git
The program 'git' is currently not installed. You can install it by typing:
apt-get install git
root@iZ252f8y3biZ:~/nanopc# apt-get install git
root@iZ252f8y3biZ:~/nanopc# git clone https://github.com/friendlyarm/prebuilts.git
Cloning into 'prebuilts'...
remote: Counting objects: 14, done.
remote: Total 14 (delta 0), reused 0 (delta 0), pack-reused 14
Unpacking objects: 100% (14/14), done.
root@iZ252f8y3biZ:~/nanopc# ls
prebuilts
2.配置环境变量
root@iZ252f8y3biZ:/# vi ~/.bashrc
文件中添加下面代码:
export PATH=/opt/FriendlyARM/toolchain/4.9.3/bin:$PATH
export GCC_COLORS=auto
载入配置文件
root@iZ252f8y3biZ:/# . ~/.bashrc
root@iZ252f8y3biZ:/# cd /root/nanopc/
root@iZ252f8y3biZ:~/nanopc# git clone https://github.com/friendlyarm/uboot_nanopi2.git
Cloning into 'uboot_nanopi2'...
root@iZ252f8y3biZ:~/nanopc# cd uboot_nanopi2/
root@iZ252f8y3biZ:~/nanopc/uboot_nanopi2# git checkout nanopi2-lollipop-mr1
Already on 'nanopi2-lollipop-mr1'
root@iZ252f8y3biZ:~/nanopc/uboot_nanopi2# make s5p4418_nanopi2_config
Configuring for s5p4418_nanopi2 board...
root@iZ252f8y3biZ:~/nanopc/uboot_nanopi2# make CROSS_COMPILE=arm-linux- tools
root@iZ252f8y3biZ:~/nanopc/uboot_nanopi2# mkdir -p /usr/local/sbin && sudo cp -v tools/mkimage /usr/local/sbin
`tools/mkimage' -> `/usr/local/sbin/mkimage'
下载内核:
git clone https://github.com/friendlyarm/linux-3.4.y.git
cd linux-3.4.y
git checkout nanopi2-lollipop-mr1
make nanopi2_linux_defconfig
make menuconfig
我们需要在Device Drivers > Sound card support > Advanced Linux Sound Architecture > USB sound devices中选择,我不知道我的设备是什么,所以我全选了。
Device Drivers -->
Sound card support -->
Advanced Linux Sound Architecture -->
USB sound devices
编译
touch .scmversion
make uImage