BRN:Software:Build and Distribution:Build and install an image: Difference between revisions

From
Jump to navigation Jump to search
No edit summary
No edit summary
Line 1: Line 1:
= 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 =

----
----
<span style="padding-left:0.5em">'''[[BRN:Software:Build and Distribution:RootFS|Prev]]''' | '''[[BRN:Software:Build and Distribution|Contents]]'''</span>
<span style="padding-left:0.5em">'''[[BRN:Software:Build and Distribution:RootFS|Prev]]''' | '''[[BRN:Software:Build and Distribution|Contents]]'''</span>

Revision as of 12:33, 11 October 2006

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