diff --git a/xCAT-server/share/xcat/netboot/sles/compute.sles10.ppc64.exlist b/xCAT-server/share/xcat/netboot/sles/compute.sles10.ppc64.exlist new file mode 100644 index 000000000..fb4fb072b --- /dev/null +++ b/xCAT-server/share/xcat/netboot/sles/compute.sles10.ppc64.exlist @@ -0,0 +1,13 @@ +./usr/share/man* +./usr/share/locale* +./usr/share/i18n* +./var/cache/yum* +./usr/share/doc* +./usr/share/gnome* +./usr/share/zoneinfo* +./usr/share/cracklib* +./usr/share/info* +./usr/share/omf* +./usr/lib/locale* +./usr/lib/perl5* +./boot* diff --git a/xCAT-server/share/xcat/netboot/sles/compute.sles10.ppc64.pkglist b/xCAT-server/share/xcat/netboot/sles/compute.sles10.ppc64.pkglist new file mode 100644 index 000000000..dd6aa5df2 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/sles/compute.sles10.ppc64.pkglist @@ -0,0 +1,23 @@ +aaa_base +bash +nfs-utils +stunnel +dhcpcd +kernel-ppc64 +openssh +procps +psmisc +wget +vim +sysconfig +syslog-ng +klogd +dbus +dbus-1-64bit +hal +hal-64bit +pam-modules-64bit +pam-64bit +resmgr +resmgr-64bit + diff --git a/xCAT-server/share/xcat/netboot/sles/compute.sles10.ppc64.postinstall b/xCAT-server/share/xcat/netboot/sles/compute.sles10.ppc64.postinstall new file mode 100644 index 000000000..bc50c8b68 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/sles/compute.sles10.ppc64.postinstall @@ -0,0 +1,41 @@ +#!/bin/sh +#-- Do not remove following line if you want to make use of CVS version tracking +#-- $Id: compute.postinstall,v 1.21 2008/09/04 12:05:45 sikorsky Exp $ +#-- jurij.sikorsky@t-systems.cz +#-- +#-- this script is run after all packages from $profile.pkglist are installed +#-- +#-- it gets these arguments: +#-- +#-- $1 = install root (chroot directory for profile) +#-- $2 = OS version +#-- $3 = architecture +#-- $4 = profile name +#-- $5 = work dir (where genimage is located) +#-- +#-- +installroot=$1 +osver=$2 +arch=$3 +profile=$4 +workdir=$5 + +#-- Example how /etc/fstab can be automatically generated during image generation: +cp $installroot/etc/fstab $installroot/etc/fstab.prev +cat <$installroot/etc/fstab +proc /proc proc rw 0 0 +sysfs /sys sysfs rw 0 0 +devpts /dev/pts devpts rw,gid=5,mode=620 0 0 +${profile}_${arch} / tmpfs rw 0 1 +none /tmp tmpfs defaults,size=10m 0 2 +none /var/tmp tmpfs defaults,size=10m 0 2 +END + +#-- Example of booted image versioning +#-- We want to know, with what configuration (version of the image) each node was booted. +#-- Hence, we keep image definition files and postscripts in CVS. During image generation we create file /etc/IMGVERSION and fill it with CVS "$Id$" of files with image definition (.pkglist, .exlist, .repolist, .postinstall). Then, during boot, each "CVS enabled" postscript (see /install/postscripts/cvs_template.sh and /install/postscripts/cvs_template.pl) adds one line to /etc/IMGVERSION. Then you can determine in any time what image you are running and what postscipts in which versions were run. +#cat /dev/null > $installroot/etc/IMGVERSION +#for ext in pkglist exlist postinstall repolist; do +# [ -r $workdir/$profile.$ext ] && cat $workdir/$profile.$ext | grep -E '^[[:space:]]*#.*[[:space:]]\$Id' >> $installroot/etc/IMGVERSION +#done + diff --git a/xCAT-server/share/xcat/netboot/sles/genimage b/xCAT-server/share/xcat/netboot/sles/genimage index 8741324ac..a2a20accb 100755 --- a/xCAT-server/share/xcat/netboot/sles/genimage +++ b/xCAT-server/share/xcat/netboot/sles/genimage @@ -123,7 +123,7 @@ unless ($onlyinitrd) { open($fd,">>","$installroot/netboot/$osver/$arch/$profile/rootimg/etc/fstab"); print $fd "#Dummy fstab for rpm postscripts to see\n"; close($fd); - if($osver eq "sles11") {#zypper in SLES11 is different + if($osver =~ /sles11/) {#zypper in SLES11 is different my $rootimg_dir="$installroot/netboot/$osver/$arch/$profile/rootimg"; if(-e "$rootimg_dir/etc/zypp/repos.d/$osver.repo") { system("rm -rf $rootimg_dir/etc/zypp/repos.d/$osver.repo"); @@ -135,7 +135,7 @@ unless ($onlyinitrd) { #for extra packages if ($pkgnames) { - if($osver eq "sles11") { #SLES11 + if($osver =~ /sles11/) { #SLES11 system("zypper -R $installroot/netboot/$osver/$arch/$profile/rootimg/ ar file:$srcdir_otherpkgs otherpkg"); }else { system("zypper -R $installroot/netboot/$osver/$arch/$profile/rootimg/ sa file:$srcdir_otherpkgs"); @@ -159,10 +159,10 @@ unless ($onlyinitrd) { #$yumcmd .= "install "; #mkpath("$installroot/netboot/$osver/$arch/$profile/rootimg/var/lib/yum"); my $yumcmd; - if($osver eq "sles11") { + if($osver =~ /sles11/) { $yumcmd = "YAST_IS_RUNNING=\"instsys\" zypper -R $installroot/netboot/$osver/$arch/$profile/rootimg/ install -l "; #add -l for SLES11 }else { - $yumcmd = "zypper -R $installroot/netboot/$osver/$arch/$profile/rootimg/ install"; + $yumcmd = "zypper -R $installroot/netboot/$osver/$arch/$profile/rootimg/ install "; } my $pkglist= get_pkglist_file_name($customdir); if (!$pkglist) { @@ -172,7 +172,7 @@ unless ($onlyinitrd) { if (!$pkglist) { print "Unable to find package list for $profile!"; - return 1; + exit 1; } open($yumconfig,"<","$pkglist"); @@ -235,19 +235,25 @@ sub getlibs { sub mkinitrd { mkpath("/tmp/xcatinitrd.$$/bin"); if($basekernelver eq $kernelver) { - rename(<$installroot/netboot/$osver/$arch/$profile/rootimg/boot/vmlinuz*>,"$installroot/netboot/$osver/$arch/$profile/kernel"); - } + if (-f "$installroot/netboot/$osver/$arch/$profile/rootimg/boot/vmlinuz-$kernelver") { + rename(<$installroot/netboot/$osver/$arch/$profile/rootimg/boot/vmlinuz*>,"$installroot/netboot/$osver/$arch/$profile/kernel"); + } elsif (-f "$installroot/netboot/$osver/$arch/$profile/rootimg/boot/vmlinux-$kernelver"){ + rename(<$installroot/netboot/$osver/$arch/$profile/rootimg/boot/vmlinux*>,"$installroot/netboot/$osver/$arch/$profile/kernel"); + } + } else { - if(-r "$installroot/netboot/$osver/$arch/$profile/rootimg/boot/vmlinuz-$kernelver") { - rename("$installroot/netboot/$osver/$arch/$profile/rootimg/boot/vmlinuz-$kernelver","$installroot/netboot/$osver/$arch/$profile/kernel"); - } elsif(-r "/boot/vmlinuz-$kernelver") { - copy("/boot/vmlinuz-$kernelver","$installroot/netboot/$osver/$arch/$profile/kernel"); - } elsif(-r "/boot/vmlinux-$kernelver") {#for SLES10,11 + if(-r "$installroot/netboot/$osver/$arch/$profile/rootimg/boot/vmlinuz-$kernelver") { + rename("$installroot/netboot/$osver/$arch/$profile/rootimg/boot/vmlinuz-$kernelver","$installroot/netboot/$osver/$arch/$profile/kernel"); + } elsif(-r "$installroot/netboot/$osver/$arch/$profile/rootimg/boot/vmlinux-$kernelver") { + rename("$installroot/netboot/$osver/$arch/$profile/rootimg/boot/vmlinux-$kernelver","$installroot/netboot/$osver/$arch/$profile/kernel"); + } elsif(-r "/boot/vmlinuz-$kernelver") { + copy("/boot/vmlinuz-$kernelver","$installroot/netboot/$osver/$arch/$profile/kernel"); + } elsif(-r "/boot/vmlinux-$kernelver") {#for SLES10,11 copy("/boot/vmlinux-$kernelver","$installroot/netboot/$osver/$arch/$profile/kernel"); - } - else { - xdie("Cannot read /boot/vmlinuz-$kernelver"); - } + } + else { + xdie("Cannot read /boot/vmlinuz-$kernelver"); + } } symlink("bin","/tmp/xcatinitrd.$$/sbin"); mkpath("/tmp/xcatinitrd.$$/usr/bin"); @@ -258,8 +264,8 @@ sub mkinitrd { mkpath("/tmp/xcatinitrd.$$/tmp"); mkpath("/tmp/xcatinitrd.$$/var/run"); mkpath("/tmp/xcatinitrd.$$/lib64/firmware"); - if($osver eq "sles11" && $arch eq "ppc64") {#SLES11 for Power6 - mkpath("/tmp/xcatinitrd.$$/lib64/power6"); + if((($osver =~ /sles11/) || ($osver =~ /sles10/)) && $arch eq "ppc64") {#SLES11 for Power6 + mkpath("/tmp/xcatinitrd.$$/lib64/power6"); } mkpath("/tmp/xcatinitrd.$$/lib/power6");#SLES10 mkpath("/tmp/xcatinitrd.$$/lib/mkinitrd/bin"); @@ -571,6 +577,7 @@ sub generic_post { #This function is meant to leave the image in a state approxi open($cfgfile,">>","$installroot/netboot/$osver/$arch/$profile/rootimg/etc/securetty"); print $cfgfile "ttyS0\n"; print $cfgfile "ttyS1\n"; + print $cfgfile "console\n"; close($cfgfile); my @passwd; open($cfgfile,"<","$installroot/netboot/$osver/$arch/$profile/rootimg/etc/passwd"); @@ -620,7 +627,7 @@ sub generic_post { #This function is meant to leave the image in a state approxi system("sed -i '".'s/^\(TARGETS = .*\)$/\1 gettyset/'."' $installroot/netboot/$osver/$arch/$profile/rootimg/etc/init.d/.depend.start"); system("ln -s ../gettyset $installroot/netboot/$osver/$arch/$profile/rootimg/etc/init.d/rc3.d/S60gettyset"); } - if($osver eq "sles11") {#for sles11 + if(($osver =~ /sles11/) || ($osver =~ /sles10/)) {#for sles11,sles10 rename(<$installroot/netboot/$osver/$arch/$profile/rootimg/boot/vmlinux*>,"$installroot/netboot/$osver/$arch/$profile/kernel"); }else { rename(<$installroot/netboot/$osver/$arch/$profile/rootimg/boot/vmlinuz*>,"$installroot/netboot/$osver/$arch/$profile/kernel"); diff --git a/xCAT-server/share/xcat/netboot/sles/service.sles10.ppc64.exlist b/xCAT-server/share/xcat/netboot/sles/service.sles10.ppc64.exlist new file mode 100644 index 000000000..23963520f --- /dev/null +++ b/xCAT-server/share/xcat/netboot/sles/service.sles10.ppc64.exlist @@ -0,0 +1,12 @@ +./usr/share/man* +./usr/share/locale* +./usr/share/i18n* +./var/cache/yum* +./usr/share/doc* +./usr/share/gnome* +./usr/share/zoneinfo* +./usr/share/cracklib* +./usr/share/info* +./usr/share/omf* +./usr/lib/locale* +./boot* diff --git a/xCAT-server/share/xcat/netboot/sles/service.sles10.ppc64.pkglist b/xCAT-server/share/xcat/netboot/sles/service.sles10.ppc64.pkglist new file mode 100644 index 000000000..d4211538d --- /dev/null +++ b/xCAT-server/share/xcat/netboot/sles/service.sles10.ppc64.pkglist @@ -0,0 +1,49 @@ +kernel-ppc64 +udev +sysconfig +aaa_base +syslogd +klogd +device-mapper +bash +stunnel +nfs-utils +ksh +syslog-ng +openssh +openssh-askpass +busybox +vim +rpm +bind +bind-utils +dhcp +dhcpcd +dhcp-server +dhcp-client +dhcp-relay +bzip2 +rootfiles +cron +wget +vsftpd +util-linux +module-init-tools +mkinitrd +apache2 +apache2-prefork +perl-Bootloader +psmisc +procps +resmgr +dbus +dbus-1-64bit +hal +hal-64bit +pam-modules-64bit +pam-64bit +resmgr +resmgr-64bit +timezone + + diff --git a/xCAT-server/share/xcat/netboot/sles/service.sles10.ppc64.postinstall b/xCAT-server/share/xcat/netboot/sles/service.sles10.ppc64.postinstall new file mode 100644 index 000000000..d12333066 --- /dev/null +++ b/xCAT-server/share/xcat/netboot/sles/service.sles10.ppc64.postinstall @@ -0,0 +1,59 @@ +#!/bin/sh +#-- Do not remove following line if you want to make use of CVS version tracking +#-- $Id: compute.postinstall,v 1.21 2008/09/04 12:05:45 sikorsky Exp $ +#-- jurij.sikorsky@t-systems.cz +#-- +#-- this script is run after all packages from $profile.pkglist are installed +#-- +#-- it gets these arguments: +#-- +#-- $1 = install root (chroot directory for profile) +#-- $2 = OS version +#-- $3 = architecture +#-- $4 = profile name +#-- $5 = work dir (where genimage is located) +#-- +#-- +installroot=$1 +osver=$2 +arch=$3 +profile=$4 +workdir=$5 + +#-- Example how /etc/fstab can be automatically generated during image generation: +cp $installroot/etc/fstab $installroot/etc/fstab.prev +cat <$installroot/etc/fstab +proc /proc proc rw 0 0 +sysfs /sys sysfs rw 0 0 +devpts /dev/pts devpts rw,gid=5,mode=620 0 0 +${profile}_${arch} / tmpfs rw 0 1 +none /tmp tmpfs defaults,size=10m 0 2 +none /var/tmp tmpfs defaults,size=10m 0 2 +END + +#Prevent DHCP from starting up until xcatd has had a chance to configure it: +chroot $installroot chkconfig dhcpd off +chroot $installroot chkconfig dhcrelay off + +#turn on some services +chroot $installroot chkconfig dbus on +chroot $installroot chkconfig boot.localnet on +chroot $installroot chkconfig haldaemon on +chroot $installroot chkconfig network on +chroot $installroot chkconfig syslog on +chroot $installroot chkconfig apache2 on + +#export /install as read-only +echo '/install *(ro,no_root_squash,sync,fsid=13)' > $installroot/etc/exports + +#uncomment out the cons line in etc/inittab +sed -i 's/^\#\(\s\)*cons/cons/' $installroot/etc/inittab + +#-- Example of booted image versioning +#-- We want to know, with what configuration (version of the image) each node was booted. +#-- Hence, we keep image definition files and postscripts in CVS. During image generation we create file /etc/IMGVERSION and fill it with CVS "$Id$" of files with image definition (.pkglist, .exlist, .repolist, .postinstall). Then, during boot, each "CVS enabled" postscript (see /install/postscripts/cvs_template.sh and /install/postscripts/cvs_template.pl) adds one line to /etc/IMGVERSION. Then you can determine in any time what image you are running and what postscipts in which versions were run. +#cat /dev/null > $installroot/etc/IMGVERSION +#for ext in pkglist exlist postinstall repolist; do +# [ -r $workdir/$profile.$ext ] && cat $workdir/$profile.$ext | grep -E '^[[:space:]]*#.*[[:space:]]\$Id' >> $installroot/etc/IMGVERSION +#done +