Maemo Linux手机平台分析系列:3 安装Maemo平台宿主Linux系统

 

我们大多数单个主机都用的是Windows, 如果为了研究Maemo,还要把Windows的某个分区格式化,然后安装Linux,好像动静大了点。而且我们看文档一般习惯于在windows下面。

vmware可以解决这问题:在windows上安装vmware, 然后在vmware中安装Linux.

这样就不必离开windows了,而且可以在windowsLinux之前方便的切换。

 

内容:

1 下载ubuntu

2 下载vmware workstation

3 安装vmware workstation

4 vmware workstation中安装ubuntu

5 更新 ubuntu

6 安装vmware-tool

7 实现windowsLinux之间文件共享

8 解决花屏问题

 

1 下载ubuntu

Maemo适用于Debian, 我选用ubuntu (基于debian的版本), 你也可以直接使用debian.

 

Ubuntu的官方下载地址:

http://www.ubuntu.com/getubuntu/download

 

Download URL: http://tw.releases.ubuntu.com/gutsy/ubuntu-7.10-desktop-i386.iso
Ubuntu Edition: Ubuntu 7.10 desktop
Computer Platform: i386
Download Location:
http://tw.releases.ubuntu.com/

 

Ubuntu的一个中文网页:

http://www.ubfchina.cn/article/list.asp?classid=11

 

2 下载vmware workstation

这是vmware公司的产品,下载个试用版本就够用了,一般使用期限30天。安装完毕后,如果今后vmware workstation过期了,换用vmware player这个不要钱。能打开用vmware worktstation制作的linux。当然你也可以用破解版本的vmware workstation.

 

Vmware workstation的官方网址:

http://www.vmware.com/download/

 

  • Desktop Virtualization Products

VMware Workstation

o       Download | Evaluate | Buy

Includes Drivers & Tools and Open Source

VMware Player

o       Download

Includes Open Source

对于VMware Workstation (Evaluate), 一般注册一下,这个公司就给你一个30天的license. 够用了。安装一个Linux操作系统几个小时就可以,然后配置一下vmware-tool.

 

3 安装VMware workstation.

一路安装,重启,然后把vmware给你的序列号输入就可以了。

 

4 安装ubuntu

 

 

安装的过程基本上都是自动完成的,不要干预多少。

注意把网络连接方式选择为NAT就行了,其他的不用太关心。

UbuntuFedora安装省事多了。

 

部分安装截屏:

Snapshot 1:

 

Snapshot 2:

 

Snapshot 3:

 

Snapshot 4:

 

Snapshot 5:

 

Snapshot 6:

 

Snapshot 7:

 

Snapshot 8: (这是没有更新ubuntu,安装vmware-tool的界面,乱码一堆)

 

Snapshot 9: (更新ubuntu后,可以正常看到vmware-tool安装包)

 

 

 

 

1个小时左右安装完毕,安装完后,

1个小时更新;

 

重启,用我之前创建的帐号登陆:test/linux

登陆后的第一个界面:

 

 

由于我们以后的很多操作需要root权限下才能操作,所以先给root设置一个密码

# sudo passwd root

这里我也设置为linux

 

sudo –i //切换到root权限下

 

5 更新软件,点击右上角的更新按钮,先把新的软件全部更新

 

这一步非常重要,不然后面的vmware-tool很难安装成功!

 

6 安装vmware-tool, 实现LinuxWindows文件的共享

这只是其中一种方法,不过安装了vmware-tool, 今后会非常方便在windowLinux之间拷贝些东西。

 

网上的这方面的东西很多:

/

正确安装VMWARE TOOLS步骤如下:

1、以ROOT身份进入LINUX

2、按下 CTRL+ALT组合键,进入主操作系统,点击VMWARE状态栏安装提示,或者点击 SETTING菜单下的ENABLE VMWARE TOOLS子菜单。

3、确认安装VMWARE TOOLS

这时我们并没有真正的安装上了VMWARE TOOLS软件包,如果您点击菜单:DEVICES,您就会发现光驱的菜单文字变为:ide10-> C:Program FilesVMwareVMware WorkstationProgramslinux.iso,这表示VMWARELINUXISO映象文件作为了虚拟机的光盘

