-Fix copycds to return a message when unrecognized ISO is seen

-Add a rhel4 specific compute profile template
-Have anaconda seek out 'generics' of osver for templates
-Add RHAS4.6 x86_64 discid to known disc ids


git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@1222 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
jbjohnso 2008-04-29 17:39:28 +00:00
parent 461a5e905c
commit 7df53fb26e
4 changed files with 204 additions and 0 deletions

View File

@ -32,6 +32,7 @@ my %distnames = (
"1192663619.181374" => "rhels5.1",
"1194015916.783841" => "fedora8",
"1194512200.047708" => "rhas4.6",
"1194512327.501046" => "rhas4.6",
);
my %numdiscs = (
"1156364963.862322" => 4,
@ -254,10 +255,22 @@ sub mkinstall {
} elsif ($os =~ /fedora.*/) {
$platform = "fedora";
}
my $genos = $os;
$genos =~ s/\..*//;
if ($genos =~ /rh.s(\d*)/) {
unless (-r $::XCATROOT."/share/xcat/install/$platform/$profile.$genos.$arch.tmpl"
or -r $::XCATROOT."/share/xcat/install/$platform/$profile.$genos.tmpl") {
$genos = "rhel$1";
}
}
unless (-r $::XCATROOT."/share/xcat/install/$platform/$profile.tmpl"
or -r $::XCATROOT."/share/xcat/install/$platform/$profile.$arch.tmpl"
or -r $::XCATROOT."/share/xcat/install/$platform/$profile.$os.tmpl"
or -r $::XCATROOT."/share/xcat/install/$platform/$profile.$genos.tmpl"
or -r $::XCATROOT."/share/xcat/install/$platform/$profile.$os.$arch.tmpl"
or -r $::XCATROOT."/share/xcat/install/$platform/$profile.$genos.$arch.tmpl"
) {
$callback->({error=>["No $platform kickstart template exists for ".$ent->{profile}],errorcode=>[1]});
next;
@ -266,10 +279,14 @@ sub mkinstall {
my $tmperr="Unable to find template in $::XCATROOT/share/xcat/install/$platform (for $profile/$os/$arc combination)";
if (-r $::XCATROOT."/share/xcat/install/$platform/$profile.$os.$arch.tmpl") {
$tmperr = xCAT::Template->subvars($::XCATROOT."/share/xcat/install/$platform/$profile.$os.$arch.tmpl","/$installroot/autoinst/".$node,$node);
} elsif (-r $::XCATROOT."/share/xcat/install/$platform/$profile.$genos.$arch.tmpl") {
$tmperr = xCAT::Template->subvars($::XCATROOT."/share/xcat/install/$platform/$profile.$genos.$arch.tmpl","/$installroot/autoinst/".$node,$node);
} elsif (-r $::XCATROOT."/share/xcat/install/$platform/$profile.$arch.tmpl") {
$tmperr = xCAT::Template->subvars($::XCATROOT."/share/xcat/install/$platform/$profile.$arch.tmpl","/$installroot/autoinst/".$node,$node);
} elsif (-r $::XCATROOT."/share/xcat/install/$platform/$profile.$os.tmpl") {
$tmperr = xCAT::Template->subvars($::XCATROOT."/share/xcat/install/$platform/$profile.$os.tmpl","/$installroot/autoinst/".$node,$node);
} elsif (-r $::XCATROOT."/share/xcat/install/$platform/$profile.$genos.tmpl") {
$tmperr = xCAT::Template->subvars($::XCATROOT."/share/xcat/install/$platform/$profile.$genos.tmpl","/$installroot/autoinst/".$node,$node);
} elsif (-r $::XCATROOT."/share/xcat/install/$platform/$profile.tmpl") {
$tmperr = xCAT::Template->subvars($::XCATROOT."/share/xcat/install/$platform/$profile.tmpl","/$installroot/autoinst/".$node,$node);
}

View File

@ -15,11 +15,14 @@ sub handled_commands {
copycds => "copycds",
}
}
my $identified;
sub take_answer {
#TODO: Intelligently filter and decide things
my $resp = shift;
$callback->($resp);
$identified=1;
}
sub process_request {
@ -28,6 +31,7 @@ sub process_request {
my $doreq = shift;
my $distname = undef;
my $arch = undef;
$identified=0;
@ARGV = @{$request->{arg}};
GetOptions(
@ -67,6 +71,9 @@ sub process_request {
$doreq->($newreq,\&take_answer);
system("umount /mnt/xcat");
unless ($identified) {
$callback->({error=>["copycds could not identify the ISO supplied, you may wish to try -n <osver>"],errorcode=>[1]});
}
}
}

View File

@ -0,0 +1,179 @@
#RedHat Enterprise Linux 4 AS Only
#egan@us.ibm.com
#
lang en_US
langsupport en_US
network --bootproto dhcp
#
# Where's the source?
# nfs --server hostname.of.server or IP --dir /path/to/RH/CD/image
#
#nfs --server #XCATVAR:INSTALL_NFS# --dir #XCATVAR:INSTALL_SRC_DIR#
url --url http://#TABLE:noderes:$NODE:nfsserver#/install/#TABLE:nodetype:$NODE:os#/#TABLE:nodetype:$NODE:arch#
#device ethernet e100
keyboard "us"
#
# Clear the MBR
#
zerombr yes
#
# Wipe out the disk
#
clearpart --all --initlabel
#clearpart --linux
#
# Customize to fit your needs
#
#No RAID
#/boot really significant for this sort of setup nowadays?
#part /boot --size 50 --fstype ext3
part swap --size 1024
part / --size 1 --grow --fstype ext3
#RAID 0 /scr for performance
#part / --size 1024 --ondisk sda
#part swap --size 512 --ondisk sda
#part /var --size 1024 --ondisk sdb
#part swap --size 512 --ondisk sdb
#part raid.01 --size 1 --grow --ondisk sda
#part raid.02 --size 1 --grow --ondisk sdb
#raid /scr --level 0 --device md0 raid.01 raid.02
#Full RAID 1 Sample
#part raid.01 --size 50 --ondisk sda
#part raid.02 --size 50 --ondisk sdb
#raid /boot --level 1 --device md0 raid.01 raid.02
#
#part raid.11 --size 1024 --ondisk sda
#part raid.12 --size 1024 --ondisk sdb
#raid / --level 1 --device md1 raid.11 raid.12
#
#part raid.21 --size 1024 --ondisk sda
#part raid.22 --size 1024 --ondisk sdb
#raid /var --level 1 --device md2 raid.21 raid.22
#
#part raid.31 --size 1024 --ondisk sda
#part raid.32 --size 1024 --ondisk sdb
#raid swap --level 1 --device md3 raid.31 raid.32
#
#part raid.41 --size 1 --grow --ondisk sda
#part raid.42 --size 1 --grow --ondisk sdb
#raid /scr --level 1 --device md4 raid.41 raid.42
#
# bootloader config
# --append <args>
# --useLilo
# --md5pass <crypted MD5 password for GRUB>
#
bootloader
#
# install or upgrade
#
install
#
# text mode install (default is graphical)
#
text
#
# firewall
#
firewall --disabled
#
# mouse selection
#
#mouse genericps/2 --emulthree
mouse none
#
# Select a zone
# Add the --utc switch if your hardware clock is set to GMT
#
#timezone US/Hawaii
#timezone US/Pacific
#timezone US/Mountain
#timezone US/Central
#timezone US/Eastern
timezone --utc #TABLE:site:key=timezone:value#
#
# Don't do X
#
skipx
#
# To generate an encrypted root password use:
#
# perl -e 'print crypt("blah","Xa") . "\n";'p
# openssl passwd -apr1 -salt xxxxxxxx password
#
# where "blah" is your root password.
#
#rootpw --iscrypted XaLGAVe1C41x2
#rootpw XaLGAVe1C41x2 --iscrypted
rootpw --iscrypted #CRYPT:passwd:key=system,username=root:password#
#
# NIS setup: auth --enablenis --nisdomain sensenet
# --nisserver neptune --useshadow --enablemd5
#
# OR
auth --useshadow --enablemd5
#
# SE Linux
#
selinux --disabled
#
# Reboot after installation
#
reboot
#
#end of section
#
%packages --resolvedeps
@ Network Servers
@ System Tools
@ X Window System
@ Legacy Software Development
autofs
pdksh
tcsh
ntp
tftp
xinetd
rsh
rsh-server
psacct
nfs-utils
net-snmp
rsync
yp-tools
ypserv
ypbind
m4
sendmail-cf
gdb
bzip2
binutils
openssh-server
util-linux
compat-libstdc++-33
%pre
#INCLUDE:../scripts/pre.rh#
%post
#INCLUDE:../scripts/post.rh#

View File

@ -132,6 +132,7 @@ if [ "$1" = "1" ]; then #Only if installing for the fist time..
XCATROOT=$RPM_INSTALL_PREFIX0 $RPM_INSTALL_PREFIX0/sbin/chtab priority=2 policy.commands=getbmcconfig policy.rule=allow
XCATROOT=$RPM_INSTALL_PREFIX0 $RPM_INSTALL_PREFIX0/sbin/chtab priority=3 policy.commands=nextdestiny policy.rule=allow
XCATROOT=$RPM_INSTALL_PREFIX0 $RPM_INSTALL_PREFIX0/sbin/chtab priority=4 policy.commands=getdestiny policy.rule=allow
XCATROOT=$RPM_INSTALL_PREFIX0 $RPM_INSTALL_PREFIX0/sbin/chtab priority=4.5 policy.commands=getcredentials policy.rule=allow
fi
if [ ! -d /etc/xcat/ca ]; then