您的位置:首页 > 其它

在Debian中建立Beaglebone black的应用开发环境之二:host端dibian的设置

2014-03-12 22:51 465 查看
接着前面的说。以下操作的前提条件:
1、你已安装好了你的linux,你的linux是debian或是ubuntu。
2、你的虚拟机内的linux和你的BBB都可以上网(主要是为了方便安装软件)。
3、你基本熟悉linux的最最基本的操作。
4、你已经能够通过windows下的SSH工具连接你的BBB内的linux以及虚拟机内linux。
5、如果你是初学者,你的虚拟机内的debian最好安装一个图形界面,我以后的说明有些是为了照顾初学者,在图形界面下操作的。
那就开始干正事儿吧。我按以下顺序说明:
(1) host端debian的简单设定
(2)下载、安装、测试你的cross-toolchain
(3)安装应用布置工具
(4)一个简单的hello world。

一、host端(虚拟机中)debian的简单设定
假定你已在你的虚拟要中成功的安装了debian,并且可以顺利上网。现在要做几件事,安装必要的软件,并且完成几个有用的设定。
1、安装虚拟机增强功能
也就是网上说的VboxTool(如果你是用的VMWare,就是VMWare tools),它的作用是什么呢,它可以更好的沟通你的win操作系统和Vbox中的操作系统,最重要的一点,可以实现主机和虚拟机的文件共享。
安装的截图如下:



随后,将会自动挂载一个CDROM,在/media目录下(如果不是debian,可能挂载在其它目录),直接运行,其中的autorun.sh脚本即可,如果不能运行,请以root登录,并使用chmod命令,将其改变为可执行文件。



然后,你就可以设置你的共享文件夹了,具体设置共享文件夹的方法可以google,不详说。
最后,有一个重要的工作要做,就是将你的当前用户的权限进行设置,否则会提示你无权限访问,最简单的方法就是将你当前的用户加入sudoer组。可以通过修改/etc/sudoers文件完成。

1: robeer@RobeerDebianPC:/mnt$ sudo nano /etc/sudoers

2:

3: #

4: # This file MUST be edited with the 'visudo' command as root.

5: #

6: # Please consider adding local content in /etc/sudoers.d/ instead of

7: # directly modifying this file.

8: #

9: # See the man page for details on how to write a sudoers file.

10: #

11: Defaults env_reset

12: Defaults mail_badpass

13: Defaults secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

14:

15: # Host alias specification

16:

17: # User alias specification

18:

19: # Cmnd alias specification

20:

21: # User privilege specification

22: root ALL=(ALL:ALL) ALL

23: robeer ALL=(ALL:ALL) ALL

24:

25: # Allow members of group sudo to execute any command

26: %sudo ALL=(ALL:ALL) ALL

27:

28: # See sudoers(5) for more information on "#include" directives:

29:  

30: #includedir /etc/sudoers.d

31:

32:

 

看到的一行吗?这是我加入的,你根据你的用户名将你的用户加入即可。试试看,重启后是否可以访问共享文件夹了。

1: robeer ALL=(ALL:ALL) ALL

 

2、安装相关的软件

(1) 为了速度,更新你的源

  可以将国内的源加入到sources.list中,这样可以通过使用国内的镜像,下载、安装软件的速度会很快。国内的163的源速度还是可以的。163源的介绍参照http://mirrors.163.com/。我用是debian wheezy,因此,打开sources.list,并加入了以下几行。

1: robeer@RobeerDebianPC:~$ sudo nano /etc/apt/sources.list

2:

3: # 163 mirrors

4: deb http://mirrors.163.com/debian wheezy main non-free contrib

5: deb http://mirrors.163.com/debian wheezy-proposed-updates main contrib non-free

6: deb-src http://mirrors.163.com/debian wheezy main non-free contrib

7: deb-src http://mirrors.163.com/debian wheezy-proposed-updates main contrib non-free

8: deb http://mirrors.163.com/debian-security wheezy/updates main contrib non-free

9: deb-src http://mirrors.163.com/debian-security wheezy/updates main contrib non-free

10:

11: deb http://http.us.debian.org/debian wheezy main contrib non-free

12: deb http://non-us.debian.org/debian-non-US wheezy/non-US main contrib non-free

13: deb http://security.debian.org wheezy/updates main contrib non-free

14:

15:

 

还记得我在上一个blog中说,有一个网友说debian wheezy有严重问题,不能找到源,无法安装toolchain,而我说这个说法有点片面,有debian一样可以直接安装arm-linux-gnueabi吗?关键在这里,是因为这位朋友的源没有设定正确。

在sources.list文件中请再加上如下的源:

1: #embedded debian

2: deb http://www.emdebian.org/debian wheezy main

3:

4:

 

然后,我们再更新本地的软件包数据库:

1: robeer@RobeerDebianPC:~$ sudo aptitude update

2: 忽?略? cdrom://[Debian GNU/Linux 7.3.0 _Wheezy_ - Official i386 DVD Binary-1 20131215-03:40] wheezy Release.gpg

