SMT repo add

Lets say you have built and setup your own SMT already... and you want to add some custom rpms.. well here it is:

mkdir -p /srv/www/htdocs/my-repo/rpm/{i686,x86_64,noarch}

copy some RPMs into the respective arch directories

cd /srv/www/htdocs/my-repo/rpm/
createrepo -o $PWD .
gpg --gen-key

after a while you will get something like "gpg: key AEEF1332 marked as ultimately trusted"

gpg -a --detach-sign --default-key AEEF1332 repodata/repomd.xml
gpg -a --export AEEF1332 > repodata/repomd.xml.key

Now the RPM repo is done and can be used with YaST/zypper... but why not add it automagicaly to the smt configuration....

Add it for SLES 10:

smt-setup-custom-repos $( for i in $( smt-list-products -f csv \
| egrep "SUSE-Linux-Enterprise-Server.*(i(.*)86|x86_64)" | cut -d, -f1 \
| sed 's,",,g' ); do echo -n "--productid $i "; done ) \
--name 'My-Repo' \
--description 'Custom RPMs not part of SLES10-11 (i586/x86_64)' \
--exturl 'http://url/my-repo'

Add it for SLES11:

smt-setup-custom-repos $( for i in $( smt-list-products -f csv \
| egrep "SUSE_SLES.*(i(.*)86|x86_64)" | cut -d, -f1 \
| sed 's,",,g' ); do echo -n "--productid $i "; done ) \
--name 'My-Repo' \
--description 'Custom RPMs not part of SLES10-11 (i586/x86_64)' \
--exturl 'http://url/my-repo'

Or for both:

smt-list-products -f csv | egrep "SUSE_SLES.*(i(.*)86|x86_64)" | cut -d, -f1 | sed 's,",,g' > both
smt-list-products -f csv | egrep "SUSE-Linux-Enterprise-Server.*(i(.*)86|x86_64)" | cut -d, -f1 | sed 's,",,g' >> both
smt-setup-custom-repos $( for i in $(cat both); do echo -n "--productid $i "; done ) \
--name 'My-Repo' \
--description 'Custom RPMs not part of SLES10-11 (i586/x86_64)' \
--exturl 'http://url/my-repo'
rm both


And presto!


Now, after smt-mirror has been executed the next time (either by yourself or via the predefined crontab entry), SMT is able to assign this repository to clients. While this isn’t completely true - SMT is able to assign this custom catalog before running smt-mirror, but it just doesn’t make sense, since it doesn’t contain any data - it still works.

Now, once you install the next SLES10/SLES11 (hopefully you enabled suseRegister, that actually gathers the channels), SMT will assign this “update channel”, on top of all the others, to your system.


Cheers to http://blog.barfoo.org/ for the info

:)

Popular Posts