Version 6 (modified by 18 years ago) ( diff ) | ,
---|
Compliance with Standards
Mondo Rescue aims to be compliant with
- The IEEE Std 1003.1, 2004 Edition
- The FHS (currently 2.3). Details are outlined below.
Default Exclusion Rules
The following directories will by default be EXCLUDED by mondoarchive:
- /media This directory is supposed to contain only removable media. See here for details: http://www.pathname.com/fhs/pub/fhs-2.3.html#VARCACHEAPPLICATIONCACHEDATA
- /proc
Pseudo filesystem. - /sys Pseudo filesystem.
- /tmp To be emptied between reboots and consequently to be emptied in a restore situation. See here for more details: http://www.pathname.com/fhs/pub/fhs-2.3.html#VARCACHEAPPLICATIONCACHEDATA. In particular: "Although data stored in /tmp may be deleted in a site-specific manner, it is recommended that files and directories located in /tmp be deleted whenever the system is booted."
- /var/cache/mondo (not implemented yet) This is where mondoarchvie should put scratch, temp, image and iso files by default. See here for why: http://www.pathname.com/fhs/pub/fhs-2.3.html#VARCACHEAPPLICATIONCACHEDATA
- /var/cache/mindi (as of rev [925] and rev [1044]) This is where mindi should put boot images by default. See here for why: http://www.pathname.com/fhs/pub/fhs-2.3.html#VARCACHEAPPLICATIONCACHEDATA
The following directories will by default NOT be excluded by mondoarchive:
- /var/tmp The contents of /var/tmp is to be preserved between reboots (as opposed to /tmp), so this is what should also happen during a restore. See here for details: http://www.pathname.com/fhs/pub/fhs-2.3.html#VARCACHEAPPLICATIONCACHEDATA
Installation Directories
Distribution packages are installed under /usr, builts from the tarballs with install under /usr/local. The following only deals with /usr.
File Locations
- binaries: /usr/sbin
- configuration: /etc/[mindi|mondo] (only mindi used ATM)
- documentation: /usr/share/doc/[mindi|mondo(|mondo-doc)]
- manpages: /usr/share/man/man8
- package-specific other files:
- binary files: /usr/lib/[mindi|mondo]
- non-binary (platform-independent) files: /usr/share/[mindi|mondo]
- shared libraries: /usr/lib (shared libraries turned-off in 2.0.8)
- temporary files, archive and boot images: /var/cache/[mindi|mondo]
(only mindi; for mondo, it's currently /var/cache/mondo-archive):
- boot images created by mindi: /var/cache/mindi
- data images created by mondo: /var/cache/mondo/images
- mondo tmp directory: /var/cache/mondo/tmp
- mondo scratch directory: /var/cache/mondo/tmp
Discussion
'-d' switch should really only allow manipulation of location for data images as it is the case now, i.e. '-d' should allow for changing /var/cache/mondo/images to a different location. Boot images should always go to /var/cache/mindi. The reasoning behind it is consistency on the one hand but allowing moving the potentially large contents of the /var/cache/mondo/images someplace else on the other.
During restoration, mondorestore should use also /var/cache/mondo
GNU Coding Standards
The GNU project has defined a good set of coding standards over the years. The latest version can be found here: http://www.gnu.org/prep/standards/standards.html. In fact, these standards are not really specific to GNU but can be viewed as best practice for at least pretty much any C program - many of the points made applies regardless of the programming language. Mondo Rescue strives to adhere to the GNU Coding Standards unlesss there is a reason not to.
getopt(3) and getopt_long(3) are the two standard function provided by the GNU C library for this purpose. See their manpages for details.
Processing Command Lines Parameters
Currently, we only support short command line switches, i.e. '-<single character>'. This does allow for compact invocation of our programs but is not very expressive. However, the GNU Coding Standards recommend the use of long options of the format '--<expressive expression>' besides the short ones for better trnsparency of the exact nature and working of the command invoked.
mondoarchive Command Line Options
Preliminary table of long command line options verus short ones.
Short | Long | Done |
-O | --backup | |
-V | --verify | |
-c | --media-cd | |
-w | (to be deleted) | |
-r | (to be deleted) | |
-C | --media-cd-stream | |
-p | --prefix | |
-i | --media-iso | |
-n | --media-nfs | |
-t | --media-tape | |
-u | --media-stream-generic | |
-D | --differential | |
-E | --exclude | |
-I | --include | |
-J | -include-list | |
-N | --exclude-netmounts | |
-d | --backup-path | |
-g | (to be deleted) | |
-k | --kernel-path | |
-m | --cd-drive-safe-mode | |
-o | --use-lilo | |
-s | --media-size | |
-x | --partitions-to-archive | |
-A | --run-after each-media | |
-B | --run-before-each-media | |
-F | --dont-ask-for-floppies | |
-H | --non-interactive-restore | |
-L | --use-lzop | |
-R | --use-star | |
-P | --run-post-nuke | |
-S | --scratch-dir | |
-T | --temp-dir | |
-W | --not-bootable | |
-b | --tape-blocksize | |
-e | --dont-eject | |
-f | --mbr-device | |
-Q | --bootloader-info | |
-K | --loglevel | |
-h | --help or --usage | |
-v | --version |
Notes: --help and --version recommended by GNU Coding Standards,
mondorestore Command Line Options
Preliminary table of long command line options verus short ones.
Short | Long | Done |
-h | --help or --usage | |
-v | --version |
mindi Command Line Options
Preliminary table of long command line options verus short ones.
Short | Long | Done |
-f | --find-kernel | |
-m | --make-mount-list | |
-s | --max-compressed-size | |
-c | --custom | |
-h | --help or --usage | |
-v | --version |
Formatting of C Code
The following outlines the coding standard for Mondo Rescue. Note that while mondo is implemented in C, mindi is currently a bash script.
The following indent rules should be used:
-kr -br -brs -ts4 -ut
The easiest is to put the above in file ~/.indent.pro.
The indent program should come in the indent package or similar. If not, you can get it from http://directory.fsf.org/GNU/indent.html.