4、鼠标点击LINUX界面,进入LINUX

5、运行如下命令,注意大小写。

mount -t iso9660 /dev/cdrom /mnt

加载CDROM设备,这时如果进入 /mnt 目录下,你将会发现多了一个文件:vmware-linux-tools.tar.gz。这就是WMWARE TOOLSLINUX软件包,也就是我们刚才使用WINISO打开LINUX.ISO文件所看到的。

cp /mnt/vmware-linux-tools.tar.gz /tmp

将该软件包拷贝到LINUX TMP目录下。

umount /dev/cdrom

卸载CDROM

cd /tmp

进入TMP目录

tar zxf vmware-linux-tools.tar.gz

解压缩该软件包,默认解压到vmware-linux-tools目录下(与文件名同名)。

cd vmware-linux-tools

进入解压后的目录

./install.pl

运行安装命令。

这时install提示你是否需要备份以前的配置文件,建议选择"y"

/

 

提示你选yes的,你就敲入yes,其它的不用管。

具体的过程见附录2

 

完成vmware-tool的安装后,你就会发现鼠标可以在linuxwindows之间自由的切换了!而且在两个系统之间拷贝文本极为方便!

 

而且也不用启动vmware-toolbox, 在这点上ubuntufedora好。

 

7 实现windowsLinux之间文件共享

实现共享的方式有两三种:

1) 成功安装vmware-tool后,在/mnt目录下面会出现一个hgfs目录,这个就是用于vmware workstation设置LinuxWindows之间共享目录的

2) 使用samba

 

8 花屏问题的解决:

有时候,vmware workstation打开虚拟机文件后,Linux画屏,什么也看不见。这是需要修改一下分辨率就可以了,步骤如下:

 

