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

From
Jump to navigation Jump to search
No edit summary
Line 14: Line 14:
LD=/tmp/mj-build/openwrt/staging_dir_mipsel/bin/mipsel-linux-uclibc-ld \
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-
CROSS_COMPILE=/tmp/mj-build/openwrt/staging_dir_mipsel/bin/mipsel-linux-uclibc-
$ cp -fpR /tmp/mj-build/openwrt/build_mipsel/loader-0.04/loader.gz /tmp/mj-build/openwrt/build_mipsel/loader.gz
$ cp -fpR /tmp/mj-build/openwrt/build_mipsel/loader-0.04/loader.o /tmp/mj-build/openwrt/build_mipsel/loader.elf
$ cp -fpR /tmp/mj-build/openwrt/build_mipsel/loader.gz /tmp/mj-build/openwrt/build_mipsel/linux-2.6-brcm/loader.tmp.gz
$ echo -ne "\\x00" >> /tmp/mj-build/openwrt/build_mipsel/linux-2.6-brcm/loader.tmp.gz


* Compress the binary code (with LZMA)
* Compress the binary code (with LZMA)
Line 22: Line 26:
* Make TRX headers
* Make TRX headers
$ /tmp/mj-build/openwrt/staging_dir_mipsel/bin/trx \
$ /tmp/mj-build/openwrt/staging_dir_mipsel/bin/trx \
-o /tmp/mj-build/openwrt/bin/openwrt-brcm-2.6-jffs2-4MB.trx \
-o /tmp/mj-build/openwrt/build_mipsel/linux-2.6-brcm/kernel.trx \
/tmp/mj-build/openwrt/build_mipsel/linux-2.6-brcm/loader.tmp.gz \
/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 \
/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
* Put loader and TRX image into resulting (bootable) kernel image
$ dd if=/tmp/mj-build/openwrt/build_mipsel/loader.elf of=/tmp/mj-build/openwrt/bin/bootable-kernel-image.bin bs=131072 conv=sync
$ cat /tmp/mj-build/openwrt/build_mipsel/linux-2.6-brcm/kernel.trx >> /tmp/mj-build/openwrt/bin/bootable-kernel-image.bin


= RootFS =
= RootFS =

Revision as of 12:49, 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-
$ cp -fpR /tmp/mj-build/openwrt/build_mipsel/loader-0.04/loader.gz /tmp/mj-build/openwrt/build_mipsel/loader.gz
$ cp -fpR /tmp/mj-build/openwrt/build_mipsel/loader-0.04/loader.o /tmp/mj-build/openwrt/build_mipsel/loader.elf
$ cp -fpR /tmp/mj-build/openwrt/build_mipsel/loader.gz /tmp/mj-build/openwrt/build_mipsel/linux-2.6-brcm/loader.tmp.gz
$ echo -ne "\\x00" >> /tmp/mj-build/openwrt/build_mipsel/linux-2.6-brcm/loader.tmp.gz
  • 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/build_mipsel/linux-2.6-brcm/kernel.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
  • Put loader and TRX image into resulting (bootable) kernel image
$ dd if=/tmp/mj-build/openwrt/build_mipsel/loader.elf of=/tmp/mj-build/openwrt/bin/bootable-kernel-image.bin bs=131072 conv=sync
$ cat /tmp/mj-build/openwrt/build_mipsel/linux-2.6-brcm/kernel.trx >> /tmp/mj-build/openwrt/bin/bootable-kernel-image.bin

RootFS


Prev | Contents