Skip to contentSkip to conversation

fs/ext2: explicitly set a NULL UUID

PATCH New Yann E. MORIN 2 participants 2 messages May 28, 2013 ext2 file system

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fs/ext2: explicitly set a NULL UUID

From: "Yann E. MORIN" <[email protected]>

"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.

---
 fs/ext2/genext2fs.sh | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
fs/ext2/genext2fs.sh +5 -2
index f7f8d33..7a6e232 100755
@@ -70,11 +70,14 @@ e2tunefsck() {
            "${IMG##*/}" "${GEN}"
 
     # e2fsck will force a *random* UUID, which is bad
-    # for reproducibility, so we do not want it.
+    # for reproducibility, so we do not want it. Asking
+    # tune2fs to 'clear' the UUID makes for an invalid
+    # fs, so we explicitly set a NULL UUID, which works.
     # Remove count- and time-based checks, they are not welcome
     # on embedded devices, where they can cause serious boot-time
     # issues by tremendously slowing down the boot.
-    tune2fs -U clear -c 0 -i 0 "${IMG}"
+    tune2fs -U 00000000-0000-0000-0000-000000000000 "${IMG}"
+    tune2fs -c 0 -i 0 "${IMG}"
 }
 
 # Check we know what generation to generate
Signature · 1 line
1.8.1.2
#1 lore raw

PATCH 1/1 fs/ext2: explicitly set a NULL UUID

Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> writes:

Yann> From: "Yann E. MORIN" <[email protected]>
Yann> "tune2fs -U clear" creates an invalid filesystem, that fsck.ext2 Yann> whines about later:

Yann> $ make rootfs-ext2
Yann> [--SNIP--]

 Yann>     $ ./host/usr/sbin/fsck.ext4 images/rootfs.ext2
 Yann>     e2fsck 1.42.7 (21-Jan-2013)
 Yann>     Filesystem did not have a UUID; generating one.
 Yann>     images/rootfs.ext2: clean, 4616/5120 files, 53171/131072 blocks
 Yann>     $ ./host/usr/sbin/fsck.ext4 -f images/rootfs.ext2
 Yann>     e2fsck 1.42.7 (21-Jan-2013)
 Yann>     One or more block group descriptor checksums are invalid.  Fix<y>? yes
 Yann>     Group descriptor 0 checksum is 0x4131, should be 0x8bdb.  FIXED.
 Yann>     [--SNIP--]

Yann> So we set an explicitly NULL UUID instead.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard