BRN:Software:Build and Distribution:Build and install an image

From
Revision as of 12:33, 11 October 2006 by Jeschke (talk | contribs)
Jump to navigation Jump to search

Kernel

ELF-executable compressed kernel image

  • Strip off some (unneeded) binary code segments
$ /tmp/mj-build/openwrt/staging_dir_mipsel/bin/mipsel-linux-uclibc-objcopy -O binary \
  -R .reginfo \
  -R .note \
  -R .comment \
  -R .mdebug \
  -S /tmp/mj-build/openwrt/build_mipsel/linux-2.6-brcm/linux-2.6.16.7/vmlinux /tmp/mj-build/openwrt/build_mipsel/linux-2.6-brcm/vmlinux
  • Build loader program for decompressing LZMA-compressed at boot time
$ make -C /tmp/mj-build/openwrt/build_mipsel/loader-0.04 \
       CC=/tmp/mj-build/openwrt/staging_dir_mipsel/bin/mipsel-linux-uclibc-gcc \
       LD=/tmp/mj-build/openwrt/staging_dir_mipsel/bin/mipsel-linux-uclibc-ld \
       CROSS_COMPILE=/tmp/mj-build/openwrt/staging_dir_mipsel/bin/mipsel-linux-uclibc-
  • Compress the binary code (with LZMA)
$ cat /tmp/mj-build/openwrt/build_mipsel/linux-2.6-brcm/vmlinux \
  | /tmp/mj-build/openwrt/staging_dir_mipsel/bin/lzma e \
      -si -so -eos -lc1 -lp2 -pb2 > /tmp/mj-build/openwrt/build_mipsel/linux-2.6-brcm/vmlinux.lzma
  • Make TRX headers
$ /tmp/mj-build/openwrt/staging_dir_mipsel/bin/trx \
      -o /tmp/mj-build/openwrt/bin/openwrt-brcm-2.6-jffs2-4MB.trx \
      /tmp/mj-build/openwrt/build_mipsel/linux-2.6-brcm/loader.tmp.gz \
      /tmp/mj-build/openwrt/build_mipsel/linux-2.6-brcm/vmlinux.lzma \
      -a 0x10000 /tmp/mj-build/openwrt/build_mipsel/linux-2.6-brcm/root.jffs2-4MB
  • Put loader and TRX image into resulting (bootable) kernel image

RootFS


Prev | Contents