SVN HTTP Repository Access

To checkout the DebWrt build environment:

  • 12.09 release (stable):
    svn checkout https://svn.debwrt.net/debwrt/branches/12.09 debwrt-12.09
    
  • Trunk (latest development):
    svn checkout https://svn.debwrt.net/debwrt/trunk debwrt-trunk
    

Known fingerprint of the https server {{{ 15:dd:03:49:ee:63:0f:1c:a8:e3:8e:24:20:cc:1c:25:24:75:c4:ce }}}

The DebWrt build environment has been developed and tested on Debian and Ubuntu hosts. However I do expect that building on other Linux distributions should work. If it does not, use the steps explained in XenoBuild.

Much more information on using the DebWrt build environment will follow.

Pre-requisites

  • Kernel:
    • make openwrt/all will give a list of dependencies
      • python
      • flex
      • git
      • gawk
      • zlib1g
      • zlib1g-dev
      • unzip
  • Root filesystem & Cross compile environment:
    • debootstrap, comes with any Debian or Ubuntu versions ( it can be downloaded for other distros )
    • run as normal user
    • gid of the normal user must be >= 1000
    • uid of the normal user must be >= 1000
    • this normal user must have sudo rights - for example: amain ALL=(ALL) NOPASSWD: ALL
    • debian packages
      • subversion
      • build-essentails
      • libncurses5-dev
      • chroot or coreutils
      • qemu-user-static
      • makedev

Do it all in one turn

  • make menuconfig
  • make V=99

Detailed build instructions

Kernel compile

  • make menuconfig
    • Select your target device type
    • And that should be it
  • ( optional ) make openwrt/menuconfig
  • make openwrt/all V=99
  • binaries in bin/
  • follow instructions on OpenWrt how to flash the firmware to your specific device

Root filesystem creation: Stage 1

  • Preferably compile a kernel first, but this is not necessary ( hmm, rereading this now: it might be better to compile openwrt kernel first. Not sure if this still works :-) )
  • Make sure you have full sudo rights, preferably without the need for typing a password
  • All work is done in a chroot jail to prevent messing up the host root filesystem
  • make menuconfig
    • Select your target device type
    • Optional: selection Debian version
  • make debian/rootfs
  • make debian/rootfs/modules-install
  • rootfs in: build/rootfs-<ARCH>-<DEBWRT_RELEASE>-<DEBWRT_VERSION>-<RELEASE>/
  • install by copying manually or:
    • mount your USB Disk/USB Stick/SD Card/CF Card/IDE/SATA root partition with ext3 on /media/DEBWRT_ROOT
    • make debian/rootfs/install
    • it will install the rootfs in /media/DEBWRT_ROOT ( an rm -rf is done first! )
  • continue with stage 2

Root filesystem creation: Stage 2

Stage one prepared a filesystem with debootstrap. A DebWrt Debian root filesystem for the selected architecture(mips, mipsel, ...) has been created. It includes a default Debian installation with some important DebWrt cross-compiled packages installed. When you selected the option "Use qemu to perform Debian second stage install on the host" with menuconfig, second stage has already been done on the host using qemu. If not, follow these instructions:

  • Flash the device with the compiled DebWrt kernel
  • Boot the device. It will boot in 'firstboot' mode.
  • Connect via a serial console or login via ssh or telnet ( device default IP's: eth0: 192.168.1.1, eth0.1: 192.168.1.20 )
  • Perform the PostInstall /usr/sbin/PostInstall ( which basically executes /debootstrap/debootstrap --second-stage )

note: the command make chr becomes available if the second stage was done with qemu. It enters the target (alien architecture) change root file system and allows you to do any post installation steps you want to perform. For example: apt-get update; apt-get install <package>; ....

Root filesystem image information

See DebWrtRootfsImageInformation for default IP address, password, installed packages, etc.

How to use the Emdebian based cross-compile environment

  • Preferably compile a kernel first, but this is not necessary
  • Make sure you have full sudo rights, preferably without the need for typing a password
  • All work is done in a chroot jail to prevent messing up the host root filesystem
  • make menuconfig
    • Select your target device type
    • Optional: selection Debian version
  • make debian/buildenv
  • make chu - enter chroot as normal user
  • make ch - enter chroot as root
  • make debian/package/all - build all packages
  • make debian/package/XX - build a specific package
  • make debian/package/XX/clean - clean up a specific package
  • For a complete overview see: DebWrtMan

note: have a look in the Makefiles, there are a lot more Makefile targets ( pre setup commands ) available doing all kinds of handy stuff.

Last modified 18 months ago Last modified on Jun 30, 2013 12:35:01 PM