http://ads.buzzcity.net/adpage.php?partnerid=40096
分类: LINUX
2010-09-08 12:22:35
We are using as our new repository overlay tool. repo is used to checkout multiple repositories and sync them. It replaces the functionality that was previously provided by .
$ mkdir mychromiumos
$ cd mychromiumos
$ repo init -u -m minilayout.xml
#internal users use: repo init -u ssh://gitrw.chromium.org:9222/manifest-internal -m minilayout.xml
$ repo sync
To simplify dependencies, development is done inside a chroot. The following command creates the chroot for you.
$ cd src/scripts
$ ./make_chroot
$ cd src/scripts
$ ./make_chroot --fast
To enter the chroot in order to do development, run the following command:
$ ./enter_chroot.sh
You need to run setup_board in order to install the toolchain (gcc/glibc) for the target you wish to work on. setup_board also creates the initial SYSROOT the target.
(chroot) $ ./setup_board --board=x86-generic --default
The ChromiumOS equivalent of "make".
(chroot) $ ./build_packages
By default, build_packages will build the stable version of a package (i.e. from committed git sources) unless you are working on a package. If you are working on a package, build_packages will build using your local sources. See below.
The ChromiumOS equivalent of "make install".
(chroot) $ ./build_image
If you want to use the developer server (./start_devserver in the chroot) and gmerge on the device to build and merge changes that you make then you will need to disable the root filesystem signature checking. Give the flag (which will auto complete) to build_image.
(chroot) $ ./build_image --noenable_rootfs_verification
In order to modify and build a local version of a package, you must first mark it active:
(chroot) $ ./cros_workon start# Use the name of the Portage package, e.g chromeos-wm
This marks the ebuild for the given package so that build_packages will use your local changes instead of the stable, committed version.
If you don't know the package name, you can see all the available packages like this:
(chroot) $ ./cros_workon list --all
Special case: chromiumos-overlay is not in this list and cros_workon start/stop is not used. Follow the instructions below under "Making and committing your changes".
Note: cros_workon requires either a "--host" or "--board PLATFORM" option, to indicate the target that will be affected by your local changes. Chances are that this argument is being silently provided by the contents of src/scripts/.default_board. If you need to work on package changes that should be built for multiple boards, you'll need to specify each board with separate "start" commands. For that to work, you'll need to delete the .default_board file.
Now that you've specified which packages you want to edit, you'll need to ensure that you have a local copy of the sources checked out and up to date.
$ repo sync
if you run repo sync inside your chroot ensure your email is configured right in git (git config -l). If your local commit email differs from your git config email address or if your git config email address is unset a "repo sync" will discard your local commits. The make/enter chroot commands have been enhanced to copy your global git config into the chroot, so this should just work.
(chroot) $ ./cros_workon stop
$ repo start# Use the name of the repo minus the ".git", e.g. window_manager
Editing and submitting changes for review is the same as before:
# Edit, compile, test, repeat...
$ git commit -am "All your bugs are belong to us"
$ git cl upload --send-mail -r $reviewer
$ git cl push
This not only updates your git repo from the upstream source, but rebases your current branch as well. You may encounter merge problems, which you would resolve as usual.
$ repo sync
Once you've committed your changes, you should delete the branch you were working in. Otherwise, Bad Things will happen to your repository.
$ repo abandon[ ]
If you don't specify a project name, the named branch will be deleted from all projects. This may not be what you want.
You do not need to run ./cros_workon stop. If you don't, build_packages will continue to build from your local source. If all you do is work on package foo, you'll start foo once and never worry. If you need to switch from one package to another, you'll want to stop the old package and start the new one.
(chroot) $ ./cros_workon stop
(chroot) $ ./cros_workon start
Until the autotest is entirely converted, tested, and the new workflow is made default, there are no stable ebuilds for anything autotest-related, in order to not mess with the original workflow. Until that moment, the first thing that has to be done is to "workon" all autotest-related ebuilds. This also means that there will be no prebuilt packages yet.
$ cros_workon start autotest autotest-tests
$ repo sync
The operation of autotest is significantly different in cros-workon. Tests are organized in ebuilds, where each ebuild implements certain number of tests. Tests consist of a build phase and run phase, where the first is executed by the ebuild, and the second by the "run_remote_tests.sh" script, with exactly the same syntax as before. Unlike before, tests have to be built with emerge-${board} before they can be ran using run_remote_tests.sh.
Currently, tests are organized within these ebuilds:
chromeos-base/autotest-tests
To see which tests are implemented by an ebuild, run the usual pretended emerge:
$ emerge-${board} -pv autotest-tests
These are the packages that would be merged, in order:
Calculating dependencies... done!
[ebuild R ] chromeos-base/autotest-tests-9999 to /build/x86-generic/ USE="autox hardened tpmtools xset -buildcheck -opengles" TESTS="audiovideo_FFMPEG audiovideo_PlaybackRecordSemiAuto audiovideo_V4L2 build_RootFilesystemSize compilebench dbench desktopui_BrowserTest desktopui_ChromeFirstRender desktopui_ChromeSemiAuto desktopui_FlashSanityCheck desktopui_IBusTest desktopui_KillRestart desktopui_PageCyclerTests desktopui_ScreenSaverUnlock desktopui_SpeechSynthesisSemiAuto desktopui_SunSpiderBench desktopui_UITest desktopui_UrlFetch desktopui_V8Bench desktopui_WindowManagerFocusNewWindows desktopui_WindowManagerHotkeys disktest factory_Camera factory_DeveloperRecovery factory_Display factory_Dummy factory_ExternalStorage factory_Fail factory_Keyboard factory_Leds factory_RebootStub factory_Review factory_ScriptWrapper factory_ShowTestResults factory_Touchpad factory_Wipe firmware_RomSize fsx graphics_GLBench graphics_TearTest graphics_WindowManagerGraphicsCapture hackbench hardware_Backlight hardware_BluetoothSemiAuto hardware_Components hardware_DeveloperRecovery hardware_DiskSize hardware_EepromWriteProtect hardware_GPIOSwitches hardware_GPS hardware_MemoryThroughput hardware_MemoryTotalSize hardware_Resolution hardware_SAT hardware_SsdDetection hardware_StorageFio hardware_UsbPlugIn hardware_VideoOutSemiAuto hardware_bma150 hardware_tsl2563 iperf logging_KernelCrash logging_LogVolume logging_UserCrash login_Backdoor login_BadAuthentication login_ChromeProfileSanitary login_CryptohomeIncognitoMounted login_CryptohomeMounted login_CryptohomeUnmounted login_LoginSuccess login_LogoutProcessCleanup login_RemoteLogin ltp netperf2 netpipe network_3GSmokeTest network_ConnmanIncludeExcludeMultiple network_DhclientLeaseTestCase network_DisableInterface network_NegotiatedLANSpeed network_Ping network_UdevRename network_WiFiCaps network_WiFiSmokeTest network_WifiAuthenticationTests network_WlanHasIP network_netperf2 platform_AccurateTime platform_AesThroughput platform_BootPerf platform_CheckErrorsInLog platform_CleanShutdown platform_CryptohomeChangePassword platform_CryptohomeMount platform_CryptohomeTestAuth platform_DMVerityCorruption platform_DaemonsRespawn platform_DiskIterate platform_FileNum platform_FilePerms platform_FileSize platform_KernelVersion platform_MemCheck platform_MiniJailCmdLine platform_MiniJailPidNamespace platform_MiniJailPtraceDisabled platform_MiniJailReadOnlyFS platform_MiniJailRootCapabilities platform_MiniJailUidGid platform_MiniJailVfsNamespace platform_NetParms platform_OSLimits platform_PartitionCheck platform_ProcessPrivileges platform_Shutdown platform_StackProtector platform_TempFS power_Backlight power_BatteryCharge power_CPUFreq power_CPUIdle power_Draw power_Idle power_LoadTest power_Resume power_StatsCPUFreq power_StatsCPUIdle power_StatsUSB power_Status power_x86Settings realtimecomm_GTalkAudioBench realtimecomm_GTalkAudioPlayground realtimecomm_GTalkPlayground realtimecomm_GTalkunittest security_RendererSandbox unixbench -example_UnitTest -firmware_VbootCrypto -graphics_GLAPICheck -graphics_O3DSelenium -graphics_SanAngeles -graphics_WebGLConformance -hardware_TPM -hardware_TPMFirmware" 0 kB [1]
TESTS="platform_MiniJailPidNamespace platform_MiniJailPtraceDisabled" emerge-${board} -pv autotest-tests
USE="tests_platform_MiniJailPidNamespace tests_platform_MiniJailPtraceDisabled" emerge-${board} -pv autotest-tests
To modify a test, the following steps have to be taken for each modification. Let's assume we're modifying test netperf2, and the ebuild which implements it is called autotest-tests.
1) Make sure you cros-workon start autotest-tests, if you aren't working on it
2) Modify source
3) Recompile the test
TESTS="netperf2" emerge-${board} autotest-tests
4) Run the test (NOTE: this step is identical to the gclient workflow, including the syntax)
./run_remote_tests.sh --remote=client/tests/netperf2/control.parallel
5) Goto 2) if more modifications are necessary
To create a new test, the following steps have to be taken.
1) Create the source inside repository R
2) Find out which ebuild builds test from repository R, if R is a new repository, create a new ebuild for it (see below).
3) Edit the ebuild, and add tests_${testname} into the IUSE_TESTS variable. Prefix your test with a + if you want it to be enabled by default.
4) Recompile, make sure it runs, commit, etc.
To create a new ebuild, you need to utilize the autotest eclass, which wraps all the necessary steps to compile your tests. A new ebuild may have to be created if a new repository with tests is being started. Please refer to existing ebuilds for details.
fetch = "ssh://gitrw.chromium.org"review = "" /> name = "nameofgitrepo"remote = "private" />
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
[ -f "$HOME/etc/bash_completion" ] && . "$HOME/etc/bash_completion"
export PS1='\h:\W$(__git_ps1 "(%s)") \u\$ '
repo branches is what you are asking for. Otherwise, repo forall would be your friend
~/src/scripts/cros_mark_as_stable -b -p -i
~/src/platform/login-manager
which corresponds to the chromeos-login
package. After I've committed my change, I should re-sync my login-manager directory, get the commit id for the commit I just committed (can use git log | head -1
). For the sake of this example let's say it's d52c5ea1bcdcc2e0ed2f62c3d50eb7e6bda691ca
. To manually uprev the package I'd run (assuming I'm using x86-generic
):~/src/scripts/cros_mark_as_stable -b x86-generic -p "chromeos-login" -i
d52c5ea1bcdcc2e0ed2f62c3d50eb7e6bda691ca
cd ~/src/third_party/chromiumos-overlay
git cl upload -r sosa@chromium.org --send-mail
git cl push
./enter_chroot --chrome_root=/path/to/chrome/source/dir
# You only need to do this once!
./cros_workon start chromeos-base/libcros
repo sync
# If you want to always build from source you can export the variables:
export CHROME_ORIGIN=LOCAL_SOURCE
export FEATURES="-usersandbox"
export USE="-build_tests"
./build_packages
# If you want to only emerge the browser:
USE="-build_tests" FEATURES="-usersandbox" CHROME_ORIGIN=LOCAL_SOURCE emerge-x86-generic chromeos-base/chromeos-chrome
chinaunix网友2010-09-11 10:34:44
很好的, 收藏了 推荐一个博客,提供很多免费软件编程电子书下载: http://free-ebooks.appspot.com