1
<!-- retain these comments for translator revision tracking -->
2
<!-- original version: 28672 -->
5
<sect1 id="kernel-baking">
6
<!-- <title>Compiling a New Kernel</title> -->
7
<title>Compilazione di un nuovo kernel</title>
11
<!-- Why would someone want to compile a new kernel? It is often not
12
necessary since the default kernel shipped with Debian handles most
13
configurations. However, it is useful to compile a new kernel in order
16
Perché qualcuno dovrebbe compilarsi un nuovo kernel? Spesso non è
17
necessario dato che il kernel inserito in Debian gestisce la
18
maggior parte delle configurazioni. Comunque può essere utile compilare
19
un nuovo kernel per poter:
24
<!-- handle special hardware needs, or hardware conflicts with the pre-supplied
27
gestire hardware particolare o gestire conflitti hardware con kernel
33
<!-- handle hardware or options not included in the stock kernel, such as
36
gestire hardware o funzioni non incluse nel kernel normale, come APM
42
<!-- optimize the kernel by removing useless drivers to speed up boot
45
ottimizzare il kernel rimuovendo i driver inutili in modo da velocizzare
51
<!-- use options of the kernel which are not supported by the default
52
kernel (such as high memory support) -->
54
usare le opzioni del kernel che non sono supportate dal kernel
55
predefinito (come il supporto per la memoria alta)
60
<!-- run an updated or development kernel -->
62
usare un kernel aggiornato o di sviluppo
67
<!-- impress your friends, try new things -->
69
impressionare gli amici o per provare cose nuove
77
<!-- <title>Kernel Image Management</title> -->
78
<title>Gestione dell'immagine del kernel</title>
82
<!-- Don't be afraid to try compiling the kernel. It's fun and profitable. -->
84
Non ci si deve impaurire nel provare a compilare il kernel. È
89
<!-- To compile a kernel the Debian way, you need some packages:
90
<classname>kernel-package</classname>,
91
<classname>kernel-source-&kernelversion;</classname> (the most recent version
92
at the time of this writing), <classname>fakeroot</classname> and a
93
few others which are probably already installed (see
94
<filename>/usr/share/doc/kernel-package/README.gz</filename> for the
97
Per compilare il kernel con il metodo seguito da Debian sono necessari
98
alcuni pacchetti: <classname>kernel-package</classname>,
99
<classname>kernel-source-&kernelversion;</classname> (la versione più
100
recente al momento della scrittura), <classname>fakeroot</classname>
101
e pochi altri che probabilmente sono già installati (si consulti
102
<filename>/usr/share/doc/kernel-package/README.gz</filename> per
107
<!-- This method will make a .deb of your kernel source, and, if you have
108
non-standard modules, make a synchronized dependent .deb of those
109
too. It's a better way to manage kernel images;
110
<filename>/boot</filename> will hold the kernel, the System.map, and a
111
log of the active config file for the build. -->
113
Questo metodo crea un .deb dai sorgenti del kernel e, se si hanno dei
114
moduli non-standard, crea anche un .deb di questi moduli sincronizzato
115
con il precedente. Questo è il miglior modo di gestire le immagini del
116
kernel; in <filename>/boot</filename> vengono inseriti il kernel, il file
117
System.map e un log con le configurazioni attive durante la compilazione.
121
<!-- Note that you don't <emphasis>have</emphasis> to compile your kernel
122
the <quote>Debian way</quote>; but we find that using the packaging system
123
to manage your kernel is actually safer and easier. In fact, you can get
124
your kernel sources right from Linus instead of
125
<classname>kernel-source-&kernelversion;</classname>, yet still use the
126
<classname>kernel-package</classname> compilation method. -->
128
Notare che <emphasis>non</emphasis> è obbligatorio compilare il kernel
129
<quote>alla Debian</quote>; ma l'uso del sistema di pacchetti per gestire
130
il kernel è realmente più sicuro e più semplice. In pratica si possono
131
anche reperire i sorgenti del kernel direttamente da Linus anziché da
132
<classname>kernel-source-&kernelversion;</classname> e comunque usare il
133
metodo di compilazione con <classname>kernel-package</classname>.
137
<!-- Note that you'll find complete documentation on using
138
<classname>kernel-package</classname> under
139
<filename>/usr/share/doc/kernel-package</filename>. This section just
140
contains a brief tutorial. -->
142
Notare che è possibile trovare la documentazione completa sull'uso di
143
<classname>kernel-package</classname> in
144
<filename>/usr/share/doc/kernel-package</filename>. Questa sezione
145
contiene solo un breve manuale introduttivo.
149
<!-- Hereafter, we'll assume you have free rein over your machine and will
150
extract your kernel source to somewhere in your home directory<footnote> -->
152
D'ora in avanti si suppone che si abbia il controllo completo della
153
macchina e che i sorgenti del kernel siano da qualche parte all'interno
154
della propria home directory<footnote>
158
<!-- There are other locations where you can extract kernel sources and build
159
your custom kernel, but this is easiest as it does not require special
162
Ci sono molti altri posti in cui è possibile estrarre i sorgenti del
163
kernel e compilare un kernel personalizzato, ma è molto più semplice
164
se questa operazione non richiede dei permessi speciali.
168
<!-- </footnote>. We'll also assume that your kernel version is
169
&kernelversion;. Make sure you are in the directory to where you want to
170
unpack the kernel sources, extract them using <userinput>tar xjf
171
/usr/src/kernel-source-&kernelversion;.tar.bz2</userinput> and change
172
to the directory <filename>kernel-source-&kernelversion;</filename>
173
that will have been created. -->
175
</footnote>. Si suppone anche che la versione del kernel sia
176
&kernelversion;. Assicurarsi di trovarsi nella directory in cui si vuole
177
scompattare i sorgenti del kernel, estrarli usando <userinput>tar xjf
178
/usr/src/kernel-source-&kernelversion;.tar.bz2</userinput> e cambiare la
179
directory corrente in <filename>kernel-source-&kernelversion;</filename>
180
che è stata appena creata.
184
<!-- Now, you can configure your kernel. Run <userinput>make
185
xconfig</userinput> if X11 is installed, configured and being run; run
186
<userinput>make menuconfig</userinput> otherwise (you'll need
187
<classname>libncurses5-dev</classname> installed). Take the time to read
188
the online help and choose carefully. When in doubt, it is typically
189
better to include the device driver (the software which manages
190
hardware peripherals, such as Ethernet cards, SCSI controllers, and so
191
on) you are unsure about. Be careful: other options, not related to a
192
specific hardware, should be left at the default value if you do not
193
understand them. Do not forget to select <quote>Kernel module loader</quote>
194
in <quote>Loadable module support</quote> (it is not selected by default).
195
If not included, your Debian installation will experience problems. -->
197
Adesso si può configurare il kernel. Eseguire <userinput>make
198
xconfig</userinput> se X11 è installato, configurato e in esecuzione;
199
altrimenti eseguire <userinput>make menuconfig</userinput> (è necessario
200
che sia installato il pacchetto <classname>libncurses5-dev</classname>).
201
Prendersi tutto il tempo necessario per leggere l'aiuto in linea e
202
scegliere con attenzione; in caso di dubbi di solito è consigliabile
203
includere i driver dei dispositivi (il software che gestisce le
204
periferiche hardware come le schede Ethernet, i controller SCSI e così
205
via) se non si è sicuri. Attenzione: se non si capisce il significato
206
delle altre opzioni non legate a un hardware specifico si dovrebbero
207
lasciare al valore predefinito. Non ci si deve dimenticare di selezionare
208
<quote>Kernel module loader</quote> in <quote>Loadable module
209
support</quote> (normalmente non è selezionato), altrimenti il proprio
210
sistema Debian rischia di avere dei seri problemi.
214
<!-- Clean the source tree and reset the <classname>kernel-package</classname>
215
parameters. To do that, do <userinput>make-kpkg clean</userinput>. -->
217
Ripulire i sorgenti e ripristinare i parametri di
218
<classname>kernel-package</classname> usando <userinput>make-kpkg
223
<!-- Now, compile the kernel:
224
<userinput>fakeroot make-kpkg -revision=custom.1.0 kernel_image</userinput>.
225
The version number of <quote>1.0</quote> can be changed at will; this is just
226
a version number that you will use to track your kernel builds.
227
Likewise, you can put any word you like in place of <quote>custom</quote>
228
(e.g., a host name). Kernel compilation may take quite a while, depending on
229
the power of your machine. -->
231
Adesso compilare il kernel con: <userinput>fakeroot make-kpkg
232
--revision=custom.1.0 kernel_image</userinput>. Il numero di versione
233
<quote>1.0</quote> può essere cambiato secondo le necessità;
234
questo è semplicemente il numero di versione che si può usare per
235
tener traccia delle compilazioni del kernel. Allo stesso modo si può
236
inserire qualsiasi parola al posto di <quote>custom</quote> (p.e. il
237
nome dell'host). La compilazione del kernel richiede un po' di tempo,
238
in base alla potenza della macchina.
240
</para><para condition="supports-pcmcia">
242
<!-- If you require PCMCIA support, you'll also need to install the
243
<classname>pcmcia-source</classname> package. Unpack the gzipped tar file
244
as root in the directory <filename>/usr/src</filename> (it's important that
245
modules are found where they are expected to be found, namely,
246
<filename>/usr/src/modules</filename>). Then, as root, do <userinput>make-kpkg
247
modules_image</userinput>. -->
249
Se si ha bisogno del supporto PCMCIA è necessario installare il
250
pacchetto <classname>pcmcia-source</classname>. Estrarre il file tar
251
compresso con gzip nella directory <filename>/usr/src</filename> (è
252
importante che i moduli si trovino esattamente dove il sistema si
253
aspetta che siano, ovvero in <filename>/usr/src/modules</filename>).
254
Poi, da root, eseguire <userinput>make-kpkg modules_image</userinput>.
258
<!-- Once the compilation is complete, you can install your custom kernel
259
like any package. As root, do <userinput>dpkg -i
260
../kernel-image-&kernelversion;-<replaceable>subarchitecture</replaceable>_custom.1.0_&architecture;.deb</userinput>.
261
The <replaceable>subarchitecture</replaceable> part is an optional
263
<phrase arch="i386"> such as <quote>i586</quote>, </phrase>
264
depending on what kernel options you set.
265
<userinput>dpkg -i kernel-image...</userinput> will install the
266
kernel, along with some other nice supporting files. For instance,
267
the <filename>System.map</filename> will be properly installed
268
(helpful for debugging kernel problems), and
269
<filename>/boot/config-&kernelversion;</filename> will be installed,
270
containing your current configuration set. Your new
271
<classname>kernel-image-&kernelversion;</classname> package is also clever
272
enough to automatically use your platform's boot-loader to run an
273
update on the booting, allowing you to boot without re-running the
274
boot loader. If you have created a modules package, e.g., if you have
275
PCMCIA, you'll need to install that package as well. -->
277
Finita la compilazione è possibile installare il proprio kernel
278
personalizzato come qualsiasi altro pacchetto. Da root eseguire
279
<userinput>dpkg -i ../kernel-image-&kernelversion;-<replaceable>sottoarchitettura</replaceable>_custom.1.0_&architecture;.deb</userinput>.
280
La parte <replaceable>sottoarchitettura</replaceable> è opzionale e
281
indica la sottoarchitettura,
282
<phrase arch="i386"> per esempio <quote>i586</quote>, </phrase>
283
in base alle opzioni del kernel sono state attivate.
284
<userinput>dpkg -i kernel-image...</userinput> installa il kernel più
285
alcuni file di supporto. Per esempio sono installati i file
286
<filename>System.map</filename> (utile per il debug del kernel) e
287
<filename>/boot/config-&kernelversion;</filename> che contiene la
288
configurazione. Il nuovo pacchetto
289
<classname>kernel-image-&kernelversion;</classname> è anche in grado
290
di riconoscere, in base alla piattaforma, il bootloader ed eseguire
291
un aggiornamento in modo da poter riavviare la macchina senza dover
292
rieseguire il bootloader. Se si è creato anche un pacchetto con i
293
moduli, per esempio se si usa PCMCIA, è necessario installare anche
298
<!-- It is time to reboot the system: read carefully any warning that the
299
above step may have produced, then <userinput>shutdown -r now</userinput>. -->
301
Adesso si deve riavviare il sistema: leggere attentamente tutti gli
302
avvertimenti che potrebbero apparire durante il passo precedente e
303
poi eseguire <userinput>shutdown -r now</userinput>.
307
<!-- For more information on <classname>kernel-package</classname>,
308
read the fine documentation in
309
<filename>/usr/share/doc/kernel-package</filename>. -->
311
Per ulteriori informazioni su <classname>kernel-package</classname>
312
si consulti l'eccellente documentazione in
313
<filename>/usr/share/doc/kernel-package</filename>.