From: Stefan Bund Date: Thu, 25 Feb 2010 15:09:20 +0000 (+0100) Subject: Add README and some comments X-Git-Url: http://g0dil.de/git?p=mapsector.git;a=commitdiff_plain;h=e2655022392c82b81d591cb6830f49751ef16f73 Add README and some comments --- diff --git a/Makefile b/Makefile index 7682371..7a8fec5 100644 --- a/Makefile +++ b/Makefile @@ -69,6 +69,7 @@ prepare:: debian/changelog prepare:: lib/00_version.sh lib/00_version.sh: echo "version='`git describe --tag`'" >lib/00_version.sh +.PHONY: lib/00_version.sh clean:: rm -f lib/00_version.sh diff --git a/README b/README new file mode 100644 index 0000000..32f5769 --- /dev/null +++ b/README @@ -0,0 +1,65 @@ + +mapsector -- Map sector number to file name(s) + +Given a device and a sector number, mapsector will try to find the +file name(s) mapping to this sector. It will try to gather as much +information about the given sector as possible. + +At the time of writing this README, mapsector has support for the +following mapping schemes: + + RAID level 1 + cryptsetup (luks and dmcrypt) + LVM (linear allocation scheme) + partition tables + +and the following filesystems: + + ext2-4 + reiserfs + + +INSTALLATION +============ + +There are two ways to build mapsector: + + - build a debian package + - generate a combined 'mapsectorsh' script + +The debian package will automatically install dependencies and +'Suggests' all additional packages needed to detect all the known +filesystems and mapping schemes. + +The 'mapsectorsh' script is a single self-contained file which may be +copied easily to any target system to be used. You need to make sure, +that 'awk', 'python' and 'dc' are available. + + +Getting the source +------------------ + +The sourcecode is distributed via git: + + $ git clone git://git.j32.de/mapsector.git + + +Building a debian package +------------------------- + +Make sure, you have 'fakeroot' and the debian package development +tools installed, then issue + + $ make deb + +The resulting debian package will be placed into the parent directory. + + +Building 'mapsectorsh' +---------------------- + +Just type + + $ make + +and copy the 'mapsectorsh' script wherever you need it. diff --git a/mapsector b/mapsector index 4e2a5ec..ca676b4 100755 --- a/mapsector +++ b/mapsector @@ -1,4 +1,24 @@ #!/bin/sh +# +# mapsector -- Map sector number to file name(s) +# +# Copyright (C) 2009,2010 Stefan Bund +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the +# Free Software Foundation, Inc., +# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# ########################################################################### @@ -7,6 +27,8 @@ scanners="" version="unknown" name="`basename "$0"`" +# Don't use custom language since we parse the output of lots of standard +# utilities unset LANG register_mapper()