2 * This is the original minix inode layout on disk.
3 * Note the 8-bit gid and atime and ctime.
16 * The new minix inode has all the time entries, as well as
17 * long block numbers and a third indirect block (7+1+1+1
18 * instead of 7+1+1). Also, some previously 8-bit values are
19 * now 16-bit. The inode is now 64 bytes instead of 32.
34 * minix superblock data on disk
36 struct minix_superblock
{
39 uint16_t s_imap_blocks
;
40 uint16_t s_zmap_blocks
;
41 uint16_t s_firstdatazone
;
42 uint16_t s_log_zone_size
;
49 struct minix_dir_entry
{
54 /* Believe it or not, but mount.h has this one #defined */
59 BITS_PER_BLOCK
= BLOCK_SIZE
<< 3,
64 #undef MINIX1_SUPER_MAGIC
65 MINIX1_SUPER_MAGIC
= 0x137F, /* original minix fs */
66 #undef MINIX1_SUPER_MAGIC2
67 MINIX1_SUPER_MAGIC2
= 0x138F, /* minix fs, 30 char names */
68 /* bionic has this define */
69 #undef MINIX2_SUPER_MAGIC
70 MINIX2_SUPER_MAGIC
= 0x2468, /* minix V2 fs */
71 #undef MINIX2_SUPER_MAGIC2
72 MINIX2_SUPER_MAGIC2
= 0x2478, /* minix V2 fs, 30 char names */
73 MINIX_VALID_FS
= 0x0001, /* clean fs */
74 MINIX_ERROR_FS
= 0x0002, /* fs has errors */
76 INODE_SIZE1
= sizeof(struct minix1_inode
),
77 INODE_SIZE2
= sizeof(struct minix2_inode
),
78 MINIX1_INODES_PER_BLOCK
= BLOCK_SIZE
/ sizeof(struct minix1_inode
),
79 MINIX2_INODES_PER_BLOCK
= BLOCK_SIZE
/ sizeof(struct minix2_inode
),
83 Basic test script for regressions in mkfs/fsck.
84 Copies current dir into image (typically bbox build tree).
87 tmpdir=/tmp/minixtest-$$
88 tmpimg=/tmp/minix-img-$$
91 dd if=/dev/zero of=$tmpimg bs=1M count=20 || exit
92 ./busybox mkfs.minix $tmpimg || exit
93 mount -o loop $tmpimg $tmpdir || exit
95 umount $tmpdir || exit
96 ./busybox fsck.minix -vfm $tmpimg || exit
99 ./busybox fsck.minix -vfml $tmpimg || exit