posts:catalyst: Link to HOWTO commit and fix 'amd64' -> 'x86'
[blog.git] / posts / catalyst.mdwn
1 [[!template id=gitrepo repo=catalyst-swc]]
2
3 [Catalyst][] is a release-building tool for Gentoo.  If you use Gentoo
4 and want to roll your own live CD or bootable USB drive, this is the
5 way to go.  As I've been wrapping my head around catalyst, I've been
6 [pushing][catalyst-spec-mail] [my][catalyst-spec] [notes][howto-mail]
7 [upstream][howto].  This post builds on those notes to discuss the
8 construction of [a bootable ISO][iso] for [Software Carpentry][swc]
9 boot camps.
10
11 Getting a patched up catalyst
12 =============================
13
14 Catalyst has been around for a while, but the user base has been
15 fairly small.  If you try to do something that [Gentoo's Release
16 Engineering team][releng] doesn't do on a regular basis, built in
17 catalyst support can be spotty.  There's been a fair amount of patch
18 submissions an [gentoo-catalyst@][] recently, but patch acceptance can
19 be slow.  For the SWC ISO, I applied versions of the following patches
20 (or patch series) to [37540ff][]:
21
22 * [chmod +x all sh scripts so they can run from the git checkout][chmod]
23 * [livecdfs-update.sh: Set XSESSION in /etc/env.d/90xsession][90xsession]
24 * [Fix livecdfs-update.sh startx handling][startx]
25
26 Configuring catalyst
27 ====================
28
29 The easiest way to run catalyst from a Git checkout is to setup a
30 [local config file][config].  I didn't have enough hard drive space on
31 my local system (~16 GB) for this build, so I set things up in a
32 temporary directory on an external hard drive:
33
34     $ cat catalyst.conf | grep -v '^#\|^$'
35     digests="md5 sha1 sha512 whirlpool"
36     contents="auto"
37     distdir="/usr/portage/distfiles"
38     envscript="/etc/catalyst/catalystrc"
39     hash_function="crc32"
40     options="autoresume kerncache pkgcache seedcache snapcache"
41     portdir="/usr/portage"
42     sharedir="/home/wking/src/catalyst"
43     snapshot_cache="/mnt/d/tmp/catalyst/snapshot_cache"
44     storedir="/mnt/d/tmp/catalyst"
45
46 I used the default values for everything except `sharedir`,
47 `snapshot_cache`, and `storedir`.  Then I cloned the `catalyst-swc`
48 repository into `/mnt/d/tmp/catalyst`.
49
50 Portage snapshot and a seed stage
51 =================================
52
53 Take a snapshot of the current Portage tree:
54
55     # catalyst -c catalyst.conf --snapshot 20130208
56
57 Download a seed stage3 from a [Gentoo mirror][mirror]:
58
59     # wget -O /mnt/d/tmp/catalyst/builds/default/stage3-i686-20121213.tar.bz2 \
60     >   http://distfiles.gentoo.org/releases/x86/current-stage3/stage3-i686-20121213.tar.bz2
61
62 Building the live CD
63 ====================
64
65     # catalyst -c catalyst.conf -f /mnt/d/tmp/catalyst/spec/default-stage1-i686-2013.1.spec
66     # catalyst -c catalyst.conf -f /mnt/d/tmp/catalyst/spec/default-stage2-i686-2013.1.spec
67     # catalyst -c catalyst.conf -f /mnt/d/tmp/catalyst/spec/default-stage3-i686-2013.1.spec
68     # catalyst -c catalyst.conf -f /mnt/d/tmp/catalyst/spec/default-livecd-stage1-i686-2013.1.spec
69     # catalyst -c catalyst.conf -f /mnt/d/tmp/catalyst/spec/default-livecd-stage2-i686-2013.1.spec
70
71 isohybrid
72 =========
73
74 To make the ISO bootable from a USB drive, I used [isohybrid][]:
75
76     # cp swc-x86.iso swc-x86-isohybrid.iso
77     # isohybrid iso-x86-isohybrid.iso
78
79 You can install the resulting ISO on a USB drive with:
80
81     # dd if=iso-x86-isohybrid.iso of=/dev/sdX
82
83 replacing replacing `X` with the appropriate drive letter for your USB
84 drive.
85
86 With versions of catalyst after [d1c2ba9][], the `isohybrid` call is
87 built into catalysts ISO construction.
88
89 [Catalyst]: http://www.gentoo.org/proj/en/releng/catalyst/
90 [catalyst-spec-mail]:http://thread.gmane.org/gmane.linux.gentoo.catalyst/2006
91 [catalyst-spec]: http://git.overlays.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=0a99c494d4602ebb92f6d352f86ec519903fdc88
92 [howto-mail]: http://thread.gmane.org/gmane.linux.gentoo.catalyst/2107
93 [howto]: http://git.overlays.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=b7f2cf0f4c34af8d2dd9dcfa186930c17323e298
94 [iso]: http://lists.software-carpentry.org/pipermail/discuss-software-carpentry.org/2013-March/000210.html
95 [swc]: http://software-carpentry.org/
96 [releng]: http://www.gentoo.org/proj/en/releng/
97 [gentoo-catalyst@]: http://www.gentoo.org/main/en/lists.xml#doc_chap1_sect2
98 [37540ff]: http://git.overlays.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=37540ff5e9db28e65a4f55b71c16cec1e7d294ec
99 [chmod]: http://thread.gmane.org/gmane.linux.gentoo.catalyst/2085/focus=2093
100 [90xsession]: http://thread.gmane.org/gmane.linux.gentoo.catalyst/2182
101 [startx]: http://thread.gmane.org/gmane.linux.gentoo.catalyst/2187/focus=2191
102 [config]: http://article.gmane.org/gmane.linux.gentoo.catalyst/2111
103 [mirror]: http://www.gentoo.org/main/en/mirrors.xml
104 [isohybrid]: http://www.syslinux.org/wiki/index.php/Doc/isolinux#HYBRID_CD-ROM.2FHARD_DISK_MODE
105 [d1c2ba9]: http://git.overlays.gentoo.org/gitweb/?p=proj/catalyst.git;a=commit;h=d1c2ba9bdaf1a69078fcbcd6ec4210e829f99f0a
106
107 [[!tag tags/tools]]
108 [[!tag tags/teaching]]