3: 忽?略? cdrom://[Debian GNU/Linux 7.3.0 _Wheezy_ - Official i386 DVD Binary-1 20131215-03:40] wheezy Release

4: .......

 

怎么样,成功的更新了软件数据库了,随后你可以使用sudo aptitude upgrade是进行升级,使用search进行查找,使用install进行安装了软件了。

对了,我们再测试一下,是不是可以直接安装arm-linux-gnueabi的工具包。

1: robeer@RobeerDebianPC:~$ sudo aptitude search arm-linux-gnueabi

2: p binutils-arm-linux-gnueabi - GNU binary utilities, for arm-linux-gnueabi target

3: v c++-compiler-arm-linux-gnueabi -

4: v c-compiler-arm-linux-gnueabi -

5: p cpp-4.3-arm-linux-gnueabi - The GNU C preprocessor

6: p cpp-4.4-arm-linux-gnueabi - GNU C preprocessor

7: p cpp-4.5-arm-linux-gnueabi - The GNU C preprocessor

8: p cpp-4.6-arm-linux-gnueabi - GNU C preprocessor

9: p cpp-4.7-arm-linux-gnueabi - GNU C preprocessor

10: p g++-4.3-arm-linux-gnueabi - The GNU C++ compiler

11: p g++-4.4-arm-linux-gnueabi - GNU C++ compiler

12: p g++-4.5-arm-linux-gnueabi - The GNU C++ compiler

13: p g++-4.6-arm-linux-gnueabi - GNU C++ compiler

14: p g++-4.7-arm-linux-gnueabi - GNU C++ compiler

15: p gcc-4.3-arm-linux-gnueabi - The GNU C compiler

16: p gcc-4.3-arm-linux-gnueabi-base - The GNU Compiler Collection (base package)

17: p gcc-4.4-arm-linux-gnueabi - GNU C compiler

18: p gcc-4.4-arm-linux-gnueabi-base - GCC, the GNU Compiler Collection (base package)

19: p gcc-4.5-arm-linux-gnueabi - The GNU C compiler

20: p gcc-4.5-arm-linux-gnueabi-base - The GNU Compiler Collection (base package)

21: p gcc-4.5-plugin-dev-arm-linux-gnueabi - Files for GNU GCC plugin development.

22: p gcc-4.6-arm-linux-gnueabi - GNU C compiler

23: p gcc-4.6-arm-linux-gnueabi-base - GCC, the GNU Compiler Collection (base package)

24: p gcc-4.6-plugin-dev-arm-linux-gnueabi - Files for GNU GCC plugin development.

25: p gcc-4.7-arm-linux-gnueabi - GNU C compiler

26: p gcc-4.7-arm-linux-gnueabi-base - GCC, the GNU Compiler Collection (base package)

27: p gcc-4.7-plugin-dev-arm-linux-gnueabi - Files for GNU GCC plugin development.

28: p gccgo-4.7-arm-linux-gnueabi - GNU Go compiler

29: p gdb-arm-linux-gnueabi - The GNU Debugger

30: p gfortran-4.4-arm-linux-gnueabi - GNU Fortran 95 compiler

31: p gfortran-4.5-arm-linux-gnueabi - The GNU Fortran 95 compiler

32: p gfortran-4.6-arm-linux-gnueabi - GNU Fortran compiler

33: p gfortran-4.7-arm-linux-gnueabi - GNU Fortran compiler

34: p gobjc++-4.3-arm-linux-gnueabi - The GNU Objective-C++ compiler

35: p gobjc++-4.4-arm-linux-gnueabi - GNU Objective-C++ compiler

36: p gobjc++-4.5-arm-linux-gnueabi - The GNU Objective-C++ compiler

37: p gobjc++-4.6-arm-linux-gnueabi - GNU Objective-C++ compiler

38: p gobjc++-4.7-arm-linux-gnueabi - GNU Objective-C++ compiler

39: p gobjc-4.3-arm-linux-gnueabi - The GNU Objective-C compiler

40: p gobjc-4.4-arm-linux-gnueabi - GNU Objective-C compiler

41: p gobjc-4.5-arm-linux-gnueabi - The GNU Objective-C compiler

42: p gobjc-4.6-arm-linux-gnueabi - GNU Objective-C compiler

43: p gobjc-4.7-arm-linux-gnueabi - GNU Objective-C compiler

44: v objc++-compiler-arm-linux-gnueabi -

45: v objc-compiler-arm-linux-gnueabi -

 

哈哈,好多吧,找到你想要的没有?

 

(2)安装必要的软件

从后面的使用看,我建议安装以下必要的软件,当然有些其实在debian安装的时候已经安装了。

安装gcc/gdb/tftp/ssh/x11vnc/mincom,请使用aptitude install安装即可,aptitude是debian的基本操作,相信你会使用。

PS:建议大家习惯使用aptitude来代替apt-get,因为aptitude可以更好的处理包的依赖关系,而且命令的格式更统一。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