diff --git a/xCAT-SoftLayer/si-post-install/20all.makeinitrd b/xCAT-SoftLayer/si-post-install/20all.makeinitrd new file mode 100755 index 000000000..761890045 --- /dev/null +++ b/xCAT-SoftLayer/si-post-install/20all.makeinitrd @@ -0,0 +1,18 @@ +#!/bin/bash + +# This SI post-install script is needed because the initrd that autoyast/kickstart/ubuntu builds when installing +# sles/rh/ubuntu on the golden node may not have the drivers when that initrd runs on the node that is +# being deployed with this image (specifically, drivers to be able to mount the disk). +# So rebuild the initrd on the to-node after putting the image on the disk, but before rebooting. + +#todo: Make this script work on red hat by checking for dracut and using that if it exists. +# And do whatever is necessary on ubuntu. + +if [[ -f /sbin/dracut ]]; then + #todo: implement rh case using dracut + echo "Note: not regenerating the initrd, because dracut is not supported by this node yet." +else + # suse/sles + echo "Running mkinitrd to regenerate the initrd with the drivers needed by this node:" + mkinitrd +fi diff --git a/xCAT-SoftLayer/si-post-install/20all.mkinitrd_for_suse11 b/xCAT-SoftLayer/si-post-install/20all.mkinitrd_for_suse11 deleted file mode 100755 index c18e454f8..000000000 --- a/xCAT-SoftLayer/si-post-install/20all.mkinitrd_for_suse11 +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -# This SI post-install script is needed because the initrd that autoyast builds when installing -# sles on the golden node may not have the drivers when that initrd runs on the node that is -# being deployed with this image (specifically, drivers to be able to mount the disk). -# So rebuild the initrd on the to-node after putting the image on the disk, but before rebooting. - -#todo: this same issue could occur on other distros too. Make this script work on red hat by -# checking for dracut and using that if it exists. - -mkinitrd diff --git a/xCAT-SoftLayer/si-post-install/99all.killsyslog b/xCAT-SoftLayer/si-post-install/99all.killsyslog index 7df9b06fe..348910189 100755 --- a/xCAT-SoftLayer/si-post-install/99all.killsyslog +++ b/xCAT-SoftLayer/si-post-install/99all.killsyslog @@ -12,7 +12,7 @@ if [ -f "/etc/SuSE-release" ];then fi fi -# SI starts klogd in the chroot, but does not kill it +# SI starts klogd in the chroot, but does not kill it. Remove this line when SI fixes their bug. killall klogd # flush all write buffers, just in case SI can not umount /a diff --git a/xCAT-SoftLayer/xCAT-SoftLayer.spec b/xCAT-SoftLayer/xCAT-SoftLayer.spec index 77aceab5d..7ee7e06d1 100644 --- a/xCAT-SoftLayer/xCAT-SoftLayer.spec +++ b/xCAT-SoftLayer/xCAT-SoftLayer.spec @@ -17,6 +17,9 @@ BuildArch: noarch Requires: xCAT-server #Requires: xCAT-server >= %{epoch}:%(cat Version|cut -d. -f 1,2) +# perl-ExtUtils-MakeMaker, perl-CPAN, perl-Test-Harness are only available in rhel. +# When this rpm supports being installed in sles, need to add these to xcat-dep. +# perl-SOAP-Lite is already in xcat-dep Requires: perl-ExtUtils-MakeMaker perl-CPAN perl-Test-Harness perl-SOAP-Lite Provides: xCAT-SoftLayer = %{epoch}:%{version} @@ -45,7 +48,7 @@ xCAT-SoftLayer provides Utilities to make xCAT work in a SoftLayer environment. rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/%{prefix}/bin mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/install -mkdir -p $RPM_BUILD_ROOT/install/postscripts +mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/xcat/sysclone/postscripts mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/doc/packages/xCAT-SoftLayer mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/man/man1 mkdir -p $RPM_BUILD_ROOT/%{prefix}/share/doc/man1 @@ -56,8 +59,8 @@ cp -p -R share/xcat/install/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/install/ cp -d bin/* $RPM_BUILD_ROOT/%{prefix}/bin chmod 755 $RPM_BUILD_ROOT/%{prefix}/bin/* -cp -d postscripts/* $RPM_BUILD_ROOT/install/postscripts -chmod 755 $RPM_BUILD_ROOT/install/postscripts/* +cp -d postscripts/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/sysclone/postscripts +chmod 755 $RPM_BUILD_ROOT/%{prefix}/share/xcat/sysclone/postscripts/* cp -d si-post-install/* $RPM_BUILD_ROOT/%{prefix}/share/xcat/sysclone/post-install chmod 755 $RPM_BUILD_ROOT/%{prefix}/share/xcat/sysclone/post-install/* @@ -77,4 +80,8 @@ rm -rf $RPM_BUILD_ROOT %defattr(-,root,root) #%doc LICENSE.html %{prefix} -/install/postscripts + +%post +# We are shipping the postscripts in a sysclone dir and then copying them to /install/postscripts here, +# because we want to allow base xcat to eventually ship them and not conflict on the file name/path +cp -f /%{prefix}/share/xcat/sysclone/postscripts/* /install/postscripts