(这个方法从网上找的,

原文:http://blog.163.com/xukang_xt.vip/blog/static/26078197200772004157228/ )

 

重新启动虚拟机,在出现grub后,在安装的系统上面按“e”,然后出现grub的配置文件,按键盘移动光标到第二行“Ker……”,再按“e”,然后在这一行的结尾加上:空格 single,然后按“b”重启,就进入了单用户模式。进入后在提示符下敲入:vi /etc/X11/XF86Config ,然后会打开这个文件,再输入“/Screen”,然后程序会显示找到相关的配置的地方。然后您按“i”键进入插入模式,在这里用键盘移动到24的位置把这里的24改为16,然后按ESC键,按Shift+:,输入wq回车存退出。输入init 6,重新启动,图形界面又出来了!
补充一点,有些人说在输入的过程当中屏幕不动,没什么反应,那不是程序出错了。我最开始也以为是,但不是的不用管它。反正按照步骤去做,进入插入模式的时候。你控制键盘的键。往下拉。。。找到24。改成16就行了。

 

不过我并没有完全按照上面的方法做,

主要是:

1 进入grub

2 edit kernel …

3 add single

4 b

重复了56次,才显示。

还没有等到我修改/etc/X11/XF86Config, 就好了。

每个人的情况都不一样,多试验几次应该没有问题。

 

 

 

 

 

 

附录1QAs:

Q:

为什么去分析Maemo平台呢?

A:

分析一个平台是为了掌握它,吸收有用的东西为我所用。

 

Q:

为什么选择Maemo平台呢?

A:

Linux手机平台目前主要有ALPMaemo, LiMo, Android, etc. (欢迎大家补充J

目前不少都是打着开源的旗号的,但是公开的力度不同:ALP目前仅仅公开了其Hilker部分;Maemo全部公开;LiMo在圈子之内公开,外界普通的研发人员没有机会得到;Android开放力度不错,不过能看到的东西目前还很少;

相比之下,Maemo平台成熟些,对于普通的研发人员可以分析掌握的东西比较系统和全面。大家知道:NokiaSymbian上面是独大,但并不是说她会放弃Linux手机操作系统,并且一直在研制Linux手机操作系统:Maemo,虽然目前Maemo不能打电话,但是Nokia如果想把Telephony加入Maemo平台,这就是一个完整的Linux手机操作系统!

 

网友goodfriends_fzg@msn.com补充了:OpenMoko, MontavistaLinux手机平台, 非常感谢!

 

Q:

采用什么步骤去分析Maemo平台呢?

A:

我觉得直接去分析源码会出力不讨好,非常片面。

我准备这样搞:

1 系统的分析文档,并且尽量写成直白的、比较容易理解的总结文档;

2 然后搭建环境

3 分析源码,分析sample code.

4 能做些修改,主要针对平台

 

在今后的文章中,这个QA就放在系列文章的头部或者附录,可能有新的修改和补充。

 

 

附录2vmware-tool的详细安装

 

//有两处注意:

// 1 要完成ubuntu的更新后再装vmware-tool

// 2 别忘记点击vwmare workstation”Install Vmware Tools…”

 

root@test-desktop:~# mount -t iso9660 /dev/cdrom /mnt

root@test-desktop:~# cd /mnt

root@test-desktop:~# cp VmwareTools-x.y.z.tar.gz /tmp

root@test-desktop:~# umout /dev/cdrom

root@test-desktop:~# cd /tmp

 

 

root@test-desktop:/tmp# cd vmware-tools-distrib/

root@test-desktop:/tmp/vmware-tools-distrib# ls

bin  doc  etc  FILES  INSTALL  installer  lib  vmware-install.pl

root@test-desktop:/tmp/vmware-tools-distrib# ./vmware-install.pl

Creating a new VMware Tools installer database using the tar4 format.

 

Installing VMware Tools.

 

In which directory do you want to install the binary files?

[/usr/bin]

 

What is the directory that contains the init directories (rc0.d/ to rc6.d/)?

[/etc]

 

What is the directory that contains the init scripts?

[/etc/init.d]

 

In which directory do you want to install the daemon files?

[/usr/sbin]

 

In which directory do you want to install the library files?

[/usr/lib/vmware-tools]

 

The path "/usr/lib/vmware-tools" does not exist currently. This program is

going to create it, including needed parent directories. Is this what you want?

[yes] yes

 

In which directory do you want to install the documentation files?

[/usr/share/doc/vmware-tools]

 

The path "/usr/share/doc/vmware-tools" does not exist currently. This program

is going to create it, including needed parent directories. Is this what you

want? [yes] yes

 

The installation of VMware Tools 6.0.2 build-59824 for Linux completed

successfully. You can decide to remove this software from your system at any

time by invoking the following command: "/usr/bin/vmware-uninstall-tools.pl".

 

Before running VMware Tools for the first time, you need to configure it by

invoking the following command: "/usr/bin/vmware-config-tools.pl". Do you want

this program to invoke the command for you now? [yes] yes

 

 

Stopping VMware Tools services in the virtual machine:

   Guest operating system daemon:                                      done

Trying to find a suitable vmmemctl module for your running kernel.

 

None of the pre-built vmmemctl modules for VMware Tools is suitable for your

running kernel.  Do you want this program to try to build the vmmemctl module

for your system (you need to have a C compiler installed on your system)?

[yes] yes

 

Using compiler "/usr/bin/gcc". Use environment variable CC to override.

 

What is the location of the directory of C header files that match your running

kernel? [/lib/modules/ 2.6.22 -14-generic/build/include]

 

Extracting the sources of the vmmemctl module.

 

Building the vmmemctl module.

 

Using 2.6.x kernel build system.

make: Entering directory `/tmp/vmware-config0/vmmemctl-only'

make -C /lib/modules/ 2.6.22 -14-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules

make[1]: Entering directory `/usr/src/linux-headers- 2.6.22 -14-generic'

  CC [M]  /tmp/vmware-config0/vmmemctl-only/os.o

  SHIPPED /tmp/vmware-config0/vmmemctl-only/vmmemctl1.o

  LD [M]  /tmp/vmware-config0/vmmemctl-only/vmmemctl.o

  Building modules, stage 2.

  MODPOST 1 modules

WARNING: could not find /tmp/vmware-config0/vmmemctl-only/.vmmemctl1.o.cmd for /tmp/vmware-config0/vmmemctl-only/vmmemctl1.o

  CC      /tmp/vmware-config0/vmmemctl-only/vmmemctl.mod.o

  LD [M]  /tmp/vmware-config0/vmmemctl-only/vmmemctl.ko

make[1]: Leaving directory `/usr/src/linux-headers- 2.6.22 -14-generic'

cp -f vmmemctl.ko ./../vmmemctl.o

make: Leaving directory `/tmp/vmware-config0/vmmemctl-only'

The module loads perfectly in the running kernel.

 

Trying to find a suitable vmhgfs module for your running kernel.

 

None of the pre-built vmhgfs modules for VMware Tools is suitable for your

running kernel.  Do you want this program to try to build the vmhgfs module for

your system (you need to have a C compiler installed on your system)? [yes] yes

 

Extracting the sources of the vmhgfs module.

 

Building the vmhgfs module.

 

Using 2.6.x kernel build system.

make: Entering directory `/tmp/vmware-config0/vmhgfs-only'

make -C /lib/modules/ 2.6.22 -14-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules

make[1]: Entering directory `/usr/src/linux-headers- 2.6.22 -14-generic'

  CC [M]  /tmp/vmware-config0/vmhgfs-only/backdoor.o

  CC [M]  /tmp/vmware-config0/vmhgfs-only/backdoorGcc32.o

  CC [M]  /tmp/vmware-config0/vmhgfs-only/bdhandler.o

  CC [M]  /tmp/vmware-config0/vmhgfs-only/cpName.o

  CC [M]  /tmp/vmware-config0/vmhgfs-only/cpNameLinux.o

  CC [M]  /tmp/vmware-config0/vmhgfs-only/cpNameLite.o

  CC [M]  /tmp/vmware-config0/vmhgfs-only/dbllnklst.o

  CC [M]  /tmp/vmware-config0/vmhgfs-only/dentry.o

  CC [M]  /tmp/vmware-config0/vmhgfs-only/dir.o

  CC [M]  /tmp/vmware-config0/vmhgfs-only/eventManager.o

  CC [M]  /tmp/vmware-config0/vmhgfs-only/file.o

  CC [M]  /tmp/vmware-config0/vmhgfs-only/filesystem.o

/tmp/vmware-config0/vmhgfs-only/filesystem.c: In function ‘HgfsInitFileSystem’:

/tmp/vmware-config0/vmhgfs-only/filesystem.c:582: error: too few arguments to function ‘kmem_cache_create’

/tmp/vmware-config0/vmhgfs-only/filesystem.c:593: error: too few arguments to function ‘kmem_cache_create’

make[2]: *** [/tmp/vmware-config0/vmhgfs-only/filesystem.o] Error 1

make[1]: *** [_module_/tmp/vmware-config0/vmhgfs-only] Error 2

make[1]: Leaving directory `/usr/src/linux-headers- 2.6.22 -14-generic'

make: *** [vmhgfs.ko] Error 2

make: Leaving directory `/tmp/vmware-config0/vmhgfs-only'

Unable to build the vmhgfs module.

 

The filesystem driver (vmhgfs module) is used only for the shared folder

feature. The rest of the software provided by VMware Tools is designed to work

independently of this feature.

If you wish to have the shared folders feature, you can install the driver by

running vmware-config-tools.pl again after making sure that gcc, binutils, make

and the kernel sources for your running kernel are installed on your machine.

These packages are available on your distribution's installation CD.

[ Press Enter key to continue ]

 

pcnet32                34308  0

Unloading pcnet32 module

 

Trying to find a suitable vmxnet module for your running kernel.

 

None of the pre-built vmxnet modules for VMware Tools is suitable for your

running kernel.  Do you want this program to try to build the vmxnet module for

your system (you need to have a C compiler installed on your system)? [yes] yes

 

Extracting the sources of the vmxnet module.

 

Building the vmxnet module.

 

Using 2.6.x kernel build system.

make: Entering directory `/tmp/vmware-config1/vmxnet-only'

make -C /lib/modules/ 2.6.22 -14-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules

make[1]: Entering directory `/usr/src/linux-headers- 2.6.22 -14-generic'

  CC [M]  /tmp/vmware-config1/vmxnet-only/vmxnet.o

  Building modules, stage 2.

  MODPOST 1 modules

  CC      /tmp/vmware-config1/vmxnet-only/vmxnet.mod.o

  LD [M]  /tmp/vmware-config1/vmxnet-only/vmxnet.ko

make[1]: Leaving directory `/usr/src/linux-headers- 2.6.22 -14-generic'

cp -f vmxnet.ko ./../vmxnet.o

make: Leaving directory `/tmp/vmware-config1/vmxnet-only'

The module loads perfectly in the running kernel.

 

update-initramfs: Generating /boot/initrd.img- 2.6.22 -14-generic

Trying to find a suitable vmblock module for your running kernel.

 

None of the pre-built vmblock modules for VMware Tools is suitable for your

running kernel.  Do you want this program to try to build the vmblock module

for your system (you need to have a C compiler installed on your system)?

[yes] yes

 

Extracting the sources of the vmblock module.

 

Building the vmblock module.

 

Using 2.6.x kernel build system.

make: Entering directory `/tmp/vmware-config1/vmblock-only'

make -C /lib/modules/ 2.6.22 -14-generic/build/include/.. SUBDIRS=$PWD SRCROOT=$PWD/. modules

make[1]: Entering directory `/usr/src/linux-headers- 2.6.22 -14-generic'

  CC [M]  /tmp/vmware-config1/vmblock-only/linux/block.o

  CC [M]  /tmp/vmware-config1/vmblock-only/linux/control.o

  CC [M]  /tmp/vmware-config1/vmblock-only/linux/dbllnklst.o

  CC [M]  /tmp/vmware-config1/vmblock-only/linux/dentry.o

  CC [M]  /tmp/vmware-config1/vmblock-only/linux/file.o

  CC [M]  /tmp/vmware-config1/vmblock-only/linux/filesystem.o

  CC [M]  /tmp/vmware-config1/vmblock-only/linux/inode.o

  CC [M]  /tmp/vmware-config1/vmblock-only/linux/module.o

  CC [M]  /tmp/vmware-config1/vmblock-only/linux/stubs.o

  CC [M]  /tmp/vmware-config1/vmblock-only/linux/super.o

  LD [M]  /tmp/vmware-config1/vmblock-only/vmblock.o

  Building modules, stage 2.

  MODPOST 1 modules

  CC      /tmp/vmware-config1/vmblock-only/vmblock.mod.o

  LD [M]  /tmp/vmware-config1/vmblock-only/vmblock.ko

make[1]: Leaving directory `/usr/src/linux-headers- 2.6.22 -14-generic'

cp -f vmblock.ko ./../vmblock.o

make: Leaving directory `/tmp/vmware-config1/vmblock-only'

The module loads perfectly in the running kernel.

 

[EXPERIMENTAL] The Virtual Machine Communication Interface (VMCI) service

provides a new communication capability with the Host, primarily for

development at the moment.  Would you like to enable this feature? [no]

 

 

 

Detected X.org version 1.3.

 

 

 

No drivers for X.org version: 1.3.

 

 

Please choose one of the following display sizes that X will start with (1 -

15):

 

[1]  "640x480"

[2]  "800x600"

[3]  "1024x768"

[4]  "1152x864"

[5]  "1280x800"

[6]< "1152x900"

[7]  "1280x1024"

[8]  "1376x1032"

[9]  "1400x900"

[10]  "1400x1050"

[11]  "1440x900"

[12]  "1680x1050"

[13]  "1600x1200"

[14]  "1920x1200"

[15]  "2364x1773"

Please enter a number between 1 and 15:

 

[6] 7

 

Starting VMware Tools services in the virtual machine:

   Switching to guest configuration:                                   done

   Guest memory manager:                                               done

   Guest vmxnet fast network device:                                   done

   Blocking file system:                                               done

   DMA setup:                                                          done

   Guest operating system daemon:                                      done

 

The configuration of VMware Tools 6.0.2 build-59824 for Linux for this running

kernel completed successfully.

 

You must restart your X session before any mouse or graphics changes take

effect.

 

You can now run VMware Tools by invoking the following command:

"/usr/bin/vmware-toolbox" during an X server session.

 

To use the vmxnet driver, restart networking using the following commands:

/etc/init.d/networking stop

rmmod pcnet32

rmmod vmxnet

modprobe vmxnet

/etc/init.d/networking start

 

To make use of the virtual printer, you will need to restart the CUPS service

 

Enjoy,

 

--the VMware team

 

root@test-desktop:/tmp/vmware-tools-distrib#

 

 

 

 
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值