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");