ServDoc_0103unixboot - describe your unix boot configuration
$Id: ServDoc_0103unixboot,v 1.10 2003/08/18 19:51:51 uherbst Exp $
ServDoc_0103unixboot [-h|help] [-v|version] [--debug UXBOOT,intensity]
ServDoc_0103unixboot describes:
The debug feature for that module is named ``UXBOOT''.
Ulrich Herbst <Ulrich.Herbst@gmx.de>
#!/usr/bin/perl -w
#---------------------------------------------------------------------- # standard perl modules use strict; # print error about unknown variables ... use English; # long internal variable names; use FindBin; # In which directory is ServDoc itself ? # There has to be the module and the lib dir! use lib $FindBin::Bin. "/lib"; # Here are the ServDoc-perl-modules use File::Basename; use vars qw($options); # our own perl modules use ServDoc; #---------------------------------------------------------------------- $options->{Version} = '$Id: ServDoc_0103unixboot,v 1.10 2003/08/18 19:51:51 uherbst Exp $'; # We need the cmdline to call the modules with the same debug options. $options->{cmdline} = join " ", @ARGV; sub debug { ServDoc_debug( "UXBOOT", $options, shift, shift ); } $options = &process_cmdline($options); %{$options->{lang}->{en}}= ( running => i18n_std('running',$0), lilo => "Unix%%+Boot%%+LILO%%+Configuration", lilo_short => i18n_std('filecontent',"/etc/lilo.conf"), lilo_long => "The only configuration file of ". "lilo (if that is your bootloader!)", grub => "Unix%%+Boot%%+GRUB%%+Configuration", grub_short => i18n_std('filecontent', "/boot/grub/grub.conf"), grub_long => "The only configuration file of ". "grub (if that is your bootloader!)", alpha => "Unix%%+Boot%%+Boot Loader%%+Configuration", alpha_short => i18n_std('filecontent', "/etc/aboot.conf"), alpha_long => "", silo => "Unix%%+Boot%%+Boot Loader%%+Configuration", silo_short => i18n_std('filecontent', "/etc/silo.conf"), silo_long => "", no_bootloader => "Unknown bootloader", kernelcmd => "Unix%%+Boot%%+Kernel command line", kernelcmd_short => i18n_std('filecontent','/proc/cmdline'), kernelcmd_long => "With which options your kernel has been booted ?", bootlistn => "Unix%%+Boot%%+bootlist%%+Normal mode", bootlistn_short => i18n_std('cmdout','bootlist -m normal -o'), bootlistn_long => "On which devices will your server look for the ". "bootstrap data during normal boot ?", bootlists => "Unix%%+Boot%%+bootlist%%+Service mode", bootlists_short => i18n_std('cmdout','bootlist -m normal -o'), bootlists_long => "On which devices will your server look for the ". "bootstrap data during service boot ?", bootdevice => "Unix%%+Boot%%+bootdevice", bootdevice_short=> i18n_std('cmdout','bootinfo -b'), bootdevice_long => "From which device has your system booted ?", bootconf => "Unix%%+Boot%%+bootconfiguration", bootconf_short => i18n_std('cmdout','lvlnboot -v'), bootconf_long => '', unsupported => "This OS ($OSNAME) isn't currently supported ". "for bootconfiguration by ServDoc.", ); %{$options->{lang}->{de}}= ( running => i18n_std('running',$0), lilo => "Unix%%+Boot%%+LILO%%+Konfiguration", lilo_short => i18n_std('filecontent',"/etc/lilo.conf"), lilo_long => "Die wesentliche Konfigurationsdatei ". "für lilo (falls das ihr Bootloader ist!).", grub => "Unix%%+Boot%%+GRUB%%+Konfiguration", grub_short => i18n_std('filecontent', "/boot/grub/grub.conf"), grub_long => "Die wesentliche Konfigurationsdatei ". "für GRUB (falls das ihr Bootloader ist!).", alpha => "Unix%%+Boot%%+Bootloader%%+Konfiguration", alpha_short => i18n_std('filecontent', "/etc/aboot.conf"), alpha_long => "", silo => "Unix%%+Boot%%+Bootloader%%+Konfiguration", silo_short => i18n_std('filecontent', "/etc/silo.conf"), silo_long => "", no_bootloader => "Unbekannter Bootloader", kernelcmd => "Unix%%+Boot%%+Kernel-Kommandozeile", kernelcmd_short => i18n_std('filecontent','/proc/cmdline'), kernelcmd_long => "Mit welchen Optionen wurde der Kernel gebootet ?", bootlistn => "Unix%%+Boot%%+Bootlist%%+Normal mode", bootlistn_short => i18n_std('cmdout','bootlist -m normal -o'), bootlistn_long => "Auf welchen Geräten sucht das System beim ". "normalen Boot nach den Bootstrap-Daten ?", bootlists => "Unix%%+Boot%%+Bootlist%%+Service mode", bootlists_short => i18n_std('cmdout','bootlist -m normal -o'), bootlists_long => "Auf welchen Geräten sucht das System beim ". "Service-Boot nach den Bootstrap-Daten ?", bootdevice => "Unix%%+Boot%%+Bootdevice", bootdevice_short=> i18n_std('cmdout','bootinfo -b'), bootdevice_long => "Von welchem Gerät wurde gebootet ?", bootconf => "Unix%%+Boot%%+Bootconfiguration", bootconf_short => i18n_std('cmdout','lvlnboot -v'), bootconf_long => '', unsupported => "Dieses Betriebssystem ($OSNAME) ". "wird zur Zeit von ServDoc nicht mit der Bootkonfigurations-Doku ". "unterstützt.", ); debug( 9, i18n_mesg('running')); #---------------------------------------------------------------------- # Main # Here is your useful code. if ( $OSNAME =~ /linux/ ) { # FIXME: How can we tell, if that system uses lilo, grub or # something else ? if ( -e "/etc/lilo.conf" ) { report_i18n('file','lilo','/etc/lilo.conf'); } elsif ( -e "/boot/grub/grub.conf" ) { report_i18n('file','grub','/boot/grub/grub.conf'); } elsif ( do_cmd("uname -m") eq "alpha\n" and -e "/etc/aboot.conf" ) { report_i18n('file','alpha',"/etc/aboot.conf"); } elsif ( do_cmd("uname -m") =~ /sparc/ and -e "/etc/silo.conf" ) { report_i18n('file','silo',"/etc/silo.conf"); } else { debug( 1, i18n_mesg('no_bootloader')); } report_i18n('file','kernelcmd','/proc/cmdline'); } elsif ( $OSNAME =~ /aix/ ) { report_i18n('cmd','bootlistn',"bootlist -m normal -o",UID=>0 ); report_i18n('cmd','bootlists',"bootlist -m service -o",UID=>0 ); report_i18n('cmd','bootdevice',"bootinfo -b",UID=>0); } elsif ( $OSNAME =~ /hpux/ ) { report_i18n('cmd','bootconf','lvlnboot -v',UID=>0); } else { debug( 1,i18n_mesg('unsupported')); }