From 40d4c75b29fa076efd601ae8327208dbd61a4a3c Mon Sep 17 00:00:00 2001 From: daniceexi Date: Thu, 8 May 2014 10:11:37 -0400 Subject: [PATCH] code change for rh7 stateless support --- xCAT-server/share/xcat/netboot/rh/genimage | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/rh/genimage b/xCAT-server/share/xcat/netboot/rh/genimage index 37eadfd8f..0acc19ed4 100755 --- a/xCAT-server/share/xcat/netboot/rh/genimage +++ b/xCAT-server/share/xcat/netboot/rh/genimage @@ -583,8 +583,8 @@ if ( (-d "$rootimg_dir/usr/share/dracut") or (-d "$rootimg_dir/usr/lib/dracut") my $dracutver = `rpm --root $rootimg_dir -qi dracut | grep Version | awk -F' ' '{print \$3}'`; chomp($dracutver); if ($dracutver =~ /^\d\d\d$/) { - if (($dracutver >= "009") and ($dracutver < "033")) { - $dracutdir = "dracut_009"; + if ($dracutver >= "033") { + $dracutdir = "dracut_033"; } else { $dracutdir = "dracut"; # The default directory } @@ -924,7 +924,11 @@ sub mkinitrd_dracut { $additional_options= qq{--include /tmp/cmdline /etc/cmdline}; } - system("chroot $rootimg_dir dracut $additional_options -f /tmp/initrd.$$.gz $kernelver"); + # force the dracut run in non-hostonly mode for dracut higher than version 033 + if ($dracutver > "033") { + $additional_options .= " -N"; + } + system("chroot $rootimg_dir dracut -N $additional_options -f /tmp/initrd.$$.gz $kernelver"); print "the initial ramdisk for $mode is generated successfully.\n"; move("$rootimg_dir/tmp/initrd.$$.gz", "$destdir/initrd-$mode.gz"); } @@ -1665,7 +1669,11 @@ sub using_systemd { my $os = shift; if ($os =~ /fedora(\d+)/) { if ($1 >= 15) { - return 1; + return 1; + } + }elsif ($os =~ /rhels(\d+)/) { + if ($1 >= 7) { + return 1; } }