openwrt/scripts
Jonas Gorski ee76bd11bb images: fix boot failures on NAND with small sub pages
SquashFS has a minimum block size of at least 1k, so we need to make
sure the last data block is also at least that big.

This is not an issue on NOR or SD CARD devices, since their rootfs
partitions go all the way to the end of the usable space.

But on NAND with ubiblock, the rootfs partition will be the exact space,
rounded up to LEB size. Unfortunately, some NAND chips with small sub
pages have a LEB size of x.5 kiB. This can cause the the last data block
to be less than 1k, which will cause the last block to be inaccessible,
causing boot failures as seen on MR24:

[    1.532960] block ubiblock0_3: created from ubi0:3(rootfs)
[    1.538457] ubiblock: device ubiblock0_3 (rootfs) set to be root filesystem
[    1.552847] SQUASHFS error: squashfs_read_data failed to read block 0x621472
[    1.559896] squashfs: SQUASHFS error: unable to read id index table
[    1.566474] VFS: Cannot open root device "(null)" or unknown-block(254,0): error -5

Since on most NOR devices, the start of the squashfs partition is not
aligned. Since the start of the rootfs_data partition there is dependend
on the SquashFS size, we cannot just always pad it, as the padding could
creep into the rootfs_data partition, breaking jffs2.

So fix this by ensuring a squashfs rootfs is always a multiple of 1k
only for UBI and NAND sysupgrade images.

Fixes #2460 without affecting NOR devices.

Tested-by: Russell Senior <russell@personaltelco.net>
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
2019-09-14 11:43:19 +02:00
..
config scripts/config: fix *c_shipped build depency tracking 2019-06-20 17:11:07 +02:00
flashing scripts/jungo-image: convert to Python 3 with 2-to-3 2019-07-26 08:09:16 +02:00
arm-magic.sh scripts/arm-magic.sh: make the generated kernels also include $IMG_PREFIX 2015-05-28 10:48:23 +00:00
brcmImage.pl merge: targets: update image generation and targets 2017-12-08 19:41:18 +01:00
bundle-libraries.sh scripts: bundle-libraries: fix logic flaw 2018-08-29 14:19:43 +02:00
checkpatch.pl merge: base: update base-files and basic config 2017-12-08 19:41:18 +01:00
clang-gcc-wrapper build: fix build on Mac OS X 10.9 2013-10-28 15:15:09 +00:00
clean-package.sh build: fix STAGING_DIR cleaning when filenames contain spaces 2019-05-17 21:41:43 +02:00
cleanfile build: remove absolute path to perl and replace with /usr/bin/env perl 2017-05-02 14:33:58 +02:00
cleanpatch build: remove absolute path to perl and replace with /usr/bin/env perl 2017-05-02 14:33:58 +02:00
combined-ext-image.sh combined-ext-image.sh: generate image in temp dir 2018-01-13 07:58:46 +01:00
combined-image.sh scripts: make all scripts executable 2017-07-14 04:09:16 +02:00
config.guess scripts: update config.guess and config.sub 2018-11-01 17:16:52 +01:00
config.rpath add config.rpath and link it in autotools.mk if missing, some packages might need it, especially users of lib-link.m4 or iconv.m4 2011-02-27 15:39:27 +00:00
config.sub scripts: update config.guess and config.sub 2018-11-01 17:16:52 +01:00
deptest.sh scripts: avoid hard-coded paths in scripts 2016-04-28 16:43:28 +02:00
diffconfig.sh scripts/diffconfig.sh: fix output if TARGET_PER_DEVICE_ROOTFS is set 2016-10-06 22:00:10 +02:00
dl_cleanup.py dl_cleanup: Fix linux blacklist 2015-10-07 10:51:18 +00:00
dl_github_archive.py scripts/dl_github_archive.py: fix python3 transition 2019-08-20 13:34:58 +00:00
download.pl download.pl: use https://source.openwrt.org 2019-08-18 15:19:22 +00:00
env env: only use color diffs on terminals 2018-05-05 09:44:43 +02:00
ext-toolchain.sh scripts: Probe external toolchains for libthread-db 2017-05-11 13:43:01 -07:00
feeds scripts/feeds: fix 'src-include' directive 2019-09-02 16:48:40 +02:00
fixup-makefile.pl fixup-makefile.pl: fixup when PKG_SOURCE is defined elsewhere 2018-07-05 01:30:57 +08:00
functions.sh images: fix boot failures on NAND with small sub pages 2019-09-14 11:43:19 +02:00
gen-dependencies.sh gen-dependencies.sh: fix handling variations in "file" output 2017-02-19 16:56:18 +01:00
gen_image_generic.sh scripts/gen_image_generic.sh: fail on errors 2019-03-27 00:13:30 +02:00
get_source_date_epoch.sh scripts: get_source_date_epoch.sh: fix mercurial support, add mtime fallback 2017-02-02 00:13:50 +01:00
getver.sh scripts/getver.sh: append short git hash based on upstream commit 2017-02-01 17:48:45 +01:00
ipkg-build script: ipkg-build: honour $SOURCE_DATE_EPOCH 2018-11-08 11:52:33 +01:00
ipkg-make-index.sh scripts: ipkg-make-index.sh: dereference symbolic links 2019-01-31 12:35:29 +01:00
ipkg-remove scripts: ipkg-remove: handle existing .ipk files without SourceName field 2019-01-21 16:35:40 +01:00
kconfig.pl treewide: replace nbd@openwrt.org with nbd@nbd.name 2016-06-07 08:58:42 +02:00
linksys-image.sh build: add a script for generating Linksys factory images 2019-01-26 21:43:07 +01:00
make-ipkg-dir.sh branding: add LEDE branding 2016-03-24 22:40:13 +01:00
md5sum improve support for building on mac os x by improving detection of missing components 2009-01-25 19:00:43 +00:00
metadata.pm build: allow overriding default selection state for devices 2019-08-13 22:13:18 +02:00
mkhash.c build: add a small standalone utility for calculating md5/sha256 hash 2017-01-05 11:09:12 +01:00
mkits-qsdk-ipq-image.sh build: add helpers for generating QSDK sysupgrade compatible images 2019-02-25 17:36:16 +01:00
mkits.sh build: Allow to change the FIT config section name 2018-03-17 08:09:04 +01:00
om-fwupgradecfg-gen.sh ar71xx: Skip more hashed blocks for OM2P(-HS) 64k variant 2018-09-10 10:01:58 +02:00
package-metadata.pl metadata: handle ABI version rebuild tracking for transient dependencies 2019-06-21 12:03:43 +02:00
pad_image scripts: avoid hard-coded paths in scripts 2016-04-28 16:43:28 +02:00
patch-kernel.sh scripts/patch-kernel.sh: remove -E flag to preserve empty files touched by patches 2015-08-25 07:46:32 +00:00
patch-specs.sh toolchain: Add GCC 9.1.0 release 2019-06-16 16:40:08 +02:00
portable_date.sh scripts: fix GNU data invocation 2016-02-01 10:43:27 +00:00
qemustart scripts/qemustart: add notes on adding new options 2019-04-26 13:09:33 +00:00
redboot-script.pl scripts: avoid hard-coded paths in scripts 2016-04-28 16:43:28 +02:00
relink-lib.sh base-files: relink uclibc and libgcc libraries to remove leftovers of the statically linked initial libgcc saves a few kb and gets rid of unused not exported functions as well should also improve the reliability of mklibs 2011-03-01 05:40:38 +00:00
remote-gdb Fix handling of BUILD_SUFFIX in remote-gdb script 2019-09-01 18:38:05 +02:00
rstrip.sh scripts: rstrip.sh: allow rpath with sole $ORIGIN token 2018-12-19 15:36:05 +01:00
slugimage.pl scripts: Replace obsolete POSIX tmpnam in slugimage.pl with File::Temp function 2018-06-05 10:07:42 -04:00
srecimage.pl treewide: replace jow@openwrt.org with jo@mein.io 2016-06-07 11:42:52 +02:00
strip-kmod.sh scripts/strip-kmod.sh: remove a few extra sections to slightly reduce kernel module size 2016-02-01 13:33:33 +00:00
symlink-tree.sh docs: remove all refrences in Makefiles/scripts 2016-11-30 10:13:14 +01:00
sysupgrade-tar.sh images: fix boot failures on NAND with small sub pages 2019-09-14 11:43:19 +02:00
target-metadata.pl build: allow overriding default selection state for devices 2019-08-13 22:13:18 +02:00
time.pl scripts: time.pl: Don't print the time on stderr 2019-07-03 07:45:00 +02:00
timestamp.pl fix timestamp checks for build system paths which have '.svn' in their directory name 2010-04-14 22:21:15 +00:00
ubinize-image.sh images: fix boot failures on NAND with small sub pages 2019-09-14 11:43:19 +02:00