The Way of the great learning involves manifesting virtue, renovating the people, and abiding by the highest good.

2009年11月21日星期六

Using Chrome OS

Using Chrome OS 

----alex

1.下载  ,环境

Background:
1.Google Chrome OS演示会于北京时间2009年11月20日凌晨2:00开始
发布了源码   http://src.chromium.org/
很遗憾的是
http://dev.chromium.org/getting-involved
http://www.chromium.org/
都不能访问 !!!


2.After Google announced the availability of the Chrome OS / Chromium OS source code, one of our engineers (Jon Ursenbach), immediately got to work on compiling the code, trying to see if he could get an instance of Chromium OS running in a virtual machine.

He was finally able to do it! You can download a copy of the virtual machine to use in VMware, VirtualBox, and on a USB drive here (300MB compressed / 700MB uncompressed):
http://gdgt.com/google/chrome-os/download/

Helpful tips, if you download it:
1.) To use the vmdk file, open VMware and create a new virtual machine. One of the options will be to use an "existing virtual disk." (In VMware Fusion, this is the last option below, "use operating system disk" and "use OS disc image file.")
2.) Make sure your VM is set to use bridged networking, rather than NAT.
2.) The username and password to login to Chrome OS / Chromium OS is your google account!

Alternatively, if you don't have VMware, some users have had luck getting this image to run using VirtualBox, which is a free cross-platform (Windows / Mac / Linux) virtual machine created by Sun Microsystem. You can download VirtualBox here:
http://www.virtualbox.org/

Anyway, get downloading and try out Chrome OS! And definitely share your impressions.

3.



国内比较快的种子    http://google.org.cn/files/chromeos-image-999.999.32309.211410-a1.vmdk.bz2.5170843.TPB.torrent
当然也可以自己编译  ,哈哈 


Ubuntu 9.10 - Karmic Koala   ubuntulogo2290x300.png
screenshot1.png


2.安装过程

截了一些图片  


screenshot7.png 



screenshot3.png



screenshot4.png


screenshot5.png



.vmdk  是vmware 上的虚拟硬盘镜像,在VirtualBox上也能用。
如果要转换成VirtualBox的.vdi


$ unzip chrome-os-0.4.22.8-gdgt.vmdk.zip 
$ qemu-img convert chrome-os-0.4.22.8-gdgt.vmdk chrome-os-0.4.22.8-gdgt.bin
$ VBoxManage convertdd chrome-os-0.4.22.8-gdgt.bin chrome-os-0.4.22.8-gdgt.vdi

 没什么实际意思
screenshot6.png

screenshot7.png




配置一下网络
screenshot8.png


启动后的界面 

screenshot9.png
 注意  :  username : mark
            password :   chromeos
这是google 内部员工的帐号  .
本来是可以用 Google Account ID  ,比如 gmail  帐号 To login.But 我试了很多次,都登录不进去 .
还有 this build of ChromeOS came from bittorrent    ,注意一下 木马之类的,或者应该重新申请一个
Google Account ID ,比较安全.


3.一些测试

screenshot10.png






screenshot11.png








进入控制台  Ctrl + alt + T

screenshot12.png

Shortcut Keys

To get a visual overlay of shortcut keys available, hit F8 and any of the modifier keys like CTRL, ALT, SHIFT to find all the associated hotkeys


 Action When Feature
 F12 Running Toggle Window Overview
 F8 Running Toggle keyboard overlay showing all the shortcut keys
 ESC Window Overview Exit Window Overview
 F2 Boot Startup options - disable internal HDD to boot from USB stick
 Ctrl + Alt + T Running Open Terminal Window
 Ctrl + Alt + N             Chrome         Open New Chrome Window
 Ctrl + Alt + L Running Lock the screen
 Ctrl + Alt + M Running Enable external monitor
 Ctrl + , Chrome Goto battery and network settings page (localhost:8080)
 Ctrl + Tab Chrome Next Tab
 Ctrl + Shift + Tab Chrome Prior Tab
 Ctrl + 1 through Ctrl + 8 Chrome Switches to the tab at the specified position number on the tab strip
 Alt + Tab Running Next Window
 Alt + Shift + Tab Running Prior Window
 Close Lid Running Sleep mode
 Power-Key Running Shutdown



System information

Here's the output of dpkg -l
   screenshot13.png




uname -a


screenshot14.png



     



screenshot15.png


 接下来就是 对于shut-down button  ,没有找到,只好用VirtualBox 的外部开关关掉,
时间 测试
开机差不多 10s  ,
关机差不多 4s


root 的password  :chromeos
the root filesystem is read-only. Seeing as /var/lib/dpkg/lock is set
(and isn't writable) you can't use dpkg to install anything.
 However,
because we have super-user privileges, we can simply remount the root
filesystem to be writable.

#sudo mount -o remount,rw /

4.Building  Chromium OS


Prerequisites

You need to have Linux. We currently support the following:
  • Ubuntu (Hardy 8.04 or newer, Karmic 9.10 recommended)
  • An account with root access (needed to run chroot and modify the mount table)
  • Chromium prerequisites (needed to build a Chromium-based browser as part of building Chromium OS)

Get the source

At this stage, you will need to get the Chromium OS source code. Follow the instructions in Getting the Chromium OS Source Code.  


Build Instructions


This page covers building a Chromium-based OS. It assumes you have already downloaded the source for the OS (and optionally for the browser).

Note: When you produce a Chromium OS image, you need to fulfill the various attribution requirements of the third party licenses. Currently, the images generated by a build don't automatically do this for you. You'll need to modify~/chromium/src/chrome/browser/resources/about_os_credits.html.

Setting up your build environment

Set up symlinks (optional)

The rest of this document assumes you have created symlinks in your home directory for the OS and browser (only for the latter if you download the source). You can set these up with (note these directories depend on where you set up your repository or if you downloaded the tarball, where you unzipped it):

ln -s /usr/local/chromiumos/chromiumos.git ~/chromiumos
ln -s /usr/local/chromium/trunk ~/chromium


You don't have to create the symlinks, but it makes paths much easier to reference. Once the symlinks exists, you should see src in each directory — for example, ~/chromiumos/src and ~/chromium/src should exist. 


Make your local repository

All the necessary scripts to build a Chromium OS image are located in ~/chromiumos/src/scripts.  The rest of these instructions assume you have changed your directory to that directory:

cd ~/chromiumos/src/scripts

To get a reproducible build, we check in an exact list of packages to be used for the chroot build environment and image. To make sure debootstrap and apt-get install only those packages, run the following command to construct a local repository in ~/chromiumos/repo:

./make_local_repo.sh

Note: To modify the contents of that local repository, or create a chroot / image with a different set of packages, see Chromium OS Package Management.

If you're running an older Linux release, your version of debootstrap may not be able to install the newer Karmic version of Ubuntu that we use to build Chromium OS. If making the local repository or the chroot fails, here's a workaround that installs the Karmic version:

# Create a karmic.list which pulls from chromeos-deb
cat >karmic.list <<EOF
deb http://build.chromium.org/buildbot/packages chromeos_dev main restricted
deb-src http://build.chromium.org/buildbot/packages chromeos_dev main restricted

EOF


# Install karmic debootstrap
sudo mv karmic.list /etc/apt/sources.list.d/karmic.list
sudo apt-get update
sudo apt-get install -y --force-yes debootstrap


# Remove temporary sources.list entry, so you don't upgrade anything else
sudo rm /etc/apt/sources.list.d/karmic.list
sudo apt-get update

If you're still having trouble, try this instead:

sudo ln -s /usr/share/debootstrap/scripts/gutsy /usr/share/debootstrap/scripts/karmic

Create your build environment

Chromium OS builds only in a chroot environment, so that its build output is less dependent on the particular flavor of Linux you have installed (Hardy or Jaunty, for example). Do the following to set up a chroot environment:

./make_chroot.sh

Note: By default, the setup script configures /etc/apt/sources.list to pull from the local repository you created in the previous step. If you're pushing the boundaries of development (for example, attempting to compile for a different processor), you may need to get the most recent packages from the repository. In that case, run the following:

./make_chroot.sh --mirror=http://build.chromium.org/buildbot/packages --suite=chromeos_dev

That command pulls packages from the Chromium repository. Note that this is slower than a local repository. Also note you can use any of the official Ubuntu mirrors. You'll need to specify the same --mirror and --suite options to the build_image.sh script below.

Building Chromium OS

Build Chromium (optional)

If you chose to download the source code for the browser, you'll need to build the browser before you complete the rest of the build process:

./build_chrome.sh --chrome_dir ~/chromium

To build a debug version:

./build_chrome.sh --mode=Debug --chrome_dir ~/chromium

This builds Chromium, zips up the output, and puts it in the right place for build_platform_packages to pick up. 

Download Chromium binary (you MUST do this if you didn't use the step above)

Download the binary and copy it into ~/chromiumos/src/build/x86/local_assets as chrome-chromeos.zip (you have to create this directory).  This will give you a recent copy of the browser for use with Chromium OS.

Enter the chroot build environment

Run the following to get into the chroot environment:

./enter_chroot.sh

Making development easier

The following steps make development a little easier. These only need to be done once; consult the scripts for information on how to undo these steps if you change your mind later. These steps have to be done before you build the rest of your system to have them take effect.

Enable a local user account

If you are customizing Chromium OS and having trouble logging in due to your customizations, it may be handy to be able to bypass authentication and log yourself in as a test user. This is disabled by default for security reasons, but if you want to enable it for a backdoor user USERNAME:

( cd ../platform/pam_google && ./enable_localaccount.sh USERNAME )

Set the shared user password

For security, the shared user password defaults to a long random string. If you want to be able to sudo from the terminal in Chromium OS (this also includes actually installing the OS on your device), need help debugging networking, or you have some other reason for needing to log on directly as the shared user, you need to set up the password for the shared user:

./set_shared_user_password.sh

This will prompt you for a password. The encrypted password will be stored in ./shared_user_password.txt, so you only need to do this once.

Build the packages

Do this inside the chroot build environment. We build the platform packages and then the kernel. You can substitute a different config or kernel build number if you know what you are doing.

./build_platform_packages.sh
./build_kernel.sh

Build the image

Do this inside the chroot build environment.

./build_image.sh

The default output location for images is ~/chromiumos/src/build/images.

The output of build_image.sh will create a unique monotonically increasingly numbered subdir under the output location which contains the master boot record (mbr.image) and the root filesystem image (rootfs.image).  Check the output of build_image.sh to find the corresponding directory where your new image has been placed.

Using your image

Check the contents of the image

To check the contents of your image, mount it locally. In this example, SUBDIR is the subdirectory created in the previous step.

cd ~/chromiumos/src/build/images/SUBDIR
sudo mount -o loop rootfs.image rootfs
sudo chroot rootfs

You're now in the image, and can do things like see how much space is used in the image or what packages were installed:

df
dpkg -l

When done, exit the chroot shell and unmount the image:

exit
sudo umount rootfs

Copy the image to a USB key

Use image_to_usb.sh to copy the image to a USB key. Do this outside the chroot environment. (If your USB key seems blank, you're probably inside the chroot environment.) Make sure you have a 4GB USB key.

./image_to_usb.sh --from=~/chromiumos/src/build/images/SUBDIR --to=/dev/USBKEYDEV

SUBDIR is the subdirectory created by build_image.sh, and USBKEYDEV is the device for the USB key.

To determine the value for USBKEYDEV, use:

sudo fdisk -l

or

dmesg

What you want is the device for the entire key (for example, /dev/sdb, not /dev/sdb1).

By default, image_to_usb.sh copies from the most recent image you've built to /dev/sdb, so you may be able to omit the --from and/or --to options.

Copy image to hard drive (see development hardware)

WARNING: this nukes your hard drive

Boot from the USB image you just burned. (If this is the first time you've booted from USB, you may need to go into the BIOS settings and change the boot order so that it'll boot from the USB drive)

After logging in, use Ctrl+Alt+T to open a terminal window and type:

/usr/sbin/chromeos-install

Note: this will ask you for the password you set in the recommended step earlier. Unplug the USB drive, reboot and you're there.

Convert the image for VMWare

Note:  The VMWare image may have missing functionality (e.g. no virtual terminal, slow keyboard response, etc).  We suggest that developers obtain development hardware

If you want to boot from the image in a vmware session you'll need to first convert it to a vmware disk. First install qemu. Then execute these commands:

./image_to_vmware.sh --from=~/chromiumos/src/build/images/SUBDIR \
  --to=~/chromiumos/src/build/images/SUBDIR/ide.vmdk

By default, image_to_vmware.sh will convert the most recent image you've built to ide.vmdk, so you may be able to omit the --from and/or --to options.

Delete an old chroot build environment

To delete an old chroot build environment, use:

./make_chroot.sh --delete

Do NOT use rm -rf, since if there are stale bind mounts, you may end up deleting your source tree.


没有评论: