]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libblkid: squashfs3: report endianness
authorThomas Weißschuh <thomas@t-8ch.de>
Wed, 26 Oct 2022 14:32:08 +0000 (16:32 +0200)
committerThomas Weißschuh <thomas@t-8ch.de>
Wed, 26 Oct 2022 14:37:40 +0000 (16:37 +0200)
libblkid/src/superblocks/squashfs.c
tests/expected/blkid/low-probe-squashfs3

index d85ff8f1ab0b9b548845c334963f571bc7528185..bd63fbd63cd0c7c1c8e9bf70c6e1ceeb6eb26276 100644 (file)
@@ -53,6 +53,7 @@ static int probe_squashfs3(blkid_probe pr, const struct blkid_idmag *mag)
        struct sqsh_super_block *sq;
        uint16_t vermaj;
        uint16_t vermin;
+       enum BLKID_ENDIANNESS endianness;
 
        sq = blkid_probe_get_sb(pr, mag, struct sqsh_super_block);
        if (!sq)
@@ -61,9 +62,11 @@ static int probe_squashfs3(blkid_probe pr, const struct blkid_idmag *mag)
        if (strcmp(mag->magic, "sqsh") == 0) {
                vermaj = be16_to_cpu(sq->s_major);
                vermin = be16_to_cpu(sq->s_minor);
+               endianness = BLKID_ENDIANNESS_BIG;
        } else {
                vermaj = le16_to_cpu(sq->s_major);
                vermin = le16_to_cpu(sq->s_minor);
+               endianness = BLKID_ENDIANNESS_LITTLE;
        }
 
        if (vermaj > 3)
@@ -73,6 +76,7 @@ static int probe_squashfs3(blkid_probe pr, const struct blkid_idmag *mag)
 
        blkid_probe_set_fsblocksize(pr, 1024);
        blkid_probe_set_block_size(pr, 1024);
+       blkid_probe_set_fsendianness(pr, endianness);
 
        return 0;
 }
index 7ff6f3c0615c3aa24cecbe0f7043a3d2a1e5d3c7..d4be7c7fef73555b3914d41038a4328a13f8ce4b 100644 (file)
@@ -1,4 +1,5 @@
 ID_FS_BLOCK_SIZE=1024
+ID_FS_ENDIANNESS=LITTLE
 ID_FS_FSBLOCKSIZE=1024
 ID_FS_TYPE=squashfs3
 ID_FS_USAGE=filesystem