From ac121cabbed3de591fbdd0436e267a27b58c79ce Mon Sep 17 00:00:00 2001 From: ligc Date: Thu, 22 Aug 2013 16:04:33 +0800 Subject: [PATCH] support genesis on ppc64, compile on Fedora 20 ppc64 --- xCAT-genesis-builder/buildrpm | 26 ++++++++++++++++++++++++-- xCAT-genesis-builder/install | 2 +- xCAT-genesis-builder/xcat-cmdline.sh | 17 +++++++++++++++-- 3 files changed, 40 insertions(+), 5 deletions(-) mode change 100644 => 100755 xCAT-genesis-builder/xcat-cmdline.sh diff --git a/xCAT-genesis-builder/buildrpm b/xCAT-genesis-builder/buildrpm index 498bfa271..287a6ecd3 100755 --- a/xCAT-genesis-builder/buildrpm +++ b/xCAT-genesis-builder/buildrpm @@ -10,7 +10,15 @@ DIR=`dirname $0` DIR=`readlink -f $DIR` # get the input files for dracut in the right place -DRACUTMODDIR=/usr/share/dracut/modules.d/97xcat +# Fedora 20 ppc64 uses /usr/lib/dracut/modules.d +# CentOS 7 probably uses /usr/lib/dracut/modules.d also +if [ -f "/usr/share/dracut/modules.d/97xcat" ] +then + DRACUTMODDIR=/usr/share/dracut/modules.d/97xcat +else + DRACUTMODDIR=/usr/lib/dracut/modules.d/97xcat +fi + mkdir -p $DRACUTMODDIR cp $DIR/* $DRACUTMODDIR # For ppc64 platform, needs to remove some files, @@ -22,6 +30,20 @@ if [ `uname -m` = "ppc64" ]; then sed -i 's/\/usr\/lib\/libstdc++.so.6.0.13/\/usr\/lib64\/libstdc++.so.6.0.13/' $DRACUTMODDIR/install sed -i 's/\/lib\/libgcc_s.so.1/\/lib64\/libgcc_s.so.1/' $DRACUTMODDIR/install sed -i 's/\/lib\/libtinfo.so.5.7/\/lib64\/libtinfo.so.5.7/' $DRACUTMODDIR/install + # following changes are required on Fedora 20 ppc64 + sed -i 's/\/lib64\/libnss_dns-2.12.so/\/lib64\/libnss_dns-2.18.so/' $DRACUTMODDIR/install + sed -i 's/\/lib\/libc.so.6/\/lib64\/libc.so.6/' $DRACUTMODDIR/install + sed -i 's/\/lib\/ld-linux.so.2/\/lib64\/ld-2.18.so/' $DRACUTMODDIR/install + sed -i 's/\/lib\/libdl.so.2/\/lib64\/libdl.so.2/' $DRACUTMODDIR/install + sed -i 's/\/lib\/libm.so.6/\/lib64\/libm.so.6/' $DRACUTMODDIR/install + sed -i 's/\/lib\/libpthread.so.0/\/lib64\/libpthread.so.0/' $DRACUTMODDIR/install + sed -i 's/\/lib64\/libncurses.so.5.7/\/lib64\/libncurses.so.5.9/' $DRACUTMODDIR/install + sed -i 's/\/usr\/lib64\/libstdc++.so.6.0.13/\/usr\/lib64\/libstdc++.so.6.0.19/' $DRACUTMODDIR/install + sed -i 's/\/lib64\/libtinfo.so.5.7/\/lib64\/libtinfo.so.5.9/' $DRACUTMODDIR/install + sed -i 's/\/usr\/lib64\/libsasl2.so.2/\/usr\/lib64\/libsasl2.so.3/' $DRACUTMODDIR/install + sed -i 's/\/lib64\/libnss_dns-2.12.so/\/lib64\/libnss_dns-2.18.so/' $DRACUTMODDIR/install + sed -i 's/\/lib\/terminfo\/l\/linux/\/usr\/share\/terminfo\/l\/linux/g' $DRACUTMODDIR/install + sed -i 's/\/lib\/terminfo\/v\/vt100/\/usr\/share\/terminfo\/v\/vt100/g' $DRACUTMODDIR/install fi if [ "$HOSTOS" = "mcp" ]; then @@ -55,7 +77,7 @@ if [ "$HOSTOS" = "mcp" ]; then else echo Creating the initramfs in /tmp/xcatgenesis.$$.rfs using dracut ... fi -dracut -m "xcat base" -f /tmp/xcatgenesis.$$.rfs $KERNELVERSION +dracut -m "xcat base" -N -f /tmp/xcatgenesis.$$.rfs $KERNELVERSION echo Expanding the initramfs into /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/`uname -m`/fs ... cd /tmp/xcatgenesis.$$/opt/xcat/share/xcat/netboot/genesis/`uname -m`/fs diff --git a/xCAT-genesis-builder/install b/xCAT-genesis-builder/install index e335b9941..26f1ac2c3 100755 --- a/xCAT-genesis-builder/install +++ b/xCAT-genesis-builder/install @@ -1,6 +1,6 @@ #!/bin/sh echo $drivers -dracut_install wget openssl tar mstflint ipmitool cpio gzip lsmod ethtool modprobe touch echo cut wc +dracut_install wget openssl tar mstflint ipmitool cpio gzip lsmod ethtool modprobe touch echo cut wc bash dracut_install netstat # broadcom update requires dracut_install uniq # mellanox update requires dracut_install grep ip hostname /usr/bin/awk egrep grep dirname expr diff --git a/xCAT-genesis-builder/xcat-cmdline.sh b/xCAT-genesis-builder/xcat-cmdline.sh old mode 100644 new mode 100755 index 0b60f30d9..1188095f5 --- a/xCAT-genesis-builder/xcat-cmdline.sh +++ b/xCAT-genesis-builder/xcat-cmdline.sh @@ -12,10 +12,23 @@ 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 +# Fedora 20 ppc64 uses /lib/dracut/hooks/initqueue/finished +# CentOS 7 probably uses /lib/dracut/hooks/initqueue/finished also +if [ -d "/initqueue-finished" ]; then + echo '[ -e $NEWROOT/proc ]' > /initqueue-finished/xcatroot.sh +else + #echo 'if [ -e /proc ]; then /bin/doxcat; fi' > /lib/dracut/hooks/initqueue/finished/xcatroot.sh + echo '[ -e /proc ]' > /lib/dracut/hooks/initqueue/finished/xcatroot.sh +fi mkdir /dev/cgroup mount -t cgroup -o cpu,memory,devices cgroup /dev/cgroup -udevd --daemon +# Fedora 20 ppc64 does not udevd +# CentOS 7 probably does not have udevd either +if [ -f "/sbin/udevd" ]; then + udevd --daemon +else + /usr/lib/systemd/systemd-udevd --daemon +fi udevadm trigger mkdir -p /var/lib/dhclient/ mkdir -p /var/log