aboutsummaryrefslogtreecommitdiff
blob: 6966a214a35ce7fb329252952dc2d3415c630e12 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
# Eric Thibodeau
# Initial 01 Jul 2008
# Updated 17 Aug 2008
# Google Summer of Code 2008: Gentoo Clustering LiveCD

## The build environment ##

If you want to be able to create liveCDs with as little hassle as possible you will need the following:

	- The loop module, it's required for the licecd-stage2 creation of the kernel
		modprobe loop

	- dev-util/subversion
	- dev-util/git
    - dev-util/catalyst (am using CVS version which is close to 2.0.6)
        ** for some reason, catalyst won't create the skeleton dirs so here is the sequence to get you started

        emerge dev-util/catalyst
        mkdir -p /var/tmp/catalyst/ /var/tmp/catalyst/snapshots /var/tmp/catalyst/tmp/default
		# edit /etc/catalyst/catalystrc and add relevant options such as:
		export MAKEOPTS="-j6"
		export FEATURES="parallel-fetch"
		# You haev to set this here if you want to enable the pbs (torque) use flag for the clustering liveCD
		# the server's name is required at compile time (unfortunately) and this is the only way of overriding
		# the build host as becoming the one defined as the server.
		# This also FORCES the user to use this name as the master node...yerk, I know...
		export PBS_SERVER_NAME="master.gentoo.local"
		# you can set CFLAGS here but it's not recommended
		# NOTE, don't try to use distcc, it's broken, the distcc user is not being created in the catalyst build

    - http://sources.gentoo.org/viewcvs.py/releng/ pulled in as /var/svnroot/releng
        mkdir -p /var/svnroot/
        cd /var/svnroot/
        svn co svn://anonsvn.gentoo.org/releng

    - A recent snapshot (last one used was portage-20080806.tar.bz2), you have to modify the catalyst .spec files accordingly
        So get a snapshot and place it in /var/tmp/catalyst/snapshots (we are doing something evil here...):

        wget ftp://mirrors.tera-byte.com/pub/gentoo/snapshots/portage-20080806.tar.bz2 -O /var/tmp/catalyst/snapshots/portage-20080806.tar.bz2

	- A recent stage3, this eliminates many problems related to circular dependancies and collisions. We used drobbin's packages from funtoo.org
		mkdir -p /var/tmp/catalyst/builds/drobbins/
		cd /var/tmp/catalyst/builds/drobbins/
		wget http://www.funtoo.org/linux/amd64/funtoo-amd64-2008.06.27/stage3-amd64-2008.06.27.tar.bz2 

    - This git checked out into /var/git/:

        mkdir -p /var/git/
        cd /var/git/
        git clone git://git.overlays.gentoo.org/proj/clustering-livecd.git

    - The abovementionned snapshot suffers from the following bugs (whch have been fixed if you take something more recent):
		** This bug isn't going to be resolved any time soon:
		http://bugs.gentoo.org/show_bug.cgi?id=142637 "missing dependency in eutils.eclass"

		So you have to edit the openldap ebuild (currently the setup pulls in 2.4.10) and add DEPEND="sys-apps/shadow":
		
		vi /var/tmp/catalyst/snapshot_cache/20080629/portage/net-nds/openldap/openldap-2.4.10.ebuild
		ebuild /var/tmp/catalyst/snapshot_cache/20080629/portage/net-nds/openldap/openldap-2.4.10.ebuild digest

	- We also need (some) overlays:
		# NOTE!!! I set up my layman to put all files into /usr/local/portage/ (and not de thefault of /usr/portage/local)
		# If you don't like this, setup the .spec files accrodingly
		layman -a sunrise
		layman -a science

## Before you can build the LiveCD/DVD, you have to build the nfsroot which is to be included in the iso...so skip to the NFSroot-HOWTO and come back here when you're done ;)
	
## Actually building the CD ##

** NOTE: if you have lots of RAM: **
	You can build everything in RAM with no problems as long as tmpfs has at least 6Gigs (for the LiveCD stages)
	alias mnttmp='mount -t tmpfs -o size=6G,noatime catalystbuild /var/tmp/catalyst/tmp/default'
**

	# Barring the bugs 229103 and 206753, the following sequence should get you down to a LiveCD (haha...HAHA...HAHAHAHAHA)
	# These sequences are the ones I put in a script to whipe the slate clean and rebuild the environment 
	# Well, almost, I don't delete the packages dir except for some packages for which I often want to force a rebuild.

	# Stages 1 to 3
	cd clustering-livecd/catalyst/releases/2008.0/specs/amd64/
	for I in stage*
	do 
		mnttmp
		catalyst -f $I
		# we empty out stuff we don't need anymore ;)
		umount /var/tmp/catalyst/tmp/default
	done

	# Minimal CD:
	umount /var/git/clustering-livecd/catalyst/livecd/2008.0/overlay/tftproot/nfsroot/x86_64/
	umount /var/tmp/catalyst/tmp/default
	
	find /var/tmp/catalyst/packages/ -regextype posix-extended -regex '.*(beowulf|aufs|ldap-auth).*' -exec rm -f {} \;
	
	mount -t tmpfs -o size=7G,noatime catalystbuild /var/tmp/catalyst/tmp/default
	schedtool -B -n -4 -e catalyst -f /var/git/clustering-livecd/catalyst/nfsroot/2008.0/specs/amd64/nfsroot_stage4.spec
	schedtool -B -n -4 -e catalyst -f /var/git/clustering-livecd/catalyst/livecd/2008.0/specs/amd64/livecd-stage1-minimal.spec
	mount -o bind /var/tmp/catalyst/tmp/default/stage4-amd64-nfsroot-20080806/ /var/git/clustering-livecd/catalyst/livecd/2008.0/overlay/tftproot/nfsroot/x86_64/
	
	find /var/tmp/catalyst/packages/ -regextype posix-extended -regex '.*(beowulf|aufs|ldap-auth).*' -exec rm -f {} \;
	schedtool -B -n -4 -e catalyst -f /var/git/clustering-livecd/catalyst/livecd/2008.0/specs/amd64/livecd-stage2-minimal.spec


	# "Full" CD:
	Same as above but replace livecd-stage?-minimal.spec with livecd-stage?.spec
	
	# At the end, an iso image should be waiting for you as /tmp/livecd-amd64-installer-2008.0.iso ;)