Changeset 2648 in MondoRescue for devel/mrmini/sbin/mrmindi
- Timestamp:
- Jun 13, 2010, 12:36:32 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
devel/mrmini/sbin/mrmindi
r2646 r2648 1 1 #!/usr/bin/perl -w 2 2 # 3 # Mindi main application3 # mrmini main application 4 4 # Mini-distribution maker for the MondoRescue project 5 5 # … … 37 37 =head1 NAME 38 38 39 Mindi - Tool to create a boot environment from a distribution39 mrmini - Tool to create a boot environment from a distribution 40 40 41 41 =head1 DESCRIPTION 42 42 43 B<m indi> creates a bootable ISO/USB image using files from the system it runs on. B<mindi> will try hard to reproduce the environment of its host system including loaded modules to ensure that the system can be booted properly from the created rescue media. B<mindi> is used by monodarchive(8) to produce the required USB/ISO images but can also be used stand-alone.44 45 For stand-alone usage, B<m indi> may be called without any parameters or switches. It will then interactively ask the user for all information required to create a set of boot/root media. Options on the command line or a configuration file can also be used to alter the way B<mindi> is working46 47 The probably more frequent way of calling B<m indi> is non-interactively from mondoarchive(8) using a dedicated configuration file.43 B<mrmini> creates a bootable ISO/USB image using files from the system it runs on. B<mrmini> will try hard to reproduce the environment of its host system including loaded modules to ensure that the system can be booted properly from the created rescue media. B<mrmini> is used by monodarchive(8) to produce the required USB/ISO images but can also be used stand-alone. 44 45 For stand-alone usage, B<mrmini> may be called without any parameters or switches. It will then interactively ask the user for all information required to create a set of boot/root media. Options on the command line or a configuration file can also be used to alter the way B<mrmini> is working 46 47 The probably more frequent way of calling B<mrmini> is non-interactively from mondoarchive(8) using a dedicated configuration file. 48 48 49 49 =head1 SYNOPSIS 50 50 51 m indi [-v]|[-q]|[-h]|[--man]51 mrmini [-v]|[-q]|[-h]|[--man] 52 52 53 53 =head1 OPTIONS … … 122 122 =item B<-V|--version> 123 123 124 Display m indi version and exit124 Display mrmini version and exit 125 125 126 126 =cut … … 159 159 160 160 # mrcachedir points to the directory where the tool will store generated content 161 # If not defined, mrcachedir is under /var/cache/m indi162 mrcachedir m indi = /var/cache/mindi163 164 Also look at man m indi.conf161 # If not defined, mrcachedir is under /var/cache/mrmini 162 mrcachedir mrmini = /var/cache/mrmini 163 164 Also look at man mrmini.conf 165 165 166 166 =head1 AUTHORS … … 170 170 =head1 COPYRIGHT 171 171 172 Mindi is distributed under the GPL v2.0 license172 mrmini is distributed under the GPL v2.0 license 173 173 described in the file C<COPYING> included with the distribution. 174 174 … … 179 179 # Initialize the syntax string 180 180 181 pb_syntax_init("m indi Version PBVER-rPBREV\n");181 pb_syntax_init("mrmini Version PBVER-rPBREV\n"); 182 182 pb_display_init("text",""); 183 183 … … 215 215 # Global variables 216 216 # 217 my $M INDI_VERSION = "PBVER-rPBREV";218 my $M INDI_PREFIX = "XXX";219 my $M INDI_CONF = "YYY";220 my $M INDI_LIB = "LLL";221 my $M INDI_SBIN = "$MINDI_PREFIX/sbin";222 my $M INDI_FDISK = "$MINDI_SBIN/parted2fdik";223 my $M INDI_DEPLIST = "$MINDI_CONF/deplist.d";217 my $MRMINI_VERSION = "PBVER-rPBREV"; 218 my $MRMINI_PREFIX = "XXX"; 219 my $MRMINI_CONF = "YYY"; 220 my $MRMINI_LIB = "LLL"; 221 my $MRMINI_SBIN = "$MRMINI_PREFIX/sbin"; 222 my $MRMINI_FDISK = "$MRMINI_SBIN/parted2fdik"; 223 my $MRMINI_DEPLIST = "$MRMINI_CONF/deplist.d"; 224 224 # Better ? 225 225 my $ARCH = `uname -m`; … … 233 233 # 234 234 # Conf files Management 235 # the $M INDI_CONF/mondorescue.conf.dist is delivered as part of the project and235 # the $MRMINI_CONF/mondorescue.conf.dist is delivered as part of the project and 236 236 # its checksum is verified as we need good default values that we can trust 237 237 # 238 open(MD5,"$M INDI_CONF/mondorescue.conf.dist.md5") || die "Unable to read mandatory $MINDI_CONF/mondorescue.conf.dist.md5: $!";238 open(MD5,"$MRMINI_CONF/mondorescue.conf.dist.md5") || die "Unable to read mandatory $MRMINI_CONF/mondorescue.conf.dist.md5: $!"; 239 239 my $omd5 = <MD5>; 240 240 chop($omd5); 241 241 close(MD5); 242 open(CONF,"$M INDI_CONF/mondorescue.conf.dist") || die "Unable to read mandatory $MINDI_CONF/mondorescue.conf.dist: $!";242 open(CONF,"$MRMINI_CONF/mondorescue.conf.dist") || die "Unable to read mandatory $MRMINI_CONF/mondorescue.conf.dist: $!"; 243 243 my $md5 = Digest::MD5->new; 244 244 binmode(CONF); 245 245 $md5->addfile(CONF); 246 die "Invalid MD5 found sum for $M INDI_CONF/mondorescue.conf.dist: $md5->hexdigest" if ($omd5 ne $md5->hexdigest);246 die "Invalid MD5 found sum for $MRMINI_CONF/mondorescue.conf.dist: $md5->hexdigest" if ($omd5 ne $md5->hexdigest); 247 247 close(CONF); 248 248 249 249 # Adds conf files in order 250 pb_conf_add("$ENV{'HOME'}/.mondorescuerc","$M INDI_CONF/mondorescue.conf","$MINDI_CONF/mondorescue.conf.dist");250 pb_conf_add("$ENV{'HOME'}/.mondorescuerc","$MRMINI_CONF/mondorescue.conf","$MRMINI_CONF/mondorescue.conf.dist"); 251 251 252 252 # 253 253 # Configuration parameters 254 254 # 255 $ENV{'PBPROJ'} = "m indi";255 $ENV{'PBPROJ'} = "mrmini"; 256 256 my ($mr_boot_size,$mr_boot_cd,$mr_boot_usb,$mr_boot_tape,$mr_kernel,$mr_fstab) = pb_conf_get("mr_boot_size","mr_boot_cd","mr_boot_usb","mr_boot_tape","mr_kernel","mr_fstab"); 257 257 my ($mr_tape_mods,$mr_scsi_mods,$mr_ide_mods,$mr_pcmcia_mods,$mr_usb_mods,$mr_net_mods,$mr_cdrom_mods,$mr_deny_mods,$mr_force_mods) = pb_conf_get("mr_tape_mods","mr_scsi_mods","mr_ide_mods","mr_pcmcia_mods","mr_usb_mods","mr_net_mods","mr_cdrom_mods","mr_extra_mods","mr_deny_mods","mr_force_mods"); … … 271 271 pb_log_init($pbdebug, $pbLOG); 272 272 273 pb_log(0,"m indi start date: $mr_date");273 pb_log(0,"mrmini start date: $mr_date"); 274 274 pb_log(0,"-------------------------------------"); 275 pb_log(0,"m indi v$MINDI_VERSION");275 pb_log(0,"mrmini v$MRMINI_VERSION"); 276 276 pb_log(0,"$ARCH architecture detected"); 277 pb_log(0,"m indi called with the following arguments: ".join(" ",@ARGV));277 pb_log(0,"mrmini called with the following arguments: ".join(" ",@ARGV)); 278 278 pb_log(0,"-------------------------------------"); 279 279 pb_log(0,"MONDO_CACHE: $ENV{'MONDO_CACHE'}") if (defined $ENV{'MONDO_CACHE'}); 280 pb_log(0,"M INDI_LIB: $MINDI_LIB");281 pb_log(0,"M INDI_CONF: $MINDI_CONF");282 pb_log(0,"M INDI_SBIN: $MINDI_SBIN");280 pb_log(0,"MRMINI_LIB: $MRMINI_LIB"); 281 pb_log(0,"MRMINI_CONF: $MRMINI_CONF"); 282 pb_log(0,"MRMINI_SBIN: $MRMINI_SBIN"); 283 283 if (-r "$ENV{'HOME'}/.mondorescuerc") { 284 284 pb_log(0,"-------------------------------------"); … … 286 286 pb_display_file("$ENV{'HOME'}/.mondorescuerc"); 287 287 } 288 if (-r "$M INDI_CONF/mondorescue.conf") {288 if (-r "$MRMINI_CONF/mondorescue.conf") { 289 289 pb_log(0,"-------------------------------------"); 290 pb_log(0,"Conf file $M INDI_CONF/mondorescue.conf");291 pb_display_file("$M INDI_CONF/mondorescue.conf");290 pb_log(0,"Conf file $MRMINI_CONF/mondorescue.conf"); 291 pb_display_file("$MRMINI_CONF/mondorescue.conf"); 292 292 } 293 293 pb_log(0,"-------------------------------------");
Note:
See TracChangeset
for help on using the changeset viewer.