summaryrefslogtreecommitdiffstats
path: root/fs/ext2/genext2fs.sh
Commit message (Collapse)AuthorAgeFilesLines
* fs/ext2: further fix to the UUIDYann E. MORIN2013-05-291-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Turned out that setting a nil-UUID is no better than clearing it. What currently happens is as follows: - first, genext2fs does not generate a UUID - then we tune2fs to upgrade the filesystem - then we run fsck, which generates a random UUID - then we re-run tune2fs to set a nil-UUID So, on the target, if the file system is improperly unmounted (eg. with a power failure), on next boot, fsck may be run, and a new random UUID will be generated. *However*, fsck improperly updates the filesystem when it adds the UUID, and there are a few group descriptor checksum errors. Those errors will go undetected until the next fsck, which will then block for user input (bad on embedded systems, bad). Fix that by systematically generating a random UUID _before_ we call to fsck. A random UUID is not so bad, after all, since there are already so many sources of unpredictability in the filesystem: files date and ordering, files content (date, paths...) which renders a fixed UUID unneeded. And it is still possible to set the UUID in a post-image script if needed, anyway. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Peter Korsgaard <jacmet@uclibc.org> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
* fs/ext2: explicitly set a NULL UUIDYann E. MORIN2013-05-281-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | "tune2fs -U clear" creates an invalid filesystem, that fsck.ext2 whines about later: $ make rootfs-ext2 [--SNIP--] $ ./host/usr/sbin/fsck.ext4 images/rootfs.ext2 e2fsck 1.42.7 (21-Jan-2013) Filesystem did not have a UUID; generating one. images/rootfs.ext2: clean, 4616/5120 files, 53171/131072 blocks $ ./host/usr/sbin/fsck.ext4 -f images/rootfs.ext2 e2fsck 1.42.7 (21-Jan-2013) One or more block group descriptor checksums are invalid. Fix<y>? yes Group descriptor 0 checksum is 0x4131, should be 0x8bdb. FIXED. [--SNIP--] So we set an explicitly NULL UUID instead. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
* fs/ext2: bump journal overhead to 1300 blocksPeter Korsgaard2013-04-121-6/+3
| | | | | | | | | | | | | | | | | A quick test with a ~3.5MB ext4 filesystem shows that 1081 blocks isn't enough: tune2fs 1.42.7 (21-Jan-2013) Please run e2fsck on the filesystem. Creating journal inode: Journal size too big for filesystem. So bump it a bit. Overestimating the journal size is probably not really a big deal for the kind of systems using ext3/4 anyway. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
* fs/ext2: remove count- and time-based fsckYann E. MORIN2013-04-121-2/+5
| | | | | | | | | | | Set the count- and time-based checks intervals to 0, thus effectively disabling automatic checks at boot (after a suggestion by Arnout). Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Arnout Vandecappelle <arnout@mind.be> Cc: Thomas Petazzoni <thomas.petazzoni@free-electrons.com> Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
* fs/ext2: add support for ext2 rev0 and rev1Yann E. MORIN2013-04-121-3/+9
| | | | | | | | | | | | | Some bootloaders have a buggy ext2 support, and require ext2 rev1 instead of the traditional ext2 rev0 that genext2fs produces. tune2fs accepts only one '-O list' at a time, so we need to construct a list of -O options. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Arnout Vandecappelle <arnout@mind.be> Acked-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
* fs/ext2: add ability to build ext3/4 tooYann E. MORIN2013-04-121-1/+72
| | | | | | | | | | | | | | | | | | | | | | Use the host-e2fsprogs to tune2fs the generated rootfs.ext2 image, and upgrade it to either one of ext2, ext3 or ext4. Since calling tune2fs may require running e2fsck (tune2fs will warn to do so when certain FS options are changed), we systematically call e2fsck. This makes the code path simpler, and as a side-effect checks that genext2fs did not generate garbage. In turn, e2fsck will unconditionally add a UUID to the filesystem, which is bad for reproducibility, so we call tune2fs again to remove the UUID. This does not require checking the filesystem. To ensure compatibility of Buildroot's .config, leave ext2 as the default. Boards' .config can override this at will. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> Cc: Arnout Vandecappelle <arnout@mind.be> Cc: Peter Korsgaard <jacmet@uclibc.org> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
* genext2fs.sh: improve number of blocks calculationPeter Korsgaard2010-12-301-14/+11
| | | | | | | | | | | | | Closes #2929 Instead of just adding a fixed amount to the blocks used, try to estimate the real space needed according to the filesystem structure (bitmaps, inodes, blocks). The side effect of this is that we no longer significantly overestimate the size needed for small file systems. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
* fs/ext2: fix blocks/inodes calculationPeter Korsgaard2010-04-191-0/+39
With the ROOTFS_TARGET conversion, EXT2_OPTS gets evaluated very early (before TARGET_DIR is populated with files), so the calculated blocks/inodes numbers are wrong. Fix it by moving the calculation to a shell script wrapper around genext2fs, so it only gets executed just before genext2fs runs. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>