在Mac
下面使用HomeBrew
安装了crosstool-ng
来编译树莓派的代码,结果在执行的时候报告如下错误:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
$ ct-ng build [INFO ] Performing some trivial sanity checks [ERROR] Your file system in '/Users/Documents/rpi/rpi-linux/.build' is *not* case-sensitive! [ERROR] [ERROR] >> [ERROR] >> Build failed in step '(top-level)' [ERROR] >> [ERROR] >> Error happened in: CT_Abort[scripts/functions@329] [ERROR] >> called from: CT_TestAndAbort[scripts/functions@351] [ERROR] >> called from: main[scripts/crosstool-NG.sh@93] [ERROR] >> [ERROR] >> For more info on this error, look at the file: 'build.log' [ERROR] >> There is a list of known issues, some with workarounds, in: [ERROR] >> '/usr/local/Cellar/crosstool-ng/1.22.0/share/doc/crosstool-ng/crosstool-ng-1.22.0/B - Known issues.txt' [ERROR] [ERROR] (elapsed: 24422614:07.00) [00:01] / make: *** [build] Error 1 |
比较简单的解决方法就是创建一个支持大小写区分的文件,作为一个分区挂载,然后把代码拷贝到这个分区中执行编译。
1.创建分区文件
1 |
$ hdiutil create -volname "Raspberry" -type SPARSE -fs 'Case-sensitive Journaled HFS+' -size 20g raspberry.dmg |
2.挂载分区
早期版本的Mac OS X
1 2 3 4 |
$ hdiutil attach raspberry.dmg -mountpoint /Volumes/raspberry # 切换到挂载目录 $ cd /Volumes/raspberry/ |
对于OS X EI Capitan(10.11.5)
版本而言,生成的文件名变成了raspberry.dmg.sparseimage
因此需要使用这个文件来挂载
1 2 3 4 |
$ hdiutil attach raspberry.dmg.sparseimage -mountpoint /Volumes/raspberry # 切换到挂载目录 $ cd /Volumes/raspberry/ |
挂载后会在桌面生成一个名为Raspberry
的磁盘文件夹生成,直接操作这个目录即可。
3.修改crosstool-ng
的编译工具下载目录
1 |
$ ct-ng menuconfig |
如下图的方式进行操作:
1.选择"Paths and misc options
",并选中"Select
"之后点击回车按键
2.点击向下的方向按键,,找到"(${Home}/src) Local tarballs directory
",这个项,并选中"Select
"之后点击回车按键,修改为"/Volumes/raspberry/src
",然后继续向下,找到"(${Home}/x-tools/${CT_TARGET}) Prefix directory
",这个项,并选中"Select
"之后点击回车按键,修改为"/Volumes/raspberry/x-tools/${CT_TARGET}
"
修改后的结果如下图:
完成操作后,不断快速按下Esc
按键,在最后弹出的确认保存窗口中选择保存即可,如下图:
4.卸载分区
1 |
$ hdiutil detach /Volumes/raspberry |