From 0d56a54ddf5391a9571e324e7ff0c5232831345d Mon Sep 17 00:00:00 2001 From: sikorsky Date: Wed, 10 Sep 2008 14:32:35 +0000 Subject: [PATCH] Added {profile}.postinstall functionality. Idea is to generate image automatically, allowing user to install custom packages or change some files in the image during image generation phase, thus making image generation human-error prone. {profile}.postinstall script is run after all packages from $profile.pkglist are installed. This makes possible to do any kind of magic with the image. Example sles/compute.postinstall provided. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2119 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- xCAT-server/share/xcat/netboot/sles/genimage | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/xCAT-server/share/xcat/netboot/sles/genimage b/xCAT-server/share/xcat/netboot/sles/genimage index 53e979dd0..e875907f6 100755 --- a/xCAT-server/share/xcat/netboot/sles/genimage +++ b/xCAT-server/share/xcat/netboot/sles/genimage @@ -150,6 +150,16 @@ unless ($onlyinitrd) { postscripts(); #run 'postscripts' } unlink "/tmp/genimage.$$.yum.conf"; + +#-- run postinstall script +if (-x "$pathtofiles/$profile.postinstall") { + my $rc = system("$pathtofiles/$profile.postinstall","$installroot/netboot/$osver/$arch/$profile/rootimg",$osver,$arch,$profile); + if ($rc) { + print "postinstall script failed\n"; + exit 1; + } +} + mkinitrd(); sub getlibs {