So Tired !_! 逆水行舟, 不进则退!


[HOWTO] Build OpenWRT Trunk from svn on Mac OS X

发布在 Nick Xu

I recommend following these steps
1) Install XCode & Macports
2) Getting a build environment ready
3) Grabbing sources
4) Modifying Makefiles (e2fsprogs really doesn't like 64-bit Lion, and qemu refuses to compile)
5) Installing the missing dependancies
6) Building OpenWRT (from Updating Feeds on)


1. XCode & Macports
a. You will need to install Xcode 4.0 from the Apple developers' webpage, which will redirect you to the App Store entry for Xcode where you will follow the instructions on that page to install.

b. Then,  grab the latest MacPorts .pkg installer for Lion.
Mount the disk image and install MacPorts with the .pkg file. Open the from /Applications/Utilities

sudo port -v selfupdate && sudo port install subversion

Follow these directions if the above command does not work after mounting the dmg and installing.


port select --list gcc

Should give you an output similar to

air:~ alex$ port select --list gcc

Available versions for gcc:




mp-gcc44 (active)


I do not believe the version of gcc matters, but if it does, here's how to replicate my set up:

sudo port install gcc44 && sudo port select --set gcc mp-gcc44

Don't follow the above step unless you run into trouble later in the HOWTO when we try to compile OpenWRT.  The above command will build gcc-4.4 from scratch and that takes time. A lot of time.


2. Set up the build environment
a. Now install the packages needed to manipulate the OpenWRT source (horizontal scroll to see entire command, its long):

sudo port install coreutils asciidoc binutils bzip2 fastjar flex getopt gtk2 intltool jikes zlib openssl p5-extutils-makemaker python26 rsync ruby sdcc unzip gettext libxslt bison gawk autoconf wget gmake ncurses

While this is compiling the packages for your system, continue on to 2b and 3a since they don't depend on any of the above packages.

b. The OpenWRT source is case-sensitive, unfortunately HFS+ drives formatted by Apple are not set to be case-sensitive; so we're going to create a .sparseimage workspace by opening Disk Utility in the /Applications/Utilities directory.

Click File -> New -> Blank Disk Image...
On the top of the dialog that just came up fill in "OpenWRT" without the quotes in the Save As: field and in the lower Name: field.

Choose a size larger than 3GB. My disk image is ~8G and will reach it's limit after compiling the packages and firmware images more than a few times.
IMPORTANT: In the Format: drop down, select  Mac OS Extended (case-sensitive

In the Image Format: drop down select "sparse disk image". Then click Create. The newly created disk image will be on the left panel of the Disk Utility, double clicking it will mount it on /Volumes/OpenWRT

3.Grabbing the source tree
a. Open the Terminal and type:

cd /Volumes/OpenWRT && svn co svn://

Give it a few minutes while it pulls the source from the repository.

4. Modifying Makefiles
Open and open /Volume/OpenWRT/trunk/tools/Makefile

cd /Volume/OpenWRT/trunk && open tools/Makefile

On line 17 erase the "e2fsprogs entry so it should look like this:

tools-y += sstrip ipkg-utils genext2fs  mtd-utils mkimage

Comment out line 22 like so:

#tools-$(CONFIG_TARGET_x86) += qemu

Then go on to comment out line 50, line 52, line 58; they are the build dependencies for mtd-utils (dep: e2fsprogs), qemu (dep: e2fsprogs), and e2fsprogs respectively.

5. Installing the missing dependencies
Now let's install and copy MacPort's e2fsprogs and osso-uuid's libraries and headers so we can build tools/mtd-utils correctly

sudo port install e2fsprogs osso-uuid

Followed by:

cd /Volumes/OpenWRT/trunk;

mkdir -p staging_dir/host/include/e2fsprogs;

cp -R /opt/local/include/ossp staging_dir/host/include/e2fsprogs/;

cp /opt/local/lib/libuuid* staging_dir/host/lib

Then follow this manual on how to build OpenWRT now that you have successfully built the necessary tools to compile OpenWRT images on Mac OS X 10.7 Lion.

Start from the section titled "Updating Feeds" and follow the wiki in it's entirety. Do not select any 'qemu' entries when you reach the make menuconfig step; qemu will not build on 64-bit Lion.



发布在 Nick Xu





enable-auto-props = yes

*.* = svn:needs-lock=*

* = svn:needs-lock=*



将Subversion(svn) 安装成为windows service服务

发布在 Nick Xu

以前的svnserve要想成为windows服务,必须依赖于svnservice或其他工具。从Subversion1.4开 始,Subversion本身就集成Windows服务的工具。

1,安装svnservice在Windows NT中(包括Windows XP, Windows 2000, Windows 2003 Server)本身包含了一个安装服务的工具,叫做"Service Control",也就是sc.exe。
例如我的Subversion安装在"D:Subversion",版本库在"D:svnroot",而我希望对应的Subversion服务名为 svnservice,安装这个svn服务的命令就可以这样写:
sc create svnservice
binpath= "D:Subversionbinsvnserve.exe --service -r D:svnroot"
displayname= "SVNService"
depend= Tcpip

请注意,因为便于察看,上面的命令分为多行,但在实际执行时应该在一行里。另外,在以前启动svnserve时会使用"-d"选项,也就是守护进程模式, 在这里不能使用,会导致服务无法启动。同样,"-i"和"-t"选项也不能使用。
在命令行窗口执行完这个命令之后,服务还没有启动,你可以继续运行"net start svnservice"启动这个服务,然后使用"net stop svnservice"停止服务。
另 外还有两点需要小心处理。首先,如果路径中包括空格,一定要用“”处理“"”号,例如上面的例子中如果svnserve.exe在“c: program filessubversion”中,则命令应该写为“binpath= ""c:program filessubversionbinsvnserve.exe"”(“”中的内容),整个命令如下,红色部分是改变部分:
sc create svnservice
binpath= ""D:program filesSubversionbinsvnserve.exe" --service -r D:svnroot"
displayname= "SVNService"
depend= Tcpip

其次,sc对选项的格式还有要求,例如“depend= Tcpip”不能写为“depend = Tcpip”或“depend=Tcpip”,也就是“=”前不能有空各,而后面必须有空格。

2,删除服务如果服务安装的有问题,你可能需要删除服务。要删除前面添加的服务,只需要运行"sc delete svnservice","svnservice"就是我们创建服务时使用的名字。

3,配置服务是自动启动默认情况下安装的服务不会随Windows的启动而启动,为了使svn服务能够随Windows启动而启动,需要修改一下"sc create"命令(首先要删除),增加"start= auto"选项:
sc create svnservice
binpath= "D:Subversionbinsvnserve.exe --service -r D:svnroot"
displayname= "SVNService"
depend= Tcpip
start= auto




发布在 Nick Xu




find . -type d -name ".svn"|xargs rm -rf


find . -type d -iname ".svn" -exec rm -rf {} ;

全部搞定。( amp;goto=nextnewset)


xcopy project_dir project_dir_1 /s /i

for /r . %%a in (.) do @if exist "%%a.svn" rd /s /q "%%a.svn"



Jon Galloway提供了一段注册表代码,可以将”Delete SVN Folders”命名增加到资源管理器的右键上,这样,鼠标点两下就能把选中目录下的所有.svn目录干掉了。Works just great!


Windows Registry Editor Version 5.00 

@="Delete SVN Folders" 

@="cmd.exe /c "TITLE Removing SVN Folders in %1 && COLOR 9A && FOR /r "%1" %%f IN (.svn) DO RD /s /q "%%f" ""