-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgrade.html
576 lines (489 loc) · 24.1 KB
/
grade.html
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
<!DOCTYPE html>
<html>
<head>
<title>LFS Install Notes - Project Grade</title>
<meta charset="UTF-8">
<link type="text/css" rel="stylesheet" href="style.css" />
</head>
<body>
<article>
<header>
<h1>LFS Project Grade</h1>
<h2>Due: April 19<sup>th</sup></h2>
</header>
<section class="intro">
<p>Given all the work you have poured into your LFS and how
well you have done so far. I have decided to grade based on completing
various tasks. The tasks are designed to have you create a more and more
useful system. In other words, you will be graded based on getting a
working system together. Graduate students are, as always, expected to
preform at a higher level than undergraduates. This lead to two
rubrics based on your classification.</p>
</section>
<section>
<h2>Rubrics</h2>
<div style="width:90%;margin:auto">
<table>
<thead>
<tr>
<th colspan="2">Undergraduate Students (4360)</th>
</tr>
<tr>
<td>% Grade</td><td>What to do</td>
</tr>
</thead>
<tbody>
<tr>
<td class="center">70</td><td>Finish Chapter 7</td>
</tr>
<tr>
<td class="center">75</td><td>Finish Chapter 8</td>
</tr>
<tr>
<td class="center">80</td><td>Finish Chapter 9, i.e. system
boots</td>
</tr>
<tr>
<td class="center">90</td><td>Install Xorg</td>
</tr>
<tr>
<td class="center">95</td><td>Install Openbox Window Manager</td>
</tr>
<tr>
<td class="center">100</td><td>Install Firefox</td>
</tr>
</tbody>
</table>
<p></p>
<table>
<thead>
<tr>
<th colspan="2">Graduate Students (5397)</th>
</tr>
<tr>
<td>% Grade</td><td>What to do</td>
</tr>
</thead>
<tbody>
<tr>
<td class="center">60</td><td>Finish Chapter 9, i.e. system
boots</td>
</tr>
<tr>
<td class="center">70</td><td>Install Xorg</td>
</tr>
<tr>
<td class="center">75</td><td>Install Firefox</td>
</tr>
<tr>
<td class="center">85</td><td>Install A Desktop Environment</td>
</tr>
<tr>
<td class="center">100</td>
<td><a href="#fcs">Fully Customized System</a></td>
</tbody>
</table>
</div>
<p>These, these are up-or-down, all-or-nothing grades. Each level must be
completed successfully before you can move onto the next step.
However, unlike previous chapters I will not grade it
piecemeal. You will need to get as far as you can, and then I
will assign your grade. Further I will only grade it once, so you only
get one chance! Also, <strong>I will not accept the project
late</strong>.</p>
<p>Chapters seven through nine are not nearly as difficult as chapters
five and six. Chapter eight is the most difficult and finicky of the
three. I recommend you try your best to finish chapters 7–9
<strong>by Friday, March 14th</strong>. That will give you plenty of time
to work towards a higher grade.</p>
<p>Remember this project is worth <em>20%</em> of your final grade! It is
<strong>due on April 18th</strong>. There is no reason you
should not get a 100%.</p>
</section>
<section>
<h2>General Advice</h2>
<p>Below you will find some advice that will make your time in our very
limited environment much easier to deal with.</p>
<h3>Make Use of The Virtual Terminals</h3>
<p>Remember your system has several virtual terminals that can be accessed
via <kbd>Host-F*</kbd> (where <kbd>Host</kbd> is the host key used
by Virtualbox). I personally had one terminal for the batch build,
one for the web browser, and one for building dependencies.</p>
<h3>Using w3m</h3>
<p>The <code>w3m</code> is the only web browser available on our new
system. The <code>w3m</code> browser downloads files into the current
directory. So before running it, change to the
<span class="file">/sources</span> directory. Also, <code>w3m</code>
misinterprets patch files as plain text files that should be shown. So,
you will need to use the <em>Save Link</em> function in order to
download the patches. Below is a manual on how to use
<code>w3m</code>.</p>
<ul>
<li><a href="http://w3m.sourceforge.net/MANUAL">W3m's Manual</a></li>
<li><a href="w3m.html">Useful commands
you may not have gotten from the manual</a></li>
</ul>
<p>It can be difficult to read web pages in the <code>w3m</code> web
browser. I personally only used the browser for downloading and copy-paste
operations. I had a browser open in my host environment that I used to
actually read the book and these notes.</p>
<h3>Mouse Issues</h3>
<p>To use a mouse in a console only environment requires a special program
to interpret the signals sent by the mouse device. This special program
is called <code>gpm</code>. Unfortunately, <code>gpm</code> does not
correctly recognize our mouse leaving and/or entering the captured area
of the Virtualbox window. This means that your cursor quickly becomes out
of whack. To fix this you need to turn <q>Mouse Integration</q> off. To
do this press <kbd>Host-I</kbd>. You will now have to click in the window
for the mouse to be captured. To release the mouse from the window, simply
tap the <kbd>Host</kbd> key.</p>
<p>If you do not have a three button mouse, as is the case on most touch
pads, you can make <code>gpm</code> pretend your right mouse button is
the middle mouse button. Simply change the configuration file below:</p>
<pre class="edit"><span class="edit">/etc/sysconfig/mouse</span>
# Begin /etc/sysconfig/mouse
MDEVICE="/dev/input/mice"
PROTOCOL="imps2"
GPMOPTS="-B 132"
# End /etc/sysconfig/mouse</pre>
</section>
<p>If the mouse stops working issue this command to restart the daemon.</p>
<pre class="cmd">/etc/init.d/gpm restart</pre>
<section>
<h2>Creating The BLFS Environment</h2>
<p>Before doing anything from the <cite>Beyond Linux From Scratch</cite>
book you need to setup a little bit better environment. These
environmental changes are necessary to setup certain environment
variables and to get working boot scripts.</p>
<h3>Clean Up The System</h3>
<p>You do not have a lot of space on your hard-drive. So we need to get
rid of files we are no longer going to use. This will free almost 1.5GB of
space.
<p>Start by deleting the <span class="file">/tools</span> directory. This
directory contains the packages we installed in chapter five
which are no longer needed. We also need to clean out the
<span class="file">/sources</span> directory. Delete the
<strong>contents</strong> of the <span class="file">/sources</span>
directory (not the directory itself). We are still going to build
all the packages below in the <span class="file">/sources</span>
directory.</p>
<h3>Download The Book</h3>
<p>They sometimes update the book in March. This has caused students to
accidentally break their systems. To solve this download and unpack the book
in the root user's home directory. From then on you can use w3m to view the
various web pages in the book.</p>
<pre class="cmd">wget http://www.linuxfromscratch.org/blfs/downloads/7.4/blfs-book-7.4-html.tar.bz2
mkdir blfs
tar xf blfs-book*.tar.bz2 -C ~/blfs</pre>
<p>There is an error in the book. All of the URLs for the
<span class="file">*.patch</span> files are wrong. Needless to say this
makes downloading the patch files difficult. Run the following
mini-script to fix all of the URLs.</p>
<pre class="cmd">for d in ~/blfs/*/ ; do
sed -i 's|/patches/blfs/svn|/blfs/downloads/7.4/patches|g' $d/*.html
done</pre>
<p>Basically, the script goes through all of the HTML files and replaces
the incorrect URL path with the correct one. You will get two errors that
it could not find *.html files inside two of the directories, this is
fine.</p>
<h3>The Bash Shell Startup Files</h3>
<p>Before starting on the Xorg build, do the
<q>The Bash Shell Startup Files</q> section in chapter three of the
BLFS book. This step is necessary in order to setup some needed Xorg
build environment variables.</p>
<p style="text-align:center">
<a href="http://www.linuxfromscratch.org/blfs/view/7.4/postlfs/profile.html">
~/blfs/postlfs/profile.html
</a>
</p>
<p>At one point during this section they will have you create the
<span class="file">/etc/profile.d/i18n.sh</span> file. You will need to
specify your language setting. Our system uses <q>en_US.iso88591</q>.</p>
<p>You can also make your life easier by adding a these aliases. These
aliases allow you run the configure-make-make-install with only a few
keystrokes. Put them at the end of <span class="file">~/.bash_profile</span>
file.</p>
<pre class="cmd">
alias cmi='./configure --prefix=/usr --sysconfdir=/etc --disable-static && make && make install'
alias mi='make && make install'
alias xc='./configure $XORG_CONFIG'
alias xcmi='./configure $XORG_CONFIG && make && make install'
</pre>
<p>After completing this section log out then log back in. That way your
new settings will take effect.</p>
</section>
<section>
<h2>Xorg Notes</h2>
<p>Xorg is a software system and network protocol that provides a basis
for graphical user interfaces. Xorg must be installed from your LFS
system not the LiveCD. Basically, installing Xorg consists of following
the steps found in the Beyond LFS book. The basic system is much like
chapter six, except with a lot of downloading. You must install
Xorg-7.2, a.k.a <em>The X Window System</em>. <strong>Only do chapter
24</strong>, a link to this chapter can be found below. </p>
<p style="text-align:center">
<a href="http://www.linuxfromscratch.org/blfs/view/7.4//x/installing.html">
~/blfs/x/installing.html</a>
</p>
<p>When given a choice about what version of Python to install, choose
2.7.5. You will also need to install the optional animated png
functionality in
<span class="file">libpng</span> (required later by Firefox).</p>
<h3>Build Advice</h3>
<h4>Batch Builds</h4>
<p>Some of the Xorg builds can be done using a <em>batch</em> system.
These types of builds require you to create a md5sums file and use
<code>wget</code> to download the file. The BLFS book assumes you will
be building stuff as a non-root user. For us this just adds unneeded
complications. <strong>You do not need to install
<code>sudo</code>.</strong></p>
<p>Create the following function. It will allow you to use the directions
as is. The function basically just runs any commands given it. It only
exists so we do not need to alter the book's directions.</p>
<pre class="cmd">cat > /etc/profile.d/as_root.sh <<EOF
as_root() {
$*
}
export -f as_root
EOF</pre>
<h4>Required and Recommended Packages</h4>
<p>Xorg is dependent
on a lot of individual packages. The book lists out theses packages. They
come in three types.</p>
<ol>
<li><em>Optional.</em> These packages <strong>must be
ignored</strong>.</li>
<li><em>Required.</em> Without these packages you cannot succeed. So
they must be installed.</li>
<li><em>Recommended.</em> These packages are technically optional.
However, you will need to alter the build system if you do not
install them and some of the packages will not work as expected.
In other words, you <strong>must install these packages</strong>.</li>
</ol>
<p>You will have to drill down through the dependencies. Many packages
depend on other packages, which depend on yet more packages. These
packages are installed much the same way you installed the packages
in chapter six. However, you will have to download and install them
by hand. This is by far the most time consuming part of the build.
Frequently, a package depends on another package that you have already
installed. Be careful that you do not end up installing the same
package twice as it wastes time. I ended writing each package name down
on paper to make sure I did not do this.</p>
<h4>$XORG_PREFIX</h4>
<p>The introduction section will ask you to create a variable that
will hold the future installation directory. Be sure to specify
<span class="file">/usr</span> as the installation (prefix)
directory. Note, you only need to do about half the directions, the rest
are only applicable if you are installing Xorg somewhere besides
<span class="file">/usr</span>.</p>
<p>After finishing the introduction, be sure to log out and then log
back in so the variables will take effect.</p>
<h4>The Drivers Package</h4>
<p>You only need to install two of the available drivers: the
Evdev and the VESA drivers. The kernel options needed for these drivers
have already been enabled in chapter eight. Make sure you compile the
<span class="file">mtdev</span> package before making the Evdev driver.</p>
<h4>Perl Modules</h4>
<p>One module will be dependent on a Perl module having been installed.
Lucky for us the Perl language has it own built in package manager called
<code>cpan</code>. If you look at the bottom of the page in the section on
Perl modules, the book has a brief description on how to install a module
using <code>cpan</code>. I highly recommend you use this method to install
Perl modules because it calculates and installs dependencies for you.</p>
<h3>Build Time</h3>
<p>To install Xorg and all of its dependencies will take you a lot long
time. This is a really complex build. It took me six and a half hours to do
it. Take your time because it is really easy to forget to install one of
the dependencies.</p>
<h3>Testing Xorg</h3>
<p>At the end of the chapter, the book is going to have you test if you
installed Xorg correctly by issuing the command <code>startx</code>.
If it works it will automatically switch you to virtual terminal seven
and show you a black desktop with some <code>xterms</code> and a clock
running. This desktop by itself is really terrible. To exit the desktop
change back to the virtual terminal you issued <code>startx</code>
from and press <kbd>Ctrl-C</kbd>. Xorg hates being closed this way,
so it may print some errors, do not worry about them.</p>
<figure style="text-align:center">
<img src="img/startx.png">
<figcaption>startx</figcaption>
</figure>
<p>If your windows are arranged differently, or are overlapping do not worry
about it. It is not an error.</p>
</section>
<section>
<h2>OpenBox</h2>
<p>This build is fairly straight forward. Just follow the directions
outlined in the book, that is all you need to do. Remember to drill down
the through the dependencies. The pertinent section in the book is
below.</p>
<p style="text-align:center">
<a href="http://www.linuxfromscratch.org/blfs/view/7.4//x/openbox.html">
~/blfs/x/openbox.html</a>
</p>
<p>You can start programs by right-clicking on the desktop area. You will
immediately notice that the menu is bonkers. The menu is drawn based on
an XML file.</p>
<p>To fix the menu you will need to hand edit the XML file. The menu is in
<span class="file">/etc/xdg/openbox/menu.xml</span> file. If you are going
to install Firefox be sure to leave its entry in the menu.
<strong>Undergraduate students, this menu must be correct in order for
Openbox to count towards your grade.</strong></p>
<p>You can exit Xorg using the <q>Log Out</q> menu item. Below is a screen
shot of what the desktop looks like with the crazy menu.</p>
<figure>
<img src="img/openbox.png">
<figcaption>Openbox Desktop</figcaption>
</figure>
</section>
<section>
<h2>Firefox Web Browser</h2>
<h3>Build takes up too much space</h3>
<p>Last year we did this build and it only used up 3.5GB of space. But one
year latter, and the build will no longer fit on our 4GB build disk. We are
going to have to do something "clever" to fix this.</p>
<p>What you need to do is create a new hard-disk that is 10GB in size. Why
that number?
<a href="https://developer.mozilla.org/en-US/docs/Developer_Guide/Build_Instructions/Linux_Prerequisites">I
found some documentation that hints we need at least 8GB.</a> We are using an
inflated size as a cushion.</p>
<p>To create the disk and make it usable do the following:</p>
<ol>
<li>Turn off the VM. You can do this using the <code>halt</code>
command.</li>
<li>Open the settings dialog for your VM.</li>
<li>Select the storage pane. Click on the Controller SATA item and click
the Add Hard Disk button.</li>
<li>Click create new disk. Proceed through the dialog, just be sure to
make the drive's size equal to 10GB. If you are using a FAT32 formated
USB drive, save the VDI file onto the actual computer's hard drive.</li>
<li>Start your VM.</li>
<li>You new hard drive should be
<span class="file">/dev/sdc</span>. Partition the disk such that
the disk only has one big partition.</li>
<li>Create an ext4 filesystem on our new partition.</li>
<li>Mount the partition.
<pre class="cmd">mount -v -t ext4 /dev/sdc1 /mnt</pre></li>
</ol>
<p>Now instead of downloading and building in the
<span class="file">/sources</span> directory, build Firefox in the
<span class="file">/mnt</span> directory.
<p>I know this is a kludge. I did not discover this until you were
about to turn in chapter 4. So rather than have you redo chapters 1-4, I
created this work around.</p>
<h3>Build Advice</h3>
<p>To build this package simply follow the directions laid out in the BLFS
book. Unlike the Xorg build you need to <strong>skip the recommended
dependencies</strong> with one exception. The configure script has a bug
in it. To work around the bug you must install the optional
<span class="file">yasm</span> package. <em>You will still need to build the
recommended packages for Firefox's dependencies.</em></p>
<!--
<p>Building Firefox requires a lot of space (approximately 4GB). I,
therefore, recommend that you delete the contents of the
<span class="file">/sources</span> directory before building the Firefox
package. It also requires a ton of RAM. I, therefore, recommend you do not
do the build in a GUI environment.</p>
-->
<p>Be sure to carefully read the directions concerning the
<span class="file">mozconfig</span> file. This file will require editing.
Improperly editing this file is the number one reason the build fails.
Otherwise, just follow the directions in the book.</p>
<p style="text-align:center">
<a href="http://www.linuxfromscratch.org/blfs/view/7.4//xsoft/firefox.html">
~/blfs/xsoft/firefox.html
</a>
</p>
<p>The URL for downloading the Firefox tar-ball in the book is wrong. Mozilla
is in the middle of moving their primary server to a new URL.
The URL listed in the book refers to the old address. The URL below should
be the correct one.</p>
<p style="text-align:center">
<a href="http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/23.0.1/source/firefox-23.0.1.source.tar.bz2">
http://ftp.mozilla.org/pub/mozilla.org/firefox/releases/23.0.1/source/firefox-23.0.1.source.tar.bz2
</a>
</p>
</section>
<section>
<h2>Making A Complete Distro</h2>
<p><strong>This exercise is for graduate students only. Undergraduate students
should skip this section.</strong></p>
<p>Throughout the semester I have asked graduate students to perform
assignments that often require some level of
<q>research</q>. I do this because it simulates real life, where the solutions
to problems are not found in textbooks. In this case, you have to
use your ingenuity to install, properly configure, and use complex pieces of
software. The goal of this part of the project is for you to get a working
distro with a GUI interface.</p>
<p>You are free to choose any of the desktop environment's listed in the
BLFS book (KDE, Gnome, Xfce). You will need to figure out how to install
them on your own. Warning, Gnome is really hard to install, I would
recommend you install one of the other two.</p>
<p>I recommend that you install Openbox and Firefox before starting this
section. Firefox is required anyway. Desktop environments require the
installation of many packages. It is easier to navigate the book if you
looking at it in Firefox rather than w3m.</p>
<h3 id="fcs">Fully Customized System</h3>
<p>To qualify for the full 100% grade you have to make a <q>Fully Customized
System.</q> What does this mean? Your system will have to have the following
properties for a newly created user:
<ol>
<li>It boots directly the display manager, not the console.</li>
<li>A newly created user can log in.</li>
<li>The new user's desktop uses a non-default background.</li>
<li>The new user's desktop is completely configured with working icons.</li>
<li>The environment must have a text editor and a terminal emulator besides
<code>xterm</code>.</li>
</ol>
<h3>Known Issues</h3>
<p>These are known problems encountered by students as they were competing
this section of the build. They are listed here to help you avoid the pitfalls
other students fell into.</p>
<ul>
<li>Gnome3 will only be able to run in "fall back mode." The reason behind
this is that Gnome3 requires a hefty graphics card. We are forcing the
VM to use VESA graphics, which is the worst of the available
options. To get the kernel to recognize the fake VM graphics is very
difficult and well beyond the scope of the class. Just be aware you will not
be getting the <em>true</em> Gnome3 experience from you build.</li>
<li>If you install the NetworkManager package, you will need to disable
and remove all links to the <span class="file">/etc/init.d/network</span>
start up script we installed in chapter 7.</li>
<li>The current GDM package does not seem to work with Virtualbox.
This display manager is used by both Xfce and Gnome. Hence if you
are building either of these environments, you will need to install the
<a href="http://slim.berlios.de/">SLiM</a> display manager rather than
GDM. Read the <code>INSTALL</code> file that comes with SLiM in order
to figure out how to install it. You will need to make a custom SLiM init
script. An example script can be found on SLiM's website. You will, also,
need to create by hand the symbolic links in the proper run-level
directories. The website lists an alternative method to starting SLiM. Do
not try to use this alternate, initab, method to start SLiM, it will not
work properly.</li>
<li>If you install Xfce and no icons show up then you need to do the
following. First, you need to install <code>gnome-icon-theme</code>. This
will give you the correct icons. Now you need to tell Gtk and Xfce to use
your fancy new icon theme.
<pre class="cmd">cat > /etc/gtk-2.0/gtkrc << "EOF"
include "/usr/share/themes/Xfce/gtk-2.0/gtkr"
gtk-icon-theme-name = "hicolor"
EOF</pre>
<li>If you are installing KDE, despite what the directions say, you will
need to create the <span class="file">/etc/profile.d/kde.sh</span> script.
The script is found in the <em>KDE Pre-installation Configuration</em>
section. Be sure to change the value <code>$KDE_PREFIX</code> to
<span class="file">/usr</span>, not what it is in the section. Afterwards,
you need to create a new bash session so bash will execute the script.
Be sure to double check the value of <code>$KDE_PREFIX</code> in new
terminals.</li>
</ul>
</section>
</article>
<footer>
<a id="html" href="http://validator.w3.org/check?uri=referer"
target="_blank">[HTML 5]</a>
<a id="css" href="http://jigsaw.w3.org/css-validator/check/referer?profile=css3"
target="_blank">[CSS 3]</a>
</footer>
</body>
</html>