From 07295f7953b096f098eb8fd622ac9cb7ffb4b3d5 Mon Sep 17 00:00:00 2001 From: immarvin Date: Fri, 8 Mar 2013 03:14:46 +0000 Subject: [PATCH] support genimage -l for dracut mode git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/branches/2.8@15431 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/share/xcat/netboot/rh/genimage | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/xCAT-server/share/xcat/netboot/rh/genimage b/xCAT-server/share/xcat/netboot/rh/genimage index a1cb29cf6..9638fe2d9 100755 --- a/xCAT-server/share/xcat/netboot/rh/genimage +++ b/xCAT-server/share/xcat/netboot/rh/genimage @@ -674,7 +674,6 @@ unless ($dracutmode) { #in dracut mode, we delegate all this activity #if ($dracutmode) { # modify etc/rc.sysinit, prevent remounting # TODO: need to find one way to prevent remounting - if (-f "$rootimg_dir/etc/rc.sysinit") { my $SYSINITFILE; my $TMPSYSINITFILE; @@ -814,9 +813,18 @@ sub mkinitrd_dracut { xdie "the mode: $mode is not supported by genimage"; } - system("chroot $rootimg_dir dracut -f /tmp/initrd.$$.gz $kernelver"); + my $additional_options=undef; + if($rootlimit) + { + open(my $ETC_CMDLINE,">","$rootimg_dir/tmp/cmdline"); + print $ETC_CMDLINE qq{rootlimit=$rootlimit\n}; + close $ETC_CMDLINE; + $additional_options= qq{--include /tmp/cmdline /etc/cmdline}; + } + + system("chroot $rootimg_dir dracut $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"); + move("$rootimg_dir/tmp/initrd.$$.gz", "$destdir/initrd-$mode.gz"); } sub mkinitrd {