OpenWRT firmware for routers
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
Go to file
Thibaut VARÈNE 050fb3b55c tools/firmware-utils: mktplinkfw* fix rootfs offset
With '-a' specified on the command line, the current code:
- computes an aligned _kernel length_ instead of an aligned _rootfs
  offset_.
- does not update the rootfs offset after computing the new kernel
  length, and instead retains the layout default.

When the kernel length exceeds the available space left with this
fixed offset, the resulting image header contains invalid data, with
the recorded rootfs offset overlapping the kernel area.

This patch ensures that rootfs offset is correctly computed and
reflected in the final image.

Furthermore, the build_fw() function special cases the rootfs_align
option because of the above invalid logic. This is also fixed and
the computed (or command-line provided, or layout-provided) rootfs_ofs
value is used in all cases.

There seems to be no valid reason to extend the kernel length beyond
the actual length of the kernel itself (OFW images don't do it) so this
part of the existing behavior is dropped.

Example image before the patch:
Kernel data offset     : 0x00000200 /      512 bytes
Kernel data length     : 0x00158438 /  1410104 bytes
Kernel load address    : 0x00000080
Kernel entry point     : 0x00000080
Rootfs data offset     : 0x00140000 /  1310720 bytes
Rootfs data length     : 0x001e4f7e /  1986430 bytes

Example image after the patch:
Kernel data offset     : 0x00000200 /      512 bytes
Kernel data length     : 0x001583fe /  1410046 bytes
Kernel load address    : 0x00000080
Kernel entry point     : 0x00000080
Rootfs data offset     : 0x00158600 /  1410560 bytes
Rootfs data length     : 0x001e4e22 /  1986082 bytes

Tested-by: Mathias Kresin <dev@kresin.me>
Tested-by: Stefan Lippers-Hollmann <s.l-h@gmx.de>
Tested-by: Daniel Engberg <daniel.engberg.lists@pyret.net>
Tested-by: Henryk Heisig <hyniu@o2.pl>
Signed-off-by: Thibaut VARÈNE <hacks@slashdirt.org>
7 years ago
.github github: include pull request template 7 years ago
config mpc85xx: Enable initramfs for p1020 subtarget 7 years ago
include build: fix module symbol collection if build_dir is a symlink 7 years ago
package ltq-ptm: add missing depency to ltq-?dsl-*-mei 7 years ago
scripts scripts/config: add qconf files to .gitignore 7 years ago
target sunxi: add Orange Pi 2 support 7 years ago
toolchain gcc: remove support for libgcj/java 7 years ago
tools tools/firmware-utils: mktplinkfw* fix rootfs offset 7 years ago
.gitattributes add .gitattributes to prevent the git autocrlf option from messing with CRLF/LF in files 12 years ago
.gitignore gitignore: add /overlay 7 years ago
BSDmakefile add missing copyright header 17 years ago
Config.in branding: add LEDE branding 8 years ago
LICENSE finally move buildroot-ng to trunk 8 years ago
Makefile build: prepare config.seed before package compilation 7 years ago
README README: Update project README 8 years ago
feeds.conf.default Add video feed to feeds.conf.default 7 years ago
rules.mk rukes.mk: this patch broken grub2 builds 7 years ago

README

This is the buildsystem for the LEDE Linux distribution.

Please use "make menuconfig" to choose your preferred
configuration for the toolchain and firmware.

You need to have installed gcc, binutils, bzip2, flex, python, perl, make,
find, grep, diff, unzip, gawk, getopt, subversion, libz-dev and libc headers.

Run "./scripts/feeds update -a" to get all the latest package definitions
defined in feeds.conf / feeds.conf.default respectively
and "./scripts/feeds install -a" to install symlinks of all of them into
package/feeds/.

Use "make menuconfig" to configure your image.

Simply running "make" will build your firmware.
It will download all sources, build the cross-compile toolchain, 
the kernel and all choosen applications.

To build your own firmware you need to have access to a Linux, BSD or MacOSX system
(case-sensitive filesystem required). Cygwin will not be supported because of
the lack of case sensitiveness in the file system.


Sunshine!
	Your LEDE Community
	http://www.lede-project.org