From 4129676ca65da89d73fd62c900dc13f35f4512a2 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Thomas=20Wei=C3=9Fschuh?= Date: Wed, 26 Oct 2022 16:07:44 +0200 Subject: [PATCH] libblkid: cramfs: report endianness --- libblkid/src/superblocks/cramfs.c | 2 ++ tests/expected/blkid/low-probe-cramfs | 1 + tests/expected/blkid/low-probe-cramfs-big | 1 + 3 files changed, 4 insertions(+) diff --git a/libblkid/src/superblocks/cramfs.c b/libblkid/src/superblocks/cramfs.c index 39e12c1a76..2a87acdaa1 100644 --- a/libblkid/src/superblocks/cramfs.c +++ b/libblkid/src/superblocks/cramfs.c @@ -91,6 +91,8 @@ static int probe_cramfs(blkid_probe pr, const struct blkid_idmag *mag) blkid_probe_set_label(pr, cs->name, sizeof(cs->name)); blkid_probe_set_fssize(pr, cfs32_to_cpu(le, cs->size)); blkid_probe_sprintf_version(pr, "%d", v2 ? 2 : 1); + blkid_probe_set_fsendianness(pr, + le ? BLKID_ENDIANNESS_LITTLE : BLKID_ENDIANNESS_BIG); return 0; } diff --git a/tests/expected/blkid/low-probe-cramfs b/tests/expected/blkid/low-probe-cramfs index ccab3d75ef..cf9c15237b 100644 --- a/tests/expected/blkid/low-probe-cramfs +++ b/tests/expected/blkid/low-probe-cramfs @@ -1,3 +1,4 @@ +ID_FS_ENDIANNESS=LITTLE ID_FS_FSSIZE=4096 ID_FS_LABEL=test-cram ID_FS_LABEL_ENC=test-cram diff --git a/tests/expected/blkid/low-probe-cramfs-big b/tests/expected/blkid/low-probe-cramfs-big index f5f378fea9..46d1295692 100644 --- a/tests/expected/blkid/low-probe-cramfs-big +++ b/tests/expected/blkid/low-probe-cramfs-big @@ -1,3 +1,4 @@ +ID_FS_ENDIANNESS=BIG ID_FS_FSSIZE=4096 ID_FS_LABEL=Compressed ID_FS_LABEL_ENC=Compressed -- 2.47.3