Flash disk 則用DD or Winimage 處理
Build firmware image
http://skywind.homelinux.com/~wind/b...?blog=5&cat=46
The DD-WRT v23 SP1 Final building guide
This guide describes step by step how to build DD-WRT v23 SP1 final firmware from source on Ubuntu 6.06 and 6.06.1 LTS (32bit, x86).
This was tested running Ubuntu in VMware. To start download and install the VMware player and also get a ready to use Ubuntu VMware image (direct torrent link). The user name and password for the image is "ubuntu". With these two programs you can directly start building DD-WRT on Windows without installing any Linux on your PC. To get files of your virtual machine e.g. use Apache, SAMBA, SCP or whatever.
If you find any errors, mistakes or have suggestions do not hesitate to discuss here. Feel free to add this document to the DD-WRT Wiki.
It’s recommended that you create a normal user account („dd-wrt“ username recommended). Do NOT use „root“ to build DD-WRT. Add the „dd-wrt“ user to /etc/sudoers or use System / Administration / Users and Groups / Properties from „dd-wrt“ user / Register User privileges / check „Executing system administration tasks“
Lets start Smile
1. Install the following Ubuntu packages and its dependencies (use apt-get or System / Administration / Synaptic Package Manager)
Code:
sudo apt-get install gcc g++ binutils patch bzip2 flex bison make autoconf gettext texinfo unzip sharutils subversion libncurses5-dev zlib1g-dev openssh-server apache2 samba uml-utilities
2. Download the sources (toolchain (69M) and the SP1 final (84M))
Code:
cd /home/dd-wrt
wget ftp://ftp.dd-wrt.com/sourcecode/tool...an.sp1.tar.bz2
wget ftp://ftp.dd-wrt.com/sourcecode/dd-w...al.src.tar.bz2
3. Unpack the toolchain
Code:
tar -jxf toolchains.x86.debian.sp1.tar.bz2
3.1 Install the toolchain
Code:
cd /home/dd-wrt/toolchains
ln -sf 3.4.6-uclibc-0.9.28 3.4.6
ln -sf 4.1.0-uclibc-0.9.28 4.1.0
3.2 Add the toolchains bin folder to your PATH environment variable
Code:
export PATH=/home/dd-wrt/toolchains/4.1.0/bin:$PATH
4. Create some folders and symbolic links needed by the build process
Code:
cd /home/dd-wrt
mkdir -p /home/dd-wrt/image
sudo mkdir -p /home/dev/workspace /home/backup/mikrotik
sudo ln -sf /home/dd-wrt/image /GruppenLW
sudo ln -sf /home/dd-wrt /home/dev/workspace
sudo ln -sf /home/dd-wrt/toolchains /home/backup/mikrotik/toolchain
5. Unpack the v23 SP1 final tarball
Code:
tar -jxf dd-wrt.v23.SP1-Final.src.tar.bz2
5.1 Fix some permissions
Code:
cd /home/dd-wrt/DD-WRT
chmod +x src/router/iptables/extensions/.dccp-test
chmod +x src/router/iptables/extensions/.layer7-test
chmod +wxxx src/router/samba
5.2 Fix the path in the zlib Makefile (line 42)
Code:
vi src/router/zlib/Makefile
-prefix =/usr/local
+prefix =/home/dd-wrt/DD-WRT
5.3 Some more fixes
Code:
cd /home/dd-wrt/DD-WRT/opt
rm libgcc_s.so
ln -sf libgcc/libgcc_s.so.1 libgcc_s.so
cd /home/dd-wrt/DD-WRT/src/linux
ln -sf linux.v23 linux
5.4 Set the toolchain bin folder to your PATH environment. (skip this point if your username is „dd-wrt“, line 3 and line 27)
Code:
cd /home/dd-wrt/DD-WRT/opt
vi install.sh
-export PATH=/home/dd-wrt/toolchains/3.4.6/bin:$MYPATH
+export PATH=/home/dd-wrt/toolchains/3.4.6/bin:$MYPATH
-export PATH=/home/dd-wrt/toolchains/4.1.0/bin:$MYPATH
+export PATH=/home/dd-wrt/toolchains/4.1.0/bin:$MYPATH
5.5 To be able to build SP1 final on a 32bit operating system you need a 32bit version of the mksquashfs-lzma file. You can follow the relevant parts at Compiling DD-WRT Sources. I recommend you download my precompiled mksquashfs-lzma file (attached to this post) and move it into the right folder:
Code:
cd /home/dd-wrt
wget -O mksquashfs-lzma.tar.gz "http://www.dd-wrt.com/phpBB2/download.php?id=312"
tar -xzf mksquashfs-lzma.tar.gz
chmod +x mksquashfs-lzma
mv -f mksquashfs-lzma /home/dd-wrt/DD-WRT/src/linux/linux.v23/scripts/squashfs
6. Finally start the build process. If install.sh breaks just rerun it. If it runs the second time it finishes the build process and creates valid images
Code:
cd /home/dd-wrt/DD-WRT/opt
./install.sh
6.1 After several coups of tea or coffee (or after about 1.5 hours) later you should have images in /home/dd-wrt/image
7. Information for this guide was taken from
- Compiling DD-WRT Sources
- Building From Source
- http://www.cardoe.demon.co.uk/
- Firmware Modification Kit
- µTorrent