From 1201990fc6c0981811b9eebbac073fef3bb9a264 Mon Sep 17 00:00:00 2001 From: jbjohnso Date: Mon, 19 Sep 2011 17:21:32 +0000 Subject: [PATCH] Fixup on uefi linux boot git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@10553 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-nbroot2/xcat-cmdline.sh | 27 +++++++++++++++++++++++++++ xCAT-server/lib/xcat/plugins/dhcp.pm | 2 +- xCAT-server/lib/xcat/plugins/xnba.pm | 15 +++++++++++++++ 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 xCAT-nbroot2/xcat-cmdline.sh diff --git a/xCAT-nbroot2/xcat-cmdline.sh b/xCAT-nbroot2/xcat-cmdline.sh new file mode 100644 index 000000000..00914979e --- /dev/null +++ b/xCAT-nbroot2/xcat-cmdline.sh @@ -0,0 +1,27 @@ +root=1 +rootok=1 +netroot=xcat +clear +echo PS1="'"'[xCAT Genesis running on \H \w]\$ '"'" > /.bashrc +echo PS1="'"'[xCAT Genesis running on \H \w]\$ '"'" > /.bash_profile +mkdir -p /etc/ssh +mkdir -p /var/empty/sshd +echo root:x:0:0::/:/bin/bash >> /etc/passwd +echo sshd:x:30:30:SSH User:/var/empty/sshd:/sbin/nologin >> /etc/passwd +echo rpc:x:32:32:Rpcbind Daemon:/var/cache/rpcbind:/sbin/nologin >> /etc/passwd +echo rpcuser:x:29:29:RPC Service User:/var/lib/nfs:/sbin/nologin >> /etc/passwd +echo qemu:x:107:107:qemu user:/:/sbin/nologin >> /etc/passwd +echo '[ -e $NEWROOT/proc ]' > /initqueue-finished/xcatroot.sh +mkdir /dev/cgroup +mount -t cgroup -o cpu,memory,devices cgroup /dev/cgroup +udevd --daemon +udevadm trigger +mkdir -p /var/lib/dhclient/ +mkdir -p /var/log +ip link set lo up +echo '127.0.0.1 localhost' >> /etc/hosts +if grep console=ttyS /proc/cmdline > /dev/null; then + while :; do sleep 1; screen -x console < /dev/tty1 > /dev/tty1 2>&1; clear; done & +fi +while :; do screen -ln < /dev/tty2 > /dev/tty2 2>&1; done & +while :; do screen -ln doxcat; done diff --git a/xCAT-server/lib/xcat/plugins/dhcp.pm b/xCAT-server/lib/xcat/plugins/dhcp.pm index 5c3e1d070..8e43aa1bb 100644 --- a/xCAT-server/lib/xcat/plugins/dhcp.pm +++ b/xCAT-server/lib/xcat/plugins/dhcp.pm @@ -393,7 +393,7 @@ sub addnode } else { #TODO: if windows uefi, do vendor-class-identifier of "PXEClient" to bump it over to proxydhcp.c if ($douefi) { - $lstatements = 'if option user-class-identifier = \"xNBA\" and option client-architecture = 00:00 { filename = \"http://'.$nxtsrv.'/tftpboot/xcat/xnba/nodes/'.$node.'\"; } else if option user-class-identifier = \"xNBA\" and option client-architecture = 00:09 { filename = \"http://'.$nxtsrv.'/tftpboot/xcat/xnba/nodes/'.$node.'.uefi\"; } else if option client-architecture = 00:07 { filename = \"xcat/xnba.efi\"; } else if option client-architecture = 00:00 { filename = \"xcat/xnba.kpxe\"; } else { filename = \"\"; }'.$lstatements; #Only PXE compliant clients should ever receive xNBA + $lstatements = 'if option user-class-identifier = \"xNBA\" and option client-architecture = 00:00 { always-broadcast on; filename = \"http://'.$nxtsrv.'/tftpboot/xcat/xnba/nodes/'.$node.'\"; } else if option user-class-identifier = \"xNBA\" and option client-architecture = 00:09 { filename = \"http://'.$nxtsrv.'/tftpboot/xcat/xnba/nodes/'.$node.'.uefi\"; } else if option client-architecture = 00:07 { filename = \"xcat/xnba.efi\"; } else if option client-architecture = 00:00 { filename = \"xcat/xnba.kpxe\"; } else { filename = \"\"; }'.$lstatements; #Only PXE compliant clients should ever receive xNBA } else { $lstatements = 'if option user-class-identifier = \"xNBA\" and option client-architecture = 00:00 { filename = \"http://'.$nxtsrv.'/tftpboot/xcat/xnba/nodes/'.$node.'\"; } else if option client-architecture = 00:00 { filename = \"xcat/xnba.kpxe\"; } else { filename = \"\"; }'.$lstatements; #Only PXE compliant clients should ever receive xNBA } diff --git a/xCAT-server/lib/xcat/plugins/xnba.pm b/xCAT-server/lib/xcat/plugins/xnba.pm index 85338cb98..042845af1 100644 --- a/xCAT-server/lib/xcat/plugins/xnba.pm +++ b/xCAT-server/lib/xcat/plugins/xnba.pm @@ -211,6 +211,21 @@ sub setstate { print $pcfg "imgfetch http://".'${next-server}'."/tftpboot/".$kern->{initrd}."\n"; } print $pcfg "imgexec kernel\n"; + if ($kern->{kcmdline} and $kern->{initrd}) { #only a linux kernel/initrd pair should land here, write elilo config and uefi variant of xnba config file + my $ucfg; + open($ucfg,'>',$tftpdir."/xcat/xnba/nodes/".$node.".uefi"); + print $ucfg "#!gpxe\n"; + print $ucfg 'chain http://${next-server}/tftpboot/xcat/elilo-x64.efi -C /tftpboot/xcat/xnba/nodes/'.$node.".elilo\n"; + close($ucfg); + open($ucfg,'>',$tftpdir."/xcat/xnba/nodes/".$node.".elilo"); + print $ucfg 'default="xCAT"'."\n"; + print $ucfg "delay=0\n\n"; + print $ucfg "image=/tftpboot/".$kern->{kernel}."\n"; + print $ucfg " label=\"xCAT\"\n"; + print $ucfg " initrd=/tftpboot/".$kern->{initrd}."\n"; + print $ucfg " append=\"".$kern->{kcmdline}.' BOOTIF=%B"'."\n"; + close($ucfg); + } } } close($pcfg);