(no commit message)
[ikiwiki.git] / docs / developer / HandyHints.mdwn
1 # Handy hints for DragonFly developers \r
2 \r
3 The following is a "cookbook", of sorts; a listing of common forms of commands for working with a DragonFly system, with brief descriptions of what they each do. They might prove useful to anyone who learns easily from examples. \r
4 \r
5 `Note`: These items are ported from the bsdinstaller wiki and are basically "a cheat sheet" for common commands. Feel free to add to this list. \r
6 \r
7 `Note`: A backslash at the end of a line indicates a wrapped line; there is no need to actually type it. \r
8 \r
9 `Note`: You can type your username instead of `whoami` where it appears in the following example (since your username is what `whoami` generates anyway.) \r
10 \r
11 Table of contents\r
12 [[!toc  levels=3]]\r
13 \r
14 \r
15 # CVS \r
16 See also: [[CVS]] \r
17 \r
18 To check out a copy of the DragonFly sources from your local CVS repository in /home/dcvs: \r
19     \r
20     cvs -d /home/dcvs update -Pd src\r
21 \r
22 or even better, create a ~/.cvsrc file with: \r
23     \r
24     cvs -q\r
25     diff -u\r
26     update -Pd\r
27     checkout -P\r
28     rtag -a\r
29 \r
30 To add a bunch of files to CVS at once: \r
31     \r
32     find . \! -path '*/CVS*' | xargs cvs add\r
33 \r
34 \r
35 To add a (simple, non-branch) tag to an entire module: \r
36     \r
37     cvs rtag THE_TAG_NAME the_module\r
38 \r
39 \r
40 To slip an existing tag to the HEAD revision of a specific file (be careful!): \r
41     \r
42     cvs tag -F THE_TAG_NAME the_file\r
43 \r
44 To completely remove a tag from a file (again, be careful!): \r
45     \r
46     cvs tag -d THE_TAG_NAME the_file\r
47 \r
48 \r
49 To perform a "repocopy" (which retains history,) in the repository directory on the server: \r
50     \r
51     cp -p file1,v file2,v\r
52 \r
53 \r
54 XXX add note that old tags need to be removed/renamed so that the newly copied file appears on other branches. \r
55 \r
56 # Leaf \r
57 \r
58 The following hints are intended to be used on the developer machine, leaf.dragonflybsd.org. Obviously, access to leaf requires a leaf account. \r
59 \r
60 `See also`: [[Volume 4: Resources for DragonFly BSD Developers]]\r
61 \r
62 `Note`: When connecting to leaf, be sure to use ssh -A to allow for ssh agent forwarding, so that commits to crater can be performed. \r
63 \r
64 To begin, you probably want a work area that looks like a root filesystem, and a directory that looks like a usr partition: \r
65     \r
66     setenv ROOT $HOME/root\r
67     mkdir -p $ROOT/usr && cd $ROOT/usr\r
68 \r
69 `Note`: You cannot use ~ as a shortcut for $HOME in the above. \r
70 \r
71 To check out DragonFly sources, read-only: \r
72     \r
73     cvs -R -d/cvs checkout -P src\r
74     cvs -d crater:/cvs commit\r
75 \r
76 To check out DragonFly sources, read/write: \r
77     \r
78     cvs -d crater:/cvs co src\r
79     cvs -d crater:/cvs commit\r
80 \r
81 To build world: \r
82     \r
83     setenv ME `id -nu`\r
84     setenv US `id -gn`\r
85     env - \\r
86         __MAKE_CONF=/dev/null \\r
87         MAKEOBJDIRPREFIX=$ROOT/usr/obj \\r
88         KERNCONFDIR=/where/you/keep/config/files \\r
89         KERNCONF=YOURCONFIG \\r
90       make buildworld buildkernel\r
91 \r
92 If KERNCONF and KERNCONFDIR are omitted, the GENERIC kernel will be used. \r
93 \r
94 To install world: \r
95     \r
96     env - \\r
97         __MAKE_CONF=/dev/null \\r
98         DESTDIR=$ROOT \\r
99         MAKEOBJDIRPREFIX=$ROOT/usr/obj \\r
100         KERNCONFDIR=/where/you/keep/config/files \\r
101         KERNCONF=YOURCONFIG \\r
102         INSTALL="sh `pwd`/tools/install.sh" \\r
103         BINOWN#$ME BINGRP$US SHAREOWN=$ME SHAREGRP=$US \\r
104       make installworld installkernel\r
105 \r
106 # Building Releases \r
107 \r
108 Note that each of these requires a copy of the DragonFly source tree checked out to /usr/src. Everything is done within /usr/src/nrelease, so first: \r
109     \r
110     cd /usr/src/nrelease\r
111 \r
112 \r
113 To fetch the needed packages for making a release: \r
114     \r
115     make fetchpkgs\r
116 \r
117 \r
118 To build a release: \r
119     \r
120     make release\r
121 \r
122 \r
123 If you have built world and kernel recently, you can build a release without rebuilding them: \r
124     \r
125     make realquickrel\r
126 \r
127 Versions of the above commands for building a release with the installer on it: \r
128     \r
129     make installer_fetchpkgs\r
130     make installer_release\r
131     make installer_realquickrel\r
132 \r
133 \r
134 To install additional packages on the release: \r
135     \r
136     make release EXTRA_PACKAGES="foo-1.0 bar-2.3e"\r
137 \r
138 \r
139 To install additional packages after a release has already been made, and regenerate the ISO: \r
140     \r
141     make pkgaddiso EXTRA_PACKAGES="foo-1.0 bar-2.3e" && make mkiso\r
142 \r
143 \r
144 To remove all packages from the release tree, and regenerate the ISO: \r
145     \r
146     make pkgcleaniso EXTRA_PACKAGES="'*'" && make mkiso\r
147 \r
148 \r
149 # Misc \r
150 \r
151 If you're building from CVS or working on pkgsrc ports, you will want debugging symbols in your DragonFly binaries and so libs. Set STRIP to an empty string in /etc/make.conf to prevent install(1) from stripping symbols at installation time.\r
152     \r
153     STRIP=***\r
154 \r
155 \r
156 To continue an interrupted buildworld without blowing away your progress so far: \r
157     \r
158     make buildworld -DNOCLEAN\r
159     make realquickworld -DNOCLEAN\r
160 \r
161 \r
162 To delete multiple files listed in a textfile: \r
163     \r
164     xargs rm -rf < README.DELETED\r
165 \r
166 \r
167 To delete from cvs multiple files listed in a textfile: \r
168     \r
169     xargs rm -rf < README.DELETED\r
170     xargs cvs rm -rf < README.DELETED\r
171 \r
172 \r
173 To preview a manual page without installing it: \r
174     \r
175     nroff -t -man foo.8 | more\r
176 \r
177 \r
178 # Booting options \r
179 \r
180 To boot with both serial and vga: (this is also known to boot with serial only on certain boards) \r
181     \r
182     boot -Dh\r
183 \r