Gentoo Archives: gentoo-releng

From: Daniel Robbins <drobbins@g.o>
To: gentoo-releng@l.g.o
Subject: [gentoo-releng] catalyst livecd instructions
Date: Sun, 11 Jan 2004 03:17:31
Message-Id: 1073791079.7513.197.camel@music.gentoo.org
1 Hi guys,
2
3 Here are some beta catalyst livecd instructions, so that you can start
4 playing with catalyst livecd support. The livecd-stage1 and
5 livecd-stage2 steps are already documented in the catalyst docs online
6 (http://www.gentoo.org/proj/en/releng/catalyst/) and the remaining steps
7 will be documented soon. Until then, this doc should
8 get you by.
9
10 Livecd building starts from a stage3, then goes to livecd-stage1,
11 livecd-stage2, livecd-stage3, and livecd-final. All these steps are
12 supported in catalyst except livecd-final, which isn't a big deal
13 because livecd-final is pretty trivial and can be done by hand.
14
15 livecd-stage1
16
17 Example: examples/livecd/x86/x86-livecd-stage1-20040110.spec
18 Livecd-stage1 starts from a stage3 and builds new packages, specified
19 using the "livecd-stage1/packages" variable in the spec file.
20 /etc/make.conf is set to contain the USE variables specified in the
21 "livecd-stage1/use" variable.
22
23 livecd-stage2
24
25 Example: examples/livecd/x86/x86-livecd-stage2-20040110.spec
26 Livecd-stage2 starts from livecd-stage1 and builds
27 kernel(s) and initrd(s) using genkernel, which get stored in tarballs
28 that are placed in
29 /var/tmp/catalyst/builds/<profile>/<target-subpath>/binaries/ inside
30 tarballs. Names for each kernel (such as "gentoo") are specified
31 in the "boot/kernel" variable in the spec file. For each entry in
32 "boot/kernel", you need a "boot/kernel/foo/sources" and
33 "boot/kernel/foo/config" option. Should be fairly self-explanatory.
34 Right now, genkernel gets the --no-bootsplash option and we don't
35 support passing any options to genkernel itself. This will be added when
36 we need it (soon.)
37
38 livecd-stage3
39
40 Example: examples/livecd/x86/x86-livecd-stage3-20040110.spec
41 Runscript: examples/livecd/runscript/x86-isolinux-loop-example.sh
42 cdtar: examples/livecd/cdtar/isolinux-2.08-cdtar.tar.bz2
43
44 livecd-stage3 is where the "guts" of livecd creation reside. There are
45 three parts to a livecd-stage3 -- the spec file, the runscript and the
46 cdtar. The spec file points to the runscript and cdtar by using the
47 "livecd-stage3/runscript" and "livecd-stage3/cdtar" variables
48 respectively. The cdtar for isolinux/x86 contains the following:
49
50 root@music cdtar # tar tjvf isolinux-2.08-cdtar.tar.bz2
51 drwxr-xr-x root/root 0 2004-01-08 18:20:41 ./
52 drwxr-xr-x root/root 0 2004-01-08 18:21:55 ./isolinux/
53 -rw-r--r-- root/root 9652 2004-01-08 18:21:55 ./isolinux/isolinux.bin
54
55 The purpose of the cdtar is to contain any pre-built binary things like
56 binary bootloaders. It will be extracted to the ISO tree root, so you
57 can also use it to create a skeleton directory tree if you want, or
58 include any pre-built files. However, it's not really designed to put
59 any "payload" such as stages or packages on the livecd -- this will be
60 handled by the livecd-final target when it's
61 complete.
62
63 Now take a look at the example livecd-stage3 spec file. You'll notice
64 several "trimming-down"-related variables that are used to trim down the
65 runtime image:
66
67 "livecd-stage3/unmerge" -- What packages to unmerge from the
68 livecd-stage2 to get it "prepped" for being on the livecd.
69
70 "livecd-stage3/empty" -- What directories should be wiped of any
71 contents. The directory itself will be kept, but its contents will be
72 totally wiped.
73
74 "livecd-stage3/rm" -- Files to remove from the runtime image. Globs are
75 supported, and what you specify will be passed to "rm -rf"
76
77 "livecd-stage3/prune" -- This is not supported yet (will be soon,) but
78 will allow directory trees to be emptied of everything *except* for
79 filesystem objects you specify.
80
81 Now take a look at the example runscript. You'll see that it is a
82 standard bash script that contains a large case statement. The purpose
83 of the runscript is to hold any steps related to "prepping" the runtime
84 image that cannot be performed in the spec file, and also handling
85 creation of a loopback filesystem, getting the kernels to the right
86 place on the iso root, creating any necessary bootloader config files
87 and also calling mkisofs for creating the ISO itself (this step will be
88 performed by the "livecd-final" target.)
89
90 So, the purpose of the runscript is to get all those "tweaks" needed to
91 create a livecd in one file.
92
93 Here is the order of steps performed in livecd-stage3 creation:
94
95 1. bind mounts are mounted inside the runtime chroot
96
97 2. The "run" target of the runscript executes
98
99 3. The "preclean" target of the runscript executes
100
101 4. The "livecd-stage3/unmerge" step is executed; packages are unmerged.
102
103 5. Bind mounts inside the runtime chroot are unmounted for safety
104 reasons
105
106 6. The "livecd-stage3/empty" step is executed; directory trees are
107 emptied.
108
109 7. The "livecd-stage3/delete" step is executed; files are deleted.
110
111 (livecd-stage3/prune will execute here once implemented)
112
113 8. The "clean" step of the runscript executes
114
115 9. The "cdroot_setup" step of the runscript executes, which creates (if
116 needed) a loopback filesystem, gets genkernel-created kernels in place,
117 etc.
118
119 Take a look at the example files, and I think you'll find that things
120 aren't too confusing.
121
122 Note: don't expect the examples to actually boot yet. I haven't tested
123 the isolinux.cfg nor the bootable runtime that currently gets created.
124 But we should be able to get it booting in a few days, and from this
125 point forward should have maintainable and easy-to-build livecds :)
126
127 Best Regards,
128
129 Daniel
130
131
132 --
133 gentoo-releng@g.o mailing list

Replies

Subject Author
Re: [gentoo-releng] catalyst livecd instructions Daniel Robbins <drobbins@g.o>