system x support for SLES 11 SP1

git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@8870 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd
This commit is contained in:
ligc 2011-02-17 07:13:23 +00:00
parent a1a4d654a9
commit ae310c716e

View File

@ -314,6 +314,20 @@ unless ($onlyinitrd) {
system "mknod $rootimg_dir/dev/null c 1 3"; #that's neccessary for SLES11
}
unless ( -e "$rootimg_dir/dev/random") {
system "mknod $rootimg_dir/dev/random c 1 8"; #that's neccessary for SLES11
}
unless ( -e "$rootimg_dir/dev/urandom") {
system "mknod $rootimg_dir/dev/urandom c 1 9"; #that's neccessary for SLES11
}
for (my $i = 0; $i <= 12; $i++)
{
unless ( -e "$rootimg_dir/dev/tty$i") {
system "mknod $rootimg_dir/dev/tty$i c 4 $i"; #that's neccessary for SLES11
}
}
open($fd,">>","$rootimg_dir/etc/fstab"); # TODO: is it necessary?
print $fd "#Dummy fstab for rpm postscripts to see\n";
close($fd);
@ -860,6 +874,16 @@ EOS1
print $inifile "mknod /dev/ttyS2 c 4 66\n";
print $inifile "mknod /dev/ttyS3 c 4 67\n";
# Start udev
print $inifile <<EOMS;
# Start udev to find devices attached to node
# This script can be found in /lib/mkinitrd
echo "Creating device nodes with udev"
/sbin/udevd --daemon
/sbin/udevadm trigger
/sbin/udevadm settle --timeout=10
EOMS
foreach (@ndrivers) {
print $inifile "insmod /lib/$_\n";
}
@ -869,17 +893,6 @@ EOS1
print $inifile "grep '\(debug\)' /proc/cmdline > /dev/null && export DEBUG=1\n";
}
# Start udev on s390x
if ($arch eq "s390x") {
print $inifile <<EOMS;
# Start udev to find devices attached to node
# This script can be found in /lib/mkinitrd
echo "Creating device nodes with udev"
echo `/sbin/udevd --daemon`
echo `/sbin/udevadm trigger`
echo `/sbin/udevadm settle --timeout=10`
EOMS
}
print $inifile <<EOMS;
# check the kernel parameters firstly
@ -1200,20 +1213,13 @@ END
}
}
if($mode eq "statelite") {
foreach ("sbin/ifconfig", "usr/bin/clear", "sbin/mount.nfs","sbin/umount.nfs","bin/hostname","usr/bin/egrep","bin/ln","bin/ls","usr/bin/dirname","usr/bin/expr","usr/bin/chroot","usr/bin/grep","bin/cpio","bin/sleep","bin/mount","bin/umount","sbin/dhcpcd","bin/bash","sbin/insmod","bin/mkdir","bin/mknod","sbin/ip","bin/cat","usr/bin/awk","usr/bin/wget","bin/cp","usr/bin/cpio","usr/bin/zcat","usr/bin/gzip","lib/mkinitrd/bin/run-init","usr/bin/uniq","usr/bin/sed","usr/bin/wc", "bin/sed") {
foreach ("sbin/ifconfig", "usr/bin/clear", "sbin/mount.nfs","sbin/umount.nfs","bin/hostname","usr/bin/egrep","bin/ln","bin/ls","usr/bin/dirname","usr/bin/expr","usr/bin/chroot","usr/bin/grep","bin/cpio","bin/sleep","bin/mount","bin/umount","sbin/dhcpcd","bin/bash","sbin/insmod","bin/mkdir","bin/mknod","sbin/ip","bin/cat","usr/bin/awk","usr/bin/wget","bin/cp","usr/bin/cpio","usr/bin/zcat","usr/bin/gzip","lib/mkinitrd/bin/run-init","usr/bin/uniq","usr/bin/sed","usr/bin/wc", "bin/sed","sbin/udevd", "sbin/udevadm", "usr/bin/readlink") {
getlibs($_);
push @filestoadd,$_;
}
# 'sbin/udevd' and 'sbin/udevadm' needed on s390x
if ($arch eq "s390x") {
foreach ("sbin/udevd", "sbin/udevadm", "usr/bin/readlink") {
getlibs($_);
push @filestoadd,$_;
}
}
}else {
foreach ("sbin/ifconfig","usr/bin/clear", "usr/bin/grep","bin/cpio","bin/sleep","bin/mount","sbin/dhcpcd","bin/bash","sbin/insmod","bin/mkdir","bin/mknod","sbin/ip","bin/cat","usr/bin/awk","usr/bin/wget","bin/cp","usr/bin/cpio","usr/bin/zcat","usr/bin/gzip","lib/mkinitrd/bin/run-init","usr/bin/uniq","usr/bin/sed") {
foreach ("sbin/ifconfig","usr/bin/clear", "usr/bin/grep","bin/cpio","bin/sleep","bin/mount","sbin/dhcpcd","bin/bash","sbin/insmod","bin/mkdir","bin/mknod","sbin/ip","bin/cat","usr/bin/awk","usr/bin/wget","bin/cp","usr/bin/cpio","usr/bin/zcat","usr/bin/gzip","lib/mkinitrd/bin/run-init","usr/bin/uniq","usr/bin/sed","sbin/udevd", "sbin/udevadm", "usr/bin/readlink") {
getlibs($_);
push @filestoadd,$_;
}
@ -1269,23 +1275,24 @@ END
}
}
# Copy udev libraries on s390x
if ($arch eq "s390x") {
system("mkdir -p /tmp/xcatinitrd.$$/etc/udev");
system("cp -r $rootimg_dir/etc/udev/* /tmp/xcatinitrd.$$/etc/udev");
# Copy rules for network adapter
my $name = `cat /etc/sysconfig/network/ifcfg-$prinic | grep NAME`;
my $nic = '';
if ($name =~ m/(\d+\.\d+\.\d+)/g) {
$nic = $&;
}
system("cp -r /etc/udev/rules.d/*$nic.rules /tmp/xcatinitrd.$$/etc/udev/rules.d");
system("cp -r /etc/udev/rules.d/*persistent-net.rules /tmp/xcatinitrd.$$/etc/udev/rules.d");
system("mkdir -p /tmp/xcatinitrd.$$/lib/udev");
system("cp -r $rootimg_dir/lib/udev/* /tmp/xcatinitrd.$$/lib/udev");
# Copy udev libraries
system("mkdir -p /tmp/xcatinitrd.$$/etc/udev");
system("mkdir -p /tmp/xcatinitrd.$$/lib/firmware");
system("cp -r $rootimg_dir/etc/udev/* /tmp/xcatinitrd.$$/etc/udev");
system("cp -r $rootimg_dir/bin/uname /tmp/xcatinitrd.$$/bin/");
system("cp -r $rootimg_dir/lib/firmware/* /tmp/xcatinitrd.$$/lib/firmware");
# Copy rules for network adapter
my $name = `cat /etc/sysconfig/network/ifcfg-$prinic | grep NAME`;
my $nic = '';
if ($name =~ m/(\d+\.\d+\.\d+)/g) {
$nic = $&;
}
system("cp -r /etc/udev/rules.d/*$nic.rules /tmp/xcatinitrd.$$/etc/udev/rules.d");
system("cp -r /etc/udev/rules.d/*persistent-net.rules /tmp/xcatinitrd.$$/etc/udev/rules.d");
system("mkdir -p /tmp/xcatinitrd.$$/lib/udev");
system("cp -r $rootimg_dir/lib/udev/* /tmp/xcatinitrd.$$/lib/udev");
#copy("$rootimg_dir/lib/modules/*d","/tmp/xcatinitrd.$$/$_");
system("cd /tmp/xcatinitrd.$$/bin/; ln -sf bash sh"); #neccessary for SLES11