⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bk-kernel-howto.txt

📁 Linux Kernel 2.6.9 for OMAP1710
💻 TXT
字号:
		   Doing the BK Thing, Penguin-StyleThis set of notes is intended mainly for kernel developers, occasionalor full-time, but sysadmins and power users may find parts of it usefulas well.  It assumes at least a basic familiarity with CVS, both at auser level (use on the cmd line) and at a higher level (client-server model).Due to the author's background, an operation may be described in termsof CVS, or in terms of how that operation differs from CVS.This is -not- intended to be BitKeeper documentation.  Always run"bk help <command>" or in X "bk helptool <command>" for referencedocumentation.BitKeeper Concepts------------------In the true nature of the Internet itself, BitKeeper is a distributedsystem.  When applied to revision control, this means doing away withclient-server, and changing to a parent-child model... essentiallypeer-to-peer.  On the developer's end, this also represents afundamental disruption in the standard workflow of changes, commits,and merges.  You will need to take a few minutes to think abouthow to best work under BitKeeper, and re-optimize things a bit.In some sense it is a bit radical, because it might described astossing changes out into a maelstrom and having them magicallyland at the right destination... but I'm getting ahead of myself.Let's start with this progression:Each BitKeeper source tree on disk is a repository unto itself.Each repository has a parent (except the root/original, of course).Each repository contains a set of a changesets ("csets").Each cset is one or more changed files, bundled together.Each tree is a repository, so all changes are checked into the localtree.  When a change is checked in, all modified files are groupedinto a logical unit, the changeset.  Internally, BK links thesechangesets in a tree, representing various converging and diverginglines of development.  These changesets are the bread and butter ofthe BK system.After the concept of changesets, the next thing you need to get usedto is having multiple copies of source trees lying around.  This -really-takes some getting used to, for some people.  Separate source treesare the means in BitKeeper by which you delineate parallel linesof development, both minor and major.  What would be branches inCVS become separate source trees, or "clones" in BitKeeper [heh,or Star Wars] terminology.Clones and changesets are the tools from which most of the power ofBitKeeper is derived.  As mentioned earlier, each clone has a parent,the tree used as the source when the new clone was created.  In aCVS-like setup, the parent would be a remote server on the Internet,and the child is your local clone of that tree.Once you have established a common baseline between two source trees --a common parent -- then you can merge changesets between those twotrees with ease.  Merging changes into a tree is called a "pull", andis analagous to 'cvs update'.  A pull downloads all the changesets inthe remote tree you do not have, and merges them.  Sending changes inone tree to another tree is called a "push".  Push sends all changesin the local tree the remote does not yet have, and merges them.From these concepts come some initial command examples:1) bk clone -q http://linux.bkbits.net/linux-2.5 linus-2.5Download a 2.5 stock kernel tree, naming it "linus-2.5" in the local dir.The "-q" disables listing every single file as it is downloaded.2) bk clone -ql linus-2.5 alpha-2.5Create a separate source tree for the Alpha AXP architecture.The "-l" uses hard links instead of copying data, since both trees areon the local disk.  You can also replace the above with "bk lclone -q ..."You only clone a tree -once-.  After cloning the tree lives a long timeon disk, being updating by pushes and pulls.3) cd alpha-2.5 ; bk pull http://gkernel.bkbits.net/alpha-2.5Download changes in "alpha-2.5" repository which are not presentin the local repository, and merge them into the source tree.4) bk -r co -qBecause every tree is a repository, files must be checked out beforethey will be in their standard places in the source tree.5)	bk vi fs/inode.c				# example change...	bk citool					# checkin, using X tool	bk push bk://gkernel@bkbits.net/alpha-2.5	# upload changeTypical example of a BK sequence that would replace the analagous CVSsituation,	vi fs/inode.c	cvs commitAs this is just supposed to be a quick BK intro, for more in-depthtutorials, live working demos, and docs, see http://www.bitkeeper.com/BK and Kernel Development Workflow----------------------------------Currently the latest 2.5 tree is available via "bk clone $URL"and "bk pull $URL" at http://linux.bkbits.net/linux-2.5This should change in a few weeks to a kernel.org URL.A big part of using BitKeeper is organizing the various trees you haveon your local disk, and organizing the flow of changes among thosetrees, and remote trees.  If one were to graph the relationships betweena desired BK setup, you are likely to see a few-many-few graph, likethis:		    linux-2.5		        |	       merge-to-linus-2.5		 /    |      |	        /     |      |	vm-hacks  bugfixes  filesys   personal-hacks	      \	      |	     |		/	       \      |      |         /		\     |      |        /	         testing-and-validationSince a "bk push" sends all changes not in the target tree, andsince a "bk pull" receives all changes not in the source tree, you wantto make sure you are only pushing specific changes to the desired tree,not all changes from "peer parent" trees.  For example, pushing a changefrom the testing-and-validation tree would probably be a bad idea,because it will push all changes from vm-hacks, bugfixes, filesys, andpersonal-hacks trees into the target tree.One would typically work on only one "theme" at a time, eithervm-hacks or bugfixes or filesys, keeping those changes isolated intheir own tree during development, and only merge the isolated withother changes when going upstream (to Linus or other maintainers) ordownstream (to your "union" trees, like testing-and-validation above).It should be noted that some of this separation is not just recommendedpractice, it's actually [for now] -enforced- by BitKeeper.  BitKeeperrequires that changesets maintain a certain order, which is the reasonthat "bk push" sends all local changesets the remote doesn't have.  Thisseparation may look like a lot of wasted disk space at first, but ithelps when two unrelated changes may "pollute" the same area of code, ordon't follow the same pace of development, or any other of the standardreasons why one creates a development branch.Small development branches (clones) will appear and disappear:	-------- A --------- B --------- C --------- D -------	          \                                 /		   -----short-term devel branch-----While long-term branches will parallel a tree (or trees), with periodmerge points.  In this first example, we pull from a tree (pulls,"\") periodically, such as what occurs when tracking changes in avendor tree, never pushing changes back up the line:	-------- A --------- B --------- C --------- D -------	          \                       \           \	           ----long-term devel branch-----------------And then a more common case in Linux kernel development, a long termbranch with periodic merges back into the tree (pushes, "/"):	-------- A --------- B --------- C --------- D -------	          \                       \         / \	           ----long-term devel branch-----------------Submitting Changes to Linus---------------------------There's a bit of an art, or style, of submitting changes to Linus.Since Linus's tree is now (you might say) fully integrated into thedistributed BitKeeper system, there are several prerequisites toproperly submitting a BitKeeper change.  All these prereq's are justgeneral cleanliness of BK usage, so as people become experts at BK, feelfree to optimize this process further (assuming Linus agrees, ofcourse).0) Make sure your tree was originally cloned from the linux-2.5 treecreated by Linus.  If your tree does not have this as its ancestor, itis impossible to reliably exchange changesets.1) Pay attention to your commit text.  The commit message thataccompanies each changeset you submit will live on forever in history,and is used by Linus to accurately summarize the changes in eachpre-patch.  Remember that there is no context, so	"fix for new scheduler changes"would be too vague, but	"fix mips64 arch for new scheduler switch_to(), TIF_xxx semantics"would be much better.You can and should use the command "bk comment -C<rev>" to update thecommit text, and improve it after the fact.  This is very useful fordevelopment: poor, quick descriptions during development, which getcleaned up using "bk comment" before issuing the "bk push" to submit thechanges.2) Include an Internet-available URL for Linus to pull from, such as	Pull from:  http://gkernel.bkbits.net/net-drivers-2.53) Include a summary and "diffstat -p1" of each changeset that will bedownloaded, when Linus issues a "bk pull".  The author auto-generatesthese summaries using "bk changes -L <parent>", to obtain a listingof all the pending-to-send changesets, and their commit messages.It is important to show Linus what he will be downloading when he issuesa "bk pull", to reduce the time required to sift the changes once theyare downloaded to Linus's local machine.IMPORTANT NOTE:  One of the features of BK is that your repository doesnot have to be up to date, in order for Linus to receive your changes.It is considered a courtesy to keep your repository fairly recent, tolessen any potential merge work Linus may need to do.4) Split up your changes.  Each maintainer<->Linus situation is likelyto be slightly different here, so take this just as general advice.  Theauthor splits up changes according to "themes" when merging with Linus.Simultaneous pushes from local development go to special trees whichexist solely to house changes "queued" for Linus.  Example of the trees:	net-drivers-2.5 -- on-going net driver maintenance	vm-2.5 -- VM-related changes	fs-2.5 -- filesystem-related changesLinus then has much more freedom for pulling changes.  He could (forexample) issue a "bk pull" on vm-2.5 and fs-2.5 trees, to merge theirchanges, but hold off net-drivers-2.5 because of a change that needsmore discussion.Other maintainers may find that a single linus-pull-from tree isadequate for passing BK changesets to him.Frequently Answered Questions-----------------------------1) How do I change the e-mail address shown in the changelog?A. When you run "bk citool" or "bk commit", set environment   variables BK_USER and BK_HOST to the desired username   and host/domain name.2) How do I use tags / get a diff between two kernel versions?A. Pass the tags Linus uses to 'bk export'.ChangeSets are in a forward-progressing order, so it's pretty easyto get a snapshot starting and ending at any two points in time.Linus puts tags on each release and pre-release, so you could usethese two examples:    bk export -tpatch -hdu -rv2.5.4,v2.5.5 | less        # creates patch-2.5.5 essentially    bk export -tpatch -du -rv2.5.5-pre1,v2.5.5 | less        # changes from pre1 to finalA tag is just an alias for a specific changeset... and since changesetsare ordered, a tag is thus a marker for a specific point in time (orspecific state of the tree).3) Is there an easy way to generate One Big Patch versus mainline,   for my long-lived kernel branch?A. Yes.  This requires BK 3.x, though.	bk export -tpatch -r`bk repogca bk://linux.bkbits.net/linux-2.5`,+

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -