FAI and non debian installs

Sylvain Milot sylvain at bic.mni.mcgill.ca
Tue Jun 17 19:20:41 CEST 2014


Hi Pete,

my nsfroot is squeeze, running fai 3.4.8 and a custom compiled kernel
(version 3.8.3). I can install squeeze, wheezy and ubuntu precise

to answer your specific question, this is how I do it ... see below ...


<snip>

> So, I've almost figured out how to do this, but I have stumbled across
> a situation that I'm not sure how to solve.
>
> The gist is:
>    A) hack config/basefiles/mk-basefile until it can produce (in my case)
>        trusty64.tar.xz because I want to install ubuntu 14.04.
>
> 	B) Fix my emitted classes to have TRUSTY64 instead of DEBIAN.
>
>    C) Fix/copy a pile of scripts (or other data files) in the config/
>        area to deal with trusty and not debian.
>
> 	D) Specify the trusty repos in $NFSROOT/etc/apt/sources.list
>
> But, I've run into an interesting problem.
>
> If I want half of a cluster to be debian wheezy, and the other half to
> be ubuntu14.04, how do I disambiguate the $NFSROOT/etc/apt/sources.list
> properly?

$ faiserver:/home/fai/config# ls -al basefiles
total 105076
drwxr-xr-x  2 fai  nogroup     4096 Jun  8 09:33 ./
drwxr-xr-x 11 fai  nogroup     4096 Jun 12 16:29 ../
-rw-r--r--  1 root root    51135461 May 16 11:33 PRECISE64.tar.gz
lrwxrwxrwx  1 root root          16 May 12 15:21 PRECISE.tar.gz -> PRECISE64.tar.gz
-rw-r--r--  1 root root    56331777 Jun  8 09:32 WHEEZY64.tar.gz
lrwxrwxrwx  1 root root          15 Jun  8 09:33 WHEEZY.tar.gz -> WHEEZY64.tar.gz

$ faiserver:/home/fai/config# find files/etc/apt/
files/etc/apt/
files/etc/apt/apt.conf
files/etc/apt/apt.conf/SQUEEZE
files/etc/apt/apt.conf/PRECISE
files/etc/apt/apt.conf/WHEEZY
files/etc/apt/sources.list
files/etc/apt/sources.list/SQUEEZE
files/etc/apt/sources.list/PRECISE
files/etc/apt/sources.list/WHEEZY
files/etc/apt/apt.conf.d
files/etc/apt/apt.conf.d/90fai
files/etc/apt/apt.conf.d/90fai/FAIINSTALL
files/etc/apt/apt.conf.d/10fai
files/etc/apt/apt.conf.d/10fai/FAIINSTALL
files/etc/apt/apt.conf.d/70debconf
files/etc/apt/apt.conf.d/70debconf/LINUX_BIC
files/etc/apt/apt.conf.d/20auto-upgrades
files/etc/apt/apt.conf.d/20auto-upgrades/PRECISE
files/etc/apt/apt.conf.d/50unattended-upgrades
files/etc/apt/apt.conf.d/50unattended-upgrades/PRECISE
files/etc/apt/trusted.gpg
files/etc/apt/trusted.gpg/SQUEEZE
files/etc/apt/trusted.gpg/PRECISE
files/etc/apt/trusted.gpg/WHEEZY
files/etc/apt/sources.list.d
files/etc/apt/sources.list.d/localmirror.list
files/etc/apt/sources.list.d/localmirror.list/SQUEEZE
files/etc/apt/sources.list.d/localmirror.list/PRECISE
files/etc/apt/sources.list.d/localmirror.list/WHEEZY
files/etc/apt/sources.list.d/localmirror-fai.list
files/etc/apt/sources.list.d/localmirror-fai.list/FAIINSTALLSQUEEZE
files/etc/apt/sources.list.d/localmirror-fai.list/FAIINSTALLPRECISE
files/etc/apt/sources.list.d/localmirror-fai.list/FAIINSTALLWHEEZY
files/etc/apt/sources.list.d/neurodebian.list
files/etc/apt/sources.list.d/neurodebian.list/SQUEEZE
files/etc/apt/sources.list.d/neurodebian.list/PRECISE
files/etc/apt/sources.list.d/neurodebian.list/WHEEZY
files/etc/apt/preferences
files/etc/apt/preferences/SQUEEZE
files/etc/apt/preferences/PRECISE
files/etc/apt/preferences/WHEEZY

To installl any system with either squeeze, wheezy or precise I use the fai-chboot ADDCLASSES feature,
hence I avoid fixing a *distribution* specific class in class/50-host-classes ...

$ faiserver:/home/fai/config# fai-chboot  -s-squeeze -v -I -f verbose,sshd,createvt -k "root=nfs:$faiserver:/export/home/fai/squeeze/nfsroot-amd64/live/filesystem.dir aufs ADDCLASSES=SQUEEZE" testsystem
$ faiserver:/home/fai/config# fai-chboot  -s-squeeze -v -I -f verbose,sshd,createvt -k "root=nfs:$faiserver:/export/home/fai/squeeze/nfsroot-amd64/live/filesystem.dir aufs ADDCLASSES=PRECISE" testsystem
$ faiserver:/home/fai/config# fai-chboot  -s-squeeze -v -I -f verbose,sshd,createvt -k "root=nfs:$faiserver:/export/home/fai/squeeze/nfsroot-amd64/live/filesystem.dir aufs ADDCLASSES=WHEEZY" testsystem

The following scripts are executed on the client ... as my config space is mounted on /fai on the clients
and changes are local to the client ...

$ faiserver:/home/fai/config# cat class/WHEEZY.var 
FAI_DEBMIRROR=mydebmirror:/debian/wheezy
FAI_ETC_DIR=/etc/fai-wheezy-amd64

# we have to copy the appropriate apt config

if [ -e /etc/apt ] ; then
     mv /etc/apt{,.tmp}
fi

fcopy -c WHEEZY,FAIINSTALL,FAIINSTALLWHEEZY -s /fai/files -t / -ir -M /etc/apt

$ faiserver:/home/fai/config# cat class/PRECISE.var 
FAI_DEBMIRROR=mydebmirror:/ubuntu
FAI_ETC_DIR=/etc/fai-precise-amd64

# we have to copy the appropriate apt config

if [ -e /etc/apt ] ; then
     mv /etc/apt{,.tmp}
fi

fcopy -c PRECISE,FAIINSTALL,FAIINSTALLPRECISE -s /fai/files -t / -ir -M /etc/apt

PS - I share a common config between my cfengine server and fai server - in fact I push
my cfengine config to the fai server automatically, while FAIINSTALL,FAIINSTALLWHEEZY
and FAIINSTALLSQUEEZE are fai specific classes.

HTH,

Viele Grüsse!

Sylvain

---
Sylvain Milot (sylvain at bic.mni.mcgill.ca)
               (sylvain.milot at mcgill.ca)
Brain Imaging Centre
Montreal Neurological Institute
3801 University Street
Webster 2B, Room 206
Montreal, Qc., Canada, H3A 2B4
Phone  : (514) 398-4965, Fax: 398-8948
Mobile : (514) 712-1768
Office : 527 Av Des Pins O., Room 104
          Montreal, Qc., H2W 1S4


More information about the linux-fai mailing list