diff options
author | Ludovic Pouzenc <ludovic@pouzenc.fr> | 2015-08-30 19:10:01 +0200 |
---|---|---|
committer | Ludovic Pouzenc <ludovic@pouzenc.fr> | 2015-08-30 19:10:01 +0200 |
commit | de5ef2cba6505c112e8f63c042659d06a1e68a0b (patch) | |
tree | d655fc7cfc44f5fbc648802096f8511eb2508256 | |
parent | 08106a353fab69ee93e02a7d674c2597c0e37061 (diff) | |
download | raidguessfs-de5ef2cba6505c112e8f63c042659d06a1e68a0b.tar.gz raidguessfs-de5ef2cba6505c112e8f63c042659d06a1e68a0b.tar.bz2 raidguessfs-de5ef2cba6505c112e8f63c042659d06a1e68a0b.zip |
find_bootsect is part of raidguessfs, drop outdated standalone version
-rwxr-xr-x | tools/find_bootsect.py | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/tools/find_bootsect.py b/tools/find_bootsect.py deleted file mode 100755 index f52e910..0000000 --- a/tools/find_bootsect.py +++ /dev/null @@ -1,35 +0,0 @@ -#!/usr/bin/env python -import os, logging, binascii - -disk_count = 15 -disk_order = [ 0,1,2,4,5,6,7,8,9,10,11,12,13,14,15 ] -disk_paths = [ 'disk%02i.img'%d for d in disk_order ] -disks = [ None for d in range(disk_count) ] -disks_size = [ 0 for d in range(disk_count) ] - -for d in range(disk_count): - path = disk_paths[d] - logging.debug("Try to open disk #%2d"%d) - try: - disks[d] = open(path, "r") - disks_size[d] = os.lstat(path).st_size - logging.debug("Opened disk #%2d"%d) - except IOError as e: - logging.error("Can't open disk #%2d ('%s') : %s"%(d, path, e.strerror)) - disks_size[d] = 0 - except: - logging.error("Can't open disk #%2d ('%s') : unhandled exception"%(d, path)) - disks_size[d] = 0 -logging.debug("Exit. open_disks()") - -ref_sig = binascii.unhexlify('55AA') - -for offset in range(0, min(disks_size), 512): - for disk_no in range(disk_count): - disks[disk_no].seek(offset) - data = disks[disk_no].read(512) - sig = data[510:] - if sig == ref_sig: - print "%s@%x:%s"%(disk_paths[disk_no],offset,binascii.hexlify(sig)) - - |