diff options
author | Felix Fietkau <nbd@nbd.name> | 2016-07-23 19:33:28 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@nbd.name> | 2016-07-23 19:37:20 +0200 |
commit | 07577c5ebe1a49b5c05659559c2fd220647b33f6 (patch) | |
tree | 2e4dfa5598203e4d9ec88de0567e69416ad8df66 /tools/genext2fs/patches/400-byteswap_fix.patch | |
parent | 18f368fa35269aba4ad444d3a4bae06d4608a2c8 (diff) | |
download | upstream-07577c5ebe1a49b5c05659559c2fd220647b33f6.tar.gz upstream-07577c5ebe1a49b5c05659559c2fd220647b33f6.tar.bz2 upstream-07577c5ebe1a49b5c05659559c2fd220647b33f6.zip |
tools: bring back genext2fs for apm821xx
This reverts commit 8c68c104eaba65273280c7a4727fbb10ab10f5af.
It is used for apm821xx, which needs ext2 (not ext4) images for some
devices.
Signed-off-by: Felix Fietkau <nbd@nbd.name>
Diffstat (limited to 'tools/genext2fs/patches/400-byteswap_fix.patch')
-rw-r--r-- | tools/genext2fs/patches/400-byteswap_fix.patch | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/tools/genext2fs/patches/400-byteswap_fix.patch b/tools/genext2fs/patches/400-byteswap_fix.patch new file mode 100644 index 0000000000..7b3c00b5ee --- /dev/null +++ b/tools/genext2fs/patches/400-byteswap_fix.patch @@ -0,0 +1,44 @@ +Index: genext2fs/genext2fs.c +=================================================================== +--- genext2fs.orig/genext2fs.c 2011-11-29 17:36:06.000000000 +0100 ++++ genext2fs/genext2fs.c 2011-11-29 17:37:37.000000000 +0100 +@@ -1779,7 +1779,8 @@ + assert(nod->i_block[EXT2_DIND_BLOCK] != 0); + for(i = 0; i < BLOCKSIZE/4; i++) + if(nblk > EXT2_IND_BLOCK + BLOCKSIZE/4 + (BLOCKSIZE/4)*i ) +- swap_block(get_blk(fs, ((uint32*)get_blk(fs, nod->i_block[EXT2_DIND_BLOCK]))[i])); ++ if (((uint32*)get_blk(fs, nod->i_block[EXT2_DIND_BLOCK]))[i]) ++ swap_block(get_blk(fs, ((uint32*)get_blk(fs, nod->i_block[EXT2_DIND_BLOCK]))[i])); + swap_block(get_blk(fs, nod->i_block[EXT2_DIND_BLOCK])); + if(nblk <= EXT2_IND_BLOCK + BLOCKSIZE/4 + BLOCKSIZE/4 * BLOCKSIZE/4) + return; +@@ -1792,7 +1793,8 @@ + (BLOCKSIZE/4)*(BLOCKSIZE/4) + + i*(BLOCKSIZE/4)*(BLOCKSIZE/4) + + j*(BLOCKSIZE/4)) ) +- swap_block(get_blk(fs,b2[j])); ++ if (b2[j]) ++ swap_block(get_blk(fs,b2[j])); + else { + done = 1; + break; +@@ -1825,7 +1827,8 @@ + swap_block(get_blk(fs, nod->i_block[EXT2_DIND_BLOCK])); + for(i = 0; i < BLOCKSIZE/4; i++) + if(nblk > EXT2_IND_BLOCK + BLOCKSIZE/4 + (BLOCKSIZE/4)*i ) +- swap_block(get_blk(fs, ((uint32*)get_blk(fs, nod->i_block[EXT2_DIND_BLOCK]))[i])); ++ if (((uint32*)get_blk(fs, nod->i_block[EXT2_DIND_BLOCK]))[i]) ++ swap_block(get_blk(fs, ((uint32*)get_blk(fs, nod->i_block[EXT2_DIND_BLOCK]))[i])); + if(nblk <= EXT2_IND_BLOCK + BLOCKSIZE/4 + BLOCKSIZE/4 * BLOCKSIZE/4) + return; + /* Adding support for triple indirection */ +@@ -1839,7 +1842,8 @@ + (BLOCKSIZE/4)*(BLOCKSIZE/4) + + i*(BLOCKSIZE/4)*(BLOCKSIZE/4) + + j*(BLOCKSIZE/4)) ) +- swap_block(get_blk(fs,b2[j])); ++ if (b2[j]) ++ swap_block(get_blk(fs,b2[j])); + else { + done = 1; + break; |