Flush stdout before writing Done to stderr, and make 'type' 3 columns wide
[part-list.git] / README
1 Scan a file for partition tables and print those found. Treats files as collections
2 of 512-byte sectors and treats any 'sector' that has the magic bytes 0x55,0xAA at
3 offset 0x1FE (510) as a valid partition table.
4
5 Cannot be used with device files because it uses mmap() to map file contents into memory.
6
7 Example output:
8
9 Base:   decimal
10 File:                    512    z-part-table.1.sector0.bin
11 Searching...
12 Done.
13 Signature found. sector:        0 offset:         0
14 0 A 77    0  0  0    0  0  0          1       1000 (next       1001)
15 1   69    0  0  0    0  0  0       1001        128 (next       1129)
16 2   70    0  0  0    0  0  0       1129       9000 (next      10129)
17 3    5    0  0  0    0  0  0      10129    4544622 (next    4554751)
18
19
20 Usage: part-list [-d] -f <needle>
21  version 1.0.0
22 Copyright 2010 TJ <linux@tjworld.net>
23 Licensed under the terms of the GNU GPL v3
24
25         -d      print values in decimal not hexadecimal
26         -f      path to the file containing the partition table (it is scanned for sectors containing the signature)
27
28         Information messages are written to stderr and only partition tables are written to stdout.
29         This allows the output to be piped through other filters.
30
31 = Build =
32
33 make
34
35 make clean
36
37 = Cross-build for ARM =
38
39 Assuming the Code Sourcery G++ ARM cross-tools are installed in the path, the program can
40 be built and statically linked to be a self-contained executable to run on ARM-base devices
41 such as Android smart-phones.
42
43 make LDFLAGS=-static CC=arm-none-linux-gnueabi-gcc
44
45 make clean