SquashFS compressed filesystem reader in pure OCaml
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

claude: complete Err -> Error module rename across call sites

Follow up to the module rename: update the remaining callers that
still referenced [Err] (library [claude.ml{,i}], [client.ml], the test
driver [test.ml]), and fix one stray [^ e] string concatenation in
hermest's CLI that needed [Json.Error.to_string e] now that
[Json.of_string] yields a structured error.

+3 -26
-1
c/dune
··· 1 1 (executable 2 2 (name gen) 3 - (modules gen) 4 3 (libraries squashfs wire.3d)) 5 4 6 5 (rule
-1
fuzz/dune
··· 1 1 (executable 2 2 (name fuzz) 3 - (modules fuzz fuzz_squashfs) 4 3 (libraries squashfs alcobar)) 5 4 6 5 (rule
-5
lib/squashfs.ml
··· 163 163 uid_idx : int; 164 164 gid_idx : int; 165 165 mtime : int; 166 - inode_number : int; 167 166 inode_data : inode_data; 168 167 xattr_id : int; (* 0xFFFFFFFF = no xattrs *) 169 168 } ··· 178 177 root_inode : inode; 179 178 inode_table_start : int64; 180 179 directory_table_start : int64; 181 - fragment_table_start : int64; 182 180 xattr_table_start : int64; 183 181 } 184 182 ··· 881 879 uid_idx = hdr.ih_uid_idx; 882 880 gid_idx = hdr.ih_gid_idx; 883 881 mtime = hdr.ih_mtime; 884 - inode_number = hdr.ih_inode_number; 885 882 inode_data; 886 883 xattr_id; 887 884 } ··· 968 965 uid_idx = 0; 969 966 gid_idx = 0; 970 967 mtime = 0; 971 - inode_number = 0; 972 968 inode_data = 973 969 Inode_dir 974 970 { ··· 982 978 }; 983 979 inode_table_start = raw.sb_inode_table_start; 984 980 directory_table_start = raw.sb_directory_table_start; 985 - fragment_table_start = raw.sb_fragment_table_start; 986 981 xattr_table_start = raw.sb_xattr_table_start; 987 982 } 988 983 in
+3 -19
lib/squashfs_writer.ml
··· 70 70 compression : compression; 71 71 block_size : int; 72 72 mtime : int; 73 - mutable next_inode : int; 74 - mutable uid_gid_table : (int * int) list; 75 73 } 76 74 77 75 let pp ppf t = ··· 439 437 in 440 438 if not (is_power_of_2 block_size) then 441 439 invalid_arg "block_size must be a power of 2"; 442 - { 443 - root = []; 444 - compression; 445 - block_size; 446 - mtime; 447 - next_inode = 1; 448 - uid_gid_table = [ (0, 0) ]; 449 - } 440 + { root = []; compression; block_size; mtime } 450 441 451 442 (* Find or create path to entry *) 452 443 let rec ensure_dir t components current = ··· 584 575 type inode_info = { 585 576 inode_number : int; 586 577 block_offset : int; (* Offset within metadata block *) 587 - block_start : int; (* Start of metadata block relative to inode table *) 588 578 } 589 579 590 580 let encode_inode_header buf offset inode_type mode uid_idx gid_idx mtime ··· 719 709 let inode_number = !current_inode in 720 710 incr current_inode; 721 711 let inode_offset = Buffer.length inode_table in 722 - Hashtbl.add inode_positions path 723 - { 724 - inode_number; 725 - block_offset = inode_offset; 726 - block_start = !inode_block_start; 727 - }; 712 + Hashtbl.add inode_positions path { inode_number; block_offset = inode_offset }; 728 713 (match entry with 729 714 | Dir { mode; children } -> 730 715 write_dir_inode_buf t inode_table inode_number mode children parent_inode; ··· 773 758 buf off) 774 759 in 775 760 Buffer.add_bytes inode_table buf; 776 - Hashtbl.add inode_positions "/" 777 - { inode_number; block_offset = 0; block_start = 0 }; 761 + Hashtbl.add inode_positions "/" { inode_number; block_offset = 0 }; 778 762 inode_number 779 763 780 764 (* Map an entry to its on-disk directory entry type integer *)