From d138e1855590b87fa7a9927f11857391f7a54a91 Mon Sep 17 00:00:00 2001 From: sikorsky Date: Wed, 10 Sep 2008 14:38:27 +0000 Subject: [PATCH] Added {profile}.repolist functionality. {profile}.repolist contains list of custom repositories (directory with rpms). Repositories will be added to the image before package installation. This makes possible to automatically install (by defining in {profile}.pkglist) packages that are not contained in standard distribution repository. Example sles/compute.repolist provided. git-svn-id: https://svn.code.sf.net/p/xcat/code/xcat-core/trunk@2120 8638fb3e-16cb-4fca-ae20-7b5d299a9bcd --- .../share/xcat/netboot/sles/compute.repolist | 10 ++++++++++ xCAT-server/share/xcat/netboot/sles/genimage | 13 +++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 xCAT-server/share/xcat/netboot/sles/compute.repolist diff --git a/xCAT-server/share/xcat/netboot/sles/compute.repolist b/xCAT-server/share/xcat/netboot/sles/compute.repolist new file mode 100644 index 000000000..e0426aecd --- /dev/null +++ b/xCAT-server/share/xcat/netboot/sles/compute.repolist @@ -0,0 +1,10 @@ +#-- +#-- This file contains list of custom repositories (directory with rpms). +#-- Repositories will be added to the image before package installation. +#-- This makes possible to automatically install (by defining in {profile}.pkglist) +#-- packages that are not contained in standard distribution repository +#-- +#-- File format: +#Type|URL|name +#-- example: +#Plaindir|file:/install/sles10sp2/x86_64/custom|custom diff --git a/xCAT-server/share/xcat/netboot/sles/genimage b/xCAT-server/share/xcat/netboot/sles/genimage index e875907f6..515d8d904 100755 --- a/xCAT-server/share/xcat/netboot/sles/genimage +++ b/xCAT-server/share/xcat/netboot/sles/genimage @@ -110,6 +110,19 @@ unless ($onlyinitrd) { system("zypper -R $installroot/netboot/$osver/$arch/$profile/rootimg/ sa file:$srcdir_otherpkgs"); } + #-- add custom repositories to the image + if (-r "$pathtofiles/$profile.repolist") { + $repolist = "$pathtofiles/$profile.repolist"; + print "Reading custom repositories\n"; + open($repoconfig,"<","$repolist"); + while (<$repoconfig>) { + chomp; + next if /^\s*#/; + ($repotype,$repourl,$repoalias) = split m/\|/; + system("zypper -R $installroot/netboot/$osver/$arch/$profile/rootimg/ sa -t $repotype $repourl $repoalias"); + } + } + #my $yumcmd = "yum -y -c /tmp/genimage.$$.yum.conf --installroot=$installroot/netboot/$osver/$arch/$profile/rootimg/ --disablerepo=* "; #$yumcmd .= "install "; #mkpath("$installroot/netboot/$osver/$arch/$profile/rootimg/var/lib/yum");