Re: sources.list per host

2006-06-21 Thread Michael Tautschnig
 Hi,
 
 I there a way to have a sources.list during the installation (and when 
 the system is installed) for some specific hosts.
 
 E.g. we have rolled our own multipath packages and I don't want to 
 include that repository on each machine.
 
 I could use a script that appends that repository and then do an update; 
 and install using that repository.
 
 But then I can't use the package_config/CLASS for adding software.
 
 An ideal way would be to be to say if class X is defined use 
 sources.list.X instead of sources.list.


Would it suffice if you fcopy'd sources.list at the right time? We're doing that
to some extend, using the hook updatebase.DEFAULT:

#!/bin/bash
if ! echo $classes | grep -q FAICD ; then
  fcopy -Bi /etc/apt/sources.list
fi

fcopy -Bi /etc/kernel-img.conf
fcopy -Bi /etc/apt/preferences

HTH,
Michael



signature.asc
Description: Digital signature


Re: sources.list per host

2006-06-21 Thread glaweh
On Wed, Jun 21, 2006 at 11:53:51AM +0200, Rudy Gevaert wrote:
 I there a way to have a sources.list during the installation (and when 
 the system is installed) for some specific hosts.
 
 E.g. we have rolled our own multipath packages and I don't want to 
 include that repository on each machine.
 
 I could use a script that appends that repository and then do an update; 
 and install using that repository.
 
 But then I can't use the package_config/CLASS for adding software.
 
 An ideal way would be to be to say if class X is defined use 
 sources.list.X instead of sources.list.
 
 Is there already away (or work arround) to achieve this?

use fcopy in a hook replacing the prepareapt task; I am using the following
file as $FAI/hooks/prepareapt.DEFAULT:
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
#!/bin/bash
# $Id: prepareapt.DEFAULT,v 1.1 2005/05/03 14:16:51 glaweh Exp $
# 
# HG: use fcopy for apt preparation
fcopy -i etc/{hosts,hostname,resolv.conf}
fcopy -ri etc/apt
fcopy -ri etc/dpkg
skiptask prepareapt
 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 

then you have to put your class-dependent sources.lists into
$FAI/files/etc/apt/sources.list/$CLASSNAME

(and if you want to use my hook verbatim, also the remaining files I fcopy
there).

-- 
c u
henning


signature.asc
Description: Digital signature


Re: sources.list per host

2006-06-21 Thread Rudy Gevaert

Michael Tautschnig wrote:



Would it suffice if you fcopy'd sources.list at the right time? We're doing that
to some extend, using the hook updatebase.DEFAULT:


Ah yes the hooks!

I tried putting a cfengine script as a hook but fai.log says:

Calling hook: updatebase.DEFAULT
oeral: (CFINPUTS is set to nothing)
oeral: Can't open file cfengine.conf
updatebase.DEFAULT   FAILED with exit code 1.

I think I should set some variables, or is it not possible to use 
cfengine here?


Thanks in advance,

Rudy


--
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
Rudy Gevaert  [EMAIL PROTECTED]  tel:+32 9 264 4734
Directie ICT, afd. Infrastructuur  Direction ICT, Infrastructure dept.
Groep Systemen Systems group
Universiteit Gent  Ghent University
Krijgslaan 281, gebouw S9, 9000 Gent, Belgie   www.UGent.be
-- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --


Re: sources.list per host

2006-06-21 Thread Michael Tautschnig
 Michael Tautschnig wrote:
 
 
 Would it suffice if you fcopy'd sources.list at the right time? We're 
 doing that
 to some extend, using the hook updatebase.DEFAULT:
 
 Ah yes the hooks!
 
 I tried putting a cfengine script as a hook but fai.log says:
 
 Calling hook: updatebase.DEFAULT
 oeral: (CFINPUTS is set to nothing)
 oeral: Can't open file cfengine.conf
 updatebase.DEFAULT   FAILED with exit code 1.
 
 I think I should set some variables, or is it not possible to use 
 cfengine here?


I've got no idea about cfengine, I'd use sed/awk/perl instead. Sorry...

Michael



signature.asc
Description: Digital signature