aboutsummaryrefslogtreecommitdiff
path: root/pt_BR.ISO8859-1/articles/freebsd-update-server/article.xml
blob: f4e2b3620ee7a6a37cac1444d81e0d748c15f065 (plain) (blame)
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
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE article PUBLIC "-//FreeBSD//DTD DocBook XML V5.0-Based Extension//EN"
	"http://www.FreeBSD.org/XML/share/xml/freebsd50.dtd" [
<!ENTITY fbus.ap "<application xmlns='http://docbook.org/ns/docbook'>Servidor de Atualizao do FreeBSD</application>">
]>
<!--
  The FreeBSD Documentation Project
  The FreeBSD Brazilian Portuguese Documentation Project

  Original revision: r41162
-->
<article xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" version="5.0" xml:lang="pt_br">
  <info><title>Construa Seu Prprio Servidor de Atualizao do &os;</title>
    

    <author><personname><firstname>Jason</firstname><surname>Helfman</surname></personname><affiliation>
	<address>&a.jgh;</address>
      </affiliation></author>

    <copyright>
      <year>2009</year>
      <year>2010</year>
      <year>2011</year>
      <year>2013</year>
      <holder role="mailto:jgh@FreeBSD.org">Jason Helfman</holder>
    </copyright>

    <legalnotice xml:id="trademarks" role="trademarks">
      &tm-attrib.freebsd;
      &tm-attrib.general;
      &tm-attrib.intel;
      &tm-attrib.amd;
    </legalnotice>

    <pubdate>$FreeBSD$</pubdate>

    <releaseinfo>$FreeBSD$</releaseinfo>

  <abstract>
    <para>Este artigo descreve como construir um &fbus.ap; para uso
      interno na sua organizao.  O software <link xlink:href="http://svnweb.freebsd.org/base/user/cperciva/freebsd-update-build/">freebsd-update-server</link>
      foi escrito pelo &a.cperciva;, Chefe de Segurana emrito do
      &os;.  Para usurios que acreditam que  conveniente atualizar
      seus sistemas a partir de um servidor oficial de atualizao,
      construir o seu prprio &fbus.ap; pode ajud-lo a estender suas
      funcionalidades, seja por adicionar suporte a verses 
      customizadas do &os; ou por viabilizar a criao de um servidor
      local o qual permitir atualizaes mais rpidas caso voc 
      possua muitos servidores para atualizar.</para>
  </abstract>
  </info>

  <sect1 xml:id="acknowledgments">
    <title>Agradecimentos</title>
      <para>Este artigo posteriormente impresso na <link xlink:href="http://bsdmag.org/magazine/1021-bsd-as-a-desktop">BSD
	Magazine</link>.</para>
  </sect1>

  <sect1 xml:id="introduction">
    <title>Introduo</title>

    <para>Usurios experientes ou administradores so frequentemente
      responsveis por diversas mquinas ou ambientes.  Eles entendem
      as dificuldades e os desafios de manter tal estrutura.  A
      utilizao de um &fbus.ap; torna mais fcil a tarefa de 
      implantar patches de segurana e de softwares nas mquinas 
      selecionadas para test-los antes proceder com o seu deploy no 
      ambiente de produo.  Isto tambm significa que seus servidores
      podero ser atualizados a partir da rede local em vez de 
      utilizarem sua conexo de internet, o que torna o processo muito
      mais rpido.  Este artigo descreve as etapas envolvidas na 
      criao de um &fbus.ap; para uso interno.</para>
  </sect1>

  <sect1 xml:id="prerequisites">
    <title>Pr-Requisitos</title>

    <para>Para construir o seu &fbus.ap; alguns requisitos devem ser
      cumpridos.</para>

    <itemizedlist>
      <listitem>
	<para>Estar executando o &os;.</para>

	<note>
	  <para>No mnimo, as atualizaes precisam ser compiladas em
	    uma verso do &os; maior ou igual a verso alvo a ser
	    distribuda.</para>
	</note>
      </listitem>

      <listitem>
        <para>Ter acesso a uma conta de usurio com no mnimo 
	  4&nbsp;GB de espao livre.  Isto permite a criao de 
	  atualizaes para as verses 7.1 e 7.2, mas o espao exato 
	  requerido pode mudar de verso para verso.</para>
      </listitem>

      <listitem>
        <para>Ter acesso a uma conta &man.ssh.1; em uma mquina 
	  remota para enviar as atualizaes a serem 
	  distribudas.</para>
      </listitem>

      <listitem>
	<para>Possuir um servidor web, como <link xlink:href="&url.books.handbook;/network-apache.html">Apache</link>,
          com mais da metade do espao necessrio para a compialao.
	  Por exemplo, compilaes testes para 7.1 e 7.2 consomem um
	  espao total de 4&nbsp;GB, e usam 2.6&nbsp;GB para
	  distribuir essas atualizaes.</para>
      </listitem>

      <listitem>
        <para>Ter conhecimento bsico de shell script com o Bourne 
	  shell, &man.sh.1;</para>
      </listitem>
    </itemizedlist>
  </sect1>

  <sect1 xml:id="Configuration">
    <title>Instalao &amp; Configurao</title>

    <para>Para efetuar o download do software <link xlink:href="http://svnweb.freebsd.org/base/user/cperciva/freebsd-update-build/">freebsd-update-server</link>
      instale o <package>devel/subversion</package> e
      execute:</para>

      <screen>&prompt.user; <userinput>svn co http://svn.freebsd.org/base/user/cperciva/freebsd-update-build freebsd-update-server</userinput></screen>
      
    <para>Atualize o <filename>scripts/build.conf</filename> de forma
      adequada.  Ele  usado durante as operaes de
      compilao.</para>

    <para>Aqui est o <filename>build.conf</filename> padro, que
      dever ser modificado para se adequar ao seu ambiente.</para>

    <informalexample>
      <programlisting>

# Main configuration file for FreeBSD Update builds.  The
# release-specific configuration data is lower down in
# the scripts tree.

# Location from which to fetch releases
export FTP=ftp://ftp2.freebsd.org/pub/FreeBSD/releases<co xml:id="ftp-id"/>

# Host platform
export HOSTPLATFORM=`uname -m`

# Host name to use inside jails
export BUILDHOSTNAME=${HOSTPLATFORM}-builder.daemonology.net<co xml:id="buildhost-id"/>

# Location of SSH key
export SSHKEY=/root/.ssh/id_dsa<co xml:id="sshkey-id"/>

# SSH account into which files are uploaded
MASTERACCT=builder@wadham.daemonology.net<co xml:id="mstacct-id"/>

# Directory into which files are uploaded
MASTERDIR=update-master.freebsd.org<co xml:id="mstdir-id"/></programlisting>
    </informalexample>

    <para>Parmentros que devem ser considerados:</para>

    <calloutlist>
      <callout arearefs="ftp-id">
        <para>Este  o local de onde sero feitos os downloads das
	  imagens ISO (pela sub-rotina <function>fetchiso()</function>
	  do <filename>scripts/build.subr</filename>).  O local a ser
	  configurado no  limitado a URIs de FTP.  Qualquer URI
	  suportada pela ferramenta &man.fetch.1; pode ser
	  usada.</para>

        <para>Customizaes do cdigo da
          <function>fetchiso()</function> podem ser feitas copiando
          o script padro <filename>build.subr</filename> para o
          local da sua verso e arquitetura especfica
          <filename>scripts/RELEASE/ARCHITECTURE/build.subr</filename> e
          alterando o arquivo.</para>
      </callout>

      <callout arearefs="buildhost-id">
        <para>O nome do computador que far a compilao.  Esta
	  informao ser exibida durante a atualizao dos
	  sistemas:</para>

        <screen>&prompt.user; <userinput>uname -v</userinput></screen>
      </callout>

      <callout arearefs="sshkey-id">
        <para>A chave <application>SSH</application> para enviar os
	  arquivos para o servidor de atualizao.  O par de chaves
	  pode ser criado digitando <command>ssh-keygen -t
	  dsa</command>.  Este parmetro  opcional; a autenticao
	  por senha ser usada como mtodo de autenticao quando a
	  varivel <literal>SSHKEY</literal> no estiver
	  definida.</para>

        <para>A pgina do manual &man.ssh-keygen.1; tem informaes
	  mais detalhadas sobre o <application>SSH</application> e os
	  passos apropriados para criar e usar chaves.</para>
      </callout>

      <callout arearefs="mstacct-id">
        <para>Conta para enviar os arquivos para o servidor de
	  atualizao.</para>
      </callout>

      <callout arearefs="mstdir-id">
        <para>Diretrio do servidor de atualizao para o qual os 
	  arquivos sero enviados.</para>
      </callout>
    </calloutlist>

    <para>O arquivo <filename>build.conf</filename> padro, distribudo
      com o fonte do <application>freebsd-update-server</application>,
      est preparado para compilar a verso &arch.i386; do &os;.
      A titulo de exemplo sobre como compilar um servidor de 
      atualizao para outras arquiteturas, as seguintes modificaes
      so necessrias para a arquitetura &arch.amd64;:</para>

    <procedure>
      <step>
	<para>Crie um ambiente de compilao para o
	  &arch.amd64;:</para>

	<informalexample>
	  <screen>&prompt.user; <userinput>mkdir -p /usr/local/freebsd-update-server/scripts/7.2-RELEASE/amd64</userinput></screen>
	</informalexample>
      </step>

      <step>
        <para>Copie o arquivo <filename>build.conf</filename> para o
	  diretrio recm criado.  As configuraes de compilao para
	  o &os; 7.2-RELEASE na arquitetura &arch.amd64; devem ser
	  similares a:</para>

	<informalexample>
	<programlisting># SHA256 hash of RELEASE disc1.iso image.
export RELH=1ea1f6f652d7c5f5eab7ef9f8edbed50cb664b08ed761850f95f48e86cc71ef5<co xml:id="sha256-id"/>

# Components of the world, source, and kernels
export WORLDPARTS="base catpages dict doc games info manpages proflibs lib32"
export SOURCEPARTS="base bin contrib crypto etc games gnu include krb5  \
                lib libexec release rescue sbin secure share sys tools  \
                ubin usbin cddl"
export KERNELPARTS="generic"

# EOL date
export EOL=1275289200<co xml:id="eol-id"/></programlisting>
	</informalexample>

	<calloutlist>
	  <callout arearefs="sha256-id">
            <para>A chave hash &man.sha256.1; da verso desejada, 
	      ela  publicada no <link xlink:href="&url.base;/releases/">anncio da verso</link>.</para>
	  </callout>

	  <callout arearefs="eol-id">
            <para>Para gerar o nmero "End of Life" (Fim da Vida) para
	      o <filename>build.conf</filename>, consulte a informao
	      sobre o "Estimated EOL" publicada no <link xlink:href="&url.base;/security/security.html">Site de 
	      Segurana do &os;</link>.  O valor do
	      <literal>EOL</literal> pode ser derivado a partir da 
	      data listada no site, usando a ferramenta &man.date.1;,
	      por exemplo:</para>
            <screen>&prompt.user; <userinput>date -j -f '%Y%m%d-%H%M%S' '20090401-000000' '+%s'</userinput></screen>
	  </callout>
	</calloutlist>
      </step>
    </procedure>
  </sect1>

  <sect1 xml:id="build">
    <title>Preparando a atualizao</title>

    <para>O primeiro passo  executar o
      <filename>scripts/make.sh</filename>.  Isto ir compilar alguns
      binrios, criar diretrios, e gerar uma chave de assinatura
      RSA usada para aprovar as compilaes.  Neste passo, uma senha
      dever ser fornecida para terminar a criao da chave de
      assinatura.</para>

    <screen>&prompt.root; <userinput>sh scripts/make.sh</userinput>
cc -O2 -fno-strict-aliasing -pipe   findstamps.c  -o findstamps
findstamps.c: In function 'usage':
findstamps.c:45: warning: incompatible implicit declaration of built-in function 'exit'
cc -O2 -fno-strict-aliasing -pipe   unstamp.c  -o unstamp
install findstamps ../bin
install unstamp ../bin
rm -f findstamps unstamp
Generating RSA private key, 4096 bit long modulus
................................................................................++
...................++
e is 65537 (0x10001)

Public key fingerprint:
27ef53e48dc869eea6c3136091cc6ab8589f967559824779e855d58a2294de9e

Encrypting signing key for root
enter aes-256-cbc encryption password:
Verifying - enter aes-256-cbc encryption password:</screen>

    <note>
      <para>Anote a impresso digital (fingerprint) da chave gerada.  
	Ela  necessria no
        <filename>/etc/freebsd-update.conf</filename> para as
        atualizaes de binrios.</para>
    </note>

    <para>Neste ponto, ns estamos prontos para a etapa de
      compilao.</para>

    <informalexample>
      <screen>&prompt.root; <userinput>cd /usr/local/freebsd-update-server</userinput>
&prompt.root; <userinput>sh scripts/init.sh amd64 7.2-RELEASE</userinput></screen>
    </informalexample>

    <para>A seguir est um exemplo de uma execuo
      <emphasis>inicial</emphasis>.</para>

    <screen>&prompt.root; <userinput>sh scripts/init.sh amd64 7.2-RELEASE</userinput>
Mon Aug 24 16:04:36 PDT 2009 Starting fetch for FreeBSD/amd64 7.2-RELEASE
/usr/local/freebsd-update-server/work/7.2-RELE100% of  588 MB  359 kBps 00m00s
Mon Aug 24 16:32:38 PDT 2009 Verifying disc1 hash for FreeBSD/amd64 7.2-RELEASE
Mon Aug 24 16:32:44 PDT 2009 Extracting components for FreeBSD/amd64 7.2-RELEASE
Mon Aug 24 16:34:05 PDT 2009 Constructing world+src image for FreeBSD/amd64 7.2-RELEASE
Mon Aug 24 16:35:57 PDT 2009 Extracting world+src for FreeBSD/amd64 7.2-RELEASE
Mon Aug 24 23:36:24 UTC 2009 Building world for FreeBSD/amd64 7.2-RELEASE
Tue Aug 25 00:31:29 UTC 2009 Distributing world for FreeBSD/amd64 7.2-RELEASE
Tue Aug 25 00:32:36 UTC 2009 Building and distributing kernels for FreeBSD/amd64 7.2-RELEASE
Tue Aug 25 00:44:44 UTC 2009 Constructing world components for FreeBSD/amd64 7.2-RELEASE
Tue Aug 25 00:44:56 UTC 2009 Distributing source for FreeBSD/amd64 7.2-RELEASE
Mon Aug 24 17:46:18 PDT 2009 Moving components into staging area for FreeBSD/amd64 7.2-RELEASE
Mon Aug 24 17:46:33 PDT 2009 Identifying extra documentation for FreeBSD/amd64 7.2-RELEASE
Mon Aug 24 17:47:13 PDT 2009 Extracting extra docs for FreeBSD/amd64 7.2-RELEASE
Mon Aug 24 17:47:18 PDT 2009 Indexing release for FreeBSD/amd64 7.2-RELEASE
Mon Aug 24 17:50:44 PDT 2009 Indexing world0 for FreeBSD/amd64 7.2-RELEASE

Files built but not released:
Files released but not built:
Files which differ by more than contents:
Files which differ between release and build:
kernel|generic|/GENERIC/hptrr.ko
kernel|generic|/GENERIC/kernel
src|sys|/sys/conf/newvers.sh
world|base|/boot/loader
world|base|/boot/pxeboot
world|base|/etc/mail/freebsd.cf
world|base|/etc/mail/freebsd.submit.cf
world|base|/etc/mail/sendmail.cf
world|base|/etc/mail/submit.cf
world|base|/lib/libcrypto.so.5
world|base|/usr/bin/ntpq
world|base|/usr/lib/libalias.a
world|base|/usr/lib/libalias_cuseeme.a
world|base|/usr/lib/libalias_dummy.a
world|base|/usr/lib/libalias_ftp.a
...</screen>

    <para>Em seguida, a compilao da base do sistema ser feita 
      novamente, com os patches.  Uma explicao mais detalhada pode 
      ser encontrada em <filename>scripts/build.subr</filename>.</para>

    <warning>
      <para>Durante a segunda compilao, o servio de network time
        protocol, &man.ntpd.8; ser desligado.  De acordo com 
	&a.cperciva;, Chefe de Segurana emrito do &os;, "o <link xlink:href="http://svnweb.freebsd.org/base/user/cperciva/freebsd-update-build/">freebsd-update-server</link>
	compila cdigos necessrios para identificar os
	<literal>timestamps</literal>, os quais so armazenadas em 
	arquivos, de modo que estes ltimos podem ser ignorados quando
	estivermos comparando compilaes diferentes para determinar 
	quais arquivos precisam ser atualizados.  Esta procura por
	<literal>timestamp</literal> funciona realizando duas
	compilaes separadas por 400 dias e comparando os
	resultados."</para>
    </warning>

    <screen>Mon Aug 24 17:54:07 PDT 2009 Extracting world+src for FreeBSD/amd64 7.2-RELEASE
Wed Sep 29 00:54:34 UTC 2010 Building world for FreeBSD/amd64 7.2-RELEASE
Wed Sep 29 01:49:42 UTC 2010 Distributing world for FreeBSD/amd64 7.2-RELEASE
Wed Sep 29 01:50:50 UTC 2010 Building and distributing kernels for FreeBSD/amd64 7.2-RELEASE
Wed Sep 29 02:02:56 UTC 2010 Constructing world components for FreeBSD/amd64 7.2-RELEASE
Wed Sep 29 02:03:08 UTC 2010 Distributing source for FreeBSD/amd64 7.2-RELEASE
Tue Sep 28 19:04:31 PDT 2010 Moving components into staging area for FreeBSD/amd64 7.2-RELEASE
Mon Aug 24 19:04:46 PDT 2009 Extracting extra docs for FreeBSD/amd64 7.2-RELEASE
Mon Aug 24 19:04:51 PDT 2009 Indexing world1 for FreeBSD/amd64 7.2-RELEASE
Mon Aug 24 19:08:04 PDT 2009 Locating build stamps for FreeBSD/amd64 7.2-RELEASE
Mon Aug 24 19:10:19 PDT 2009 Cleaning staging area for FreeBSD/amd64 7.2-RELEASE
Mon Aug 24 19:10:19 PDT 2009 Preparing to copy files into staging area for FreeBSD/amd64 7.2-RELEASE
Mon Aug 24 19:10:20 PDT 2009 Copying data files into staging area for FreeBSD/amd64 7.2-RELEASE
Mon Aug 24 12:16:57 PDT 2009 Copying metadata files into staging area for FreeBSD/amd64 7.2-RELEASE
Mon Aug 24 12:16:59 PDT 2009 Constructing metadata index and tag for FreeBSD/amd64 7.2-RELEASE

Files found which include build stamps:
kernel|generic|/GENERIC/hptrr.ko
kernel|generic|/GENERIC/kernel
world|base|/boot/loader
world|base|/boot/pxeboot
world|base|/etc/mail/freebsd.cf
world|base|/etc/mail/freebsd.submit.cf
world|base|/etc/mail/sendmail.cf
world|base|/etc/mail/submit.cf
world|base|/lib/libcrypto.so.5
world|base|/usr/bin/ntpq
world|base|/usr/include/osreldate.h
world|base|/usr/lib/libalias.a
world|base|/usr/lib/libalias_cuseeme.a
world|base|/usr/lib/libalias_dummy.a
world|base|/usr/lib/libalias_ftp.a
...</screen>

    <para>Finalmente, a compilao termina.</para>

    <screen>Values of build stamps, excluding library archive headers:
v1.2 (Aug 25 2009 00:40:36)
v1.2 (Aug 25 2009 00:38:22)
@(#)FreeBSD 7.2-RELEASE #0: Tue Aug 25 00:38:29 UTC 2009
FreeBSD 7.2-RELEASE #0: Tue Aug 25 00:38:29 UTC 2009
    root@server.myhost.com:/usr/obj/usr/src/sys/GENERIC
7.2-RELEASE
Mon Aug 24 23:55:25 UTC 2009
Mon Aug 24 23:55:25 UTC 2009
##### built by root@server.myhost.com on Tue Aug 25 00:16:15 UTC 2009
##### built by root@server.myhost.com on Tue Aug 25 00:16:15 UTC 2009
##### built by root@server.myhost.com on Tue Aug 25 00:16:15 UTC 2009
##### built by root@server.myhost.com on Tue Aug 25 00:16:15 UTC 2009
Mon Aug 24 23:46:47 UTC 2009
ntpq 4.2.4p5-a Mon Aug 24 23:55:53 UTC 2009 (1)
 * Copyright (c) 1992-2009 The FreeBSD Project.
Mon Aug 24 23:46:47 UTC 2009
Mon Aug 24 23:55:40 UTC 2009
Aug 25 2009
ntpd 4.2.4p5-a Mon Aug 24 23:55:52 UTC 2009 (1)
ntpdate 4.2.4p5-a Mon Aug 24 23:55:53 UTC 2009 (1)
ntpdc 4.2.4p5-a Mon Aug 24 23:55:53 UTC 2009 (1)
Tue Aug 25 00:21:21 UTC 2009
Tue Aug 25 00:21:21 UTC 2009
Tue Aug 25 00:21:21 UTC 2009
Mon Aug 24 23:46:47 UTC 2009

FreeBSD/amd64 7.2-RELEASE initialization build complete.  Please
review the list of build stamps printed above to confirm that
they look sensible, then run
# sh -e approve.sh amd64 7.2-RELEASE
to sign the release.</screen>

    <para>Se tudo estiver correto, aprove a compilao.  Maiores
      informaes sobre como determinar se o processo finalizou com 
      sucesso podem ser encontradas no arquivo chamado 
      <filename>USAGE</filename>, distribudo com o cdigo fonte.  
      Execute o <filename>scripts/approve.sh</filename>.  Isto ir 
      assinar a verso, e mover os seus componentes para uma rea de 
      preparo adequada para a transferncia para o servidor de
      distribuio.</para>

    <informalexample>
      <screen>&prompt.root; <userinput>cd /usr/local/freebsd-update-server</userinput>
&prompt.root; <userinput>sh scripts/mountkey.sh</userinput></screen>
    </informalexample>

    <screen>&prompt.root; <userinput>sh -e scripts/approve.sh amd64 7.2-RELEASE</userinput>
Wed Aug 26 12:50:06 PDT 2009 Signing build for FreeBSD/amd64 7.2-RELEASE
Wed Aug 26 12:50:06 PDT 2009 Copying files to patch source directories for FreeBSD/amd64 7.2-RELEASE
Wed Aug 26 12:50:06 PDT 2009 Copying files to upload staging area for FreeBSD/amd64 7.2-RELEASE
Wed Aug 26 12:50:07 PDT 2009 Updating databases for FreeBSD/amd64 7.2-RELEASE
Wed Aug 26 12:50:07 PDT 2009 Cleaning staging area for FreeBSD/amd64 7.2-RELEASE</screen>

    <para>Depois que o processo de aprovao tiver sido finalizado,
      o processo de transferncia pode ser iniciado.</para>

    <informalexample>
      <screen>&prompt.root; <userinput>cd /usr/local/freebsd-update-server</userinput>
&prompt.root; <userinput>sh scripts/upload.sh amd64 7.2-RELEASE</userinput></screen>
    </informalexample>

    <note>
      <para>No caso do cdigo de atualizao precisar ser transferido
	novamente para o servidor de distribuio, isto poder ser
	feito entrando-se no diretrio pblico de distribuio da
	verso desejada e atualizando os atributos do arquivo
        <emphasis>uploaded</emphasis>.</para>

      <informalexample>
	<screen>&prompt.root; <userinput>cd /usr/local/freebsd-update-server/pub/7.2-RELEASE/amd64</userinput>
&prompt.root; <userinput>touch -t 200801010101.01 uploaded</userinput></screen>
      </informalexample>
    </note>

    <para>Os arquivos transferidos precisam ficar na raiz do servidor 
      web para que as atualizaes sejam distribudas.  A exata 
      configurao depender do servidor web utilizado.  Para o 
      servidor web <application>Apache</application>, por favor, 
      consulte a seo <link xlink:href="&url.books.handbook;/network-apache.html">Configurao do
      servidor Apache</link> do Handbook.</para>

    <para>Atualize o <literal>KeyPrint</literal> e o
      <literal>ServerName</literal> no arquivo
      <filename>/etc/freebsd-update.conf</filename>, e efetue as
      atualizaes de acordo com os procedimentos descritos na seo 
      <link xlink:href="&url.books.handbook;/updating-freebsdupdate.html">Atualizao 
      do &os;</link> do Handbook.</para>

    <important>
      <para>Para o &fbus.ap; funcionar corretamente,  preciso que 
	estejam compiladas a verso <emphasis>atual</emphasis> e 
	a verso <emphasis>alvo</emphasis>  para a qual voc deseja
	se atualizar.  Isto  necessrio para que o sistema determine 
	quais so os arquivos que diferem entre as verses.  Por 
	exemplo, para atualizar o &os; da verso 7.1-RELEASE 
	para a verso 7.2-RELEASE, ser necessrio que voc compile e
	transfira os arquivos de ambas as verses para o seu servidor
	de atualizao.</para>
    </important>

    <para>Para referncia, segue um exemplo de log completo da 
      execuo do 
      <link xlink:href="init.txt"><filename>init.sh</filename></link>
      .</para>
  </sect1>

  <sect1 xml:id="patch">
    <title>Compilando um patch</title>

    <para>Toda vez que um <link xlink:href="&url.base;/security/advisories.html">aviso de segurana</link>
      ou uma <link xlink:href="&url.base;/security/notices.html">nota de
      segurana</link>  anunciada, uma atualizao pode ser
      compilada.</para>

    <para>Para este exemplo, a verso 7.1-RELEASE ser usada.</para>

    <para>Algumas suposies so feitas para a compilao de uma
      verso diferente:</para>

    <itemizedlist>
      <listitem>
        <para>Crie a estrutura correta de diretrio para a compilao
	  inicial.</para>
      </listitem>

      <listitem>
	<para>Faa a compilao inicial da 7.1-RELEASE</para>
      </listitem>
    </itemizedlist>

    <para>Crie o diretrio do patch para a respectiva verso em
      <filename>/usr/local/freebsd-update-server/patches/</filename>.</para>

    <informalexample>
      <screen>&prompt.user; <userinput>mkdir -p /usr/local/freebsd-update-server/patches/7.1-RELEASE/</userinput>
&prompt.user; <userinput>cd /usr/local/freebsd-update-server/patches/7.1-RELEASE</userinput></screen>
    </informalexample>

    <para>Como exemplo, pegue o patch para o &man.named.8;.  Leia o
      aviso,  obtenha o arquivo necessrio do <link xlink:href="&url.base;/security/advisories.html">Aviso de Segurana 
      do &os;</link>.  Mais informaes sobre como interpretar os
      avisos, podem ser encontradas no <link xlink:href="&url.books.handbook;/security-advisories.html">Handbook do 
      &os;</link>.</para>

    <para>Na <link xlink:href="http://security.freebsd.org/advisories/FreeBSD-SA-09:12.bind.asc">nota de segurana</link>,
      este aviso  chamado de <literal>SA-09:12.bind</literal>.
      Depois de fazer o download do arquivo,  necessrio renome-lo
      para o nvel correto do patch.   recomendado manter
      consistncia com os nveis oficiais de patch do &os;, mas o nome
      pode ser escolhido livremente.  Para esta compilao, vamos
      seguir a prtica atual do &os; e cham-lo de
      <literal>p7</literal>.  Renomeie o arquivo:</para>

    <informalexample>
      <screen>&prompt.user; <userinput>cd /usr/local/freebsd-update-server/patches/7.1-RELEASE/; mv bind.patch 7-SA-09:12.bind </userinput></screen>
    </informalexample>

    <note>
      <para>Ao executar uma compilao de nvel de patch, 
	assumido que os patches anteriores estaro no mesmo lugar.
        Quando uma compilao de patch  executada, ela vai aplicar 
        todos os patches contidos no diretrio do patch.</para>

      <para>Podem ser adicionados patches personalizados na
        Compilao.  Use o nmero zero, ou qualquer outro
	nmero.</para>
    </note>

    <warning>
      <para> da responsabilidade do administrador do &fbus.ap;
        tomar as devidas aes para verificar a autenticidade de cada
        patch.</para>
    </warning>

    <para>Neste ponto, um <emphasis>diff</emphasis> est pronto para
      ser construdo.  O software primeiro ir verificar se o 
      <filename>scripts/init.sh</filename> foi executado na respectiva
      verso antes de executar a construo do diff.</para>

    <informalexample>
      <screen>&prompt.root; <userinput>cd /usr/local/freebsd-update-server</userinput>
&prompt.root; <userinput>sh scripts/diff.sh amd64 7.1-RELEASE 7</userinput></screen>
    </informalexample>

    <para>O que segue abaixo  um exemplo do log da execuo de uma 
      compilao <emphasis>diferencial</emphasis>.</para>

    <screen>&prompt.root; <userinput>sh -e scripts/diff.sh amd64 7.1-RELEASE 7</userinput>
Wed Aug 26 10:09:59 PDT 2009 Extracting world+src for FreeBSD/amd64 7.1-RELEASE-p7
Wed Aug 26 17:10:25 UTC 2009 Building world for FreeBSD/amd64 7.1-RELEASE-p7
Wed Aug 26 18:05:11 UTC 2009 Distributing world for FreeBSD/amd64 7.1-RELEASE-p7
Wed Aug 26 18:06:16 UTC 2009 Building and distributing kernels for FreeBSD/amd64 7.1-RELEASE-p7
Wed Aug 26 18:17:50 UTC 2009 Constructing world components for FreeBSD/amd64 7.1-RELEASE-p7
Wed Aug 26 18:18:02 UTC 2009 Distributing source for FreeBSD/amd64 7.1-RELEASE-p7
Wed Aug 26 11:19:23 PDT 2009 Moving components into staging area for FreeBSD/amd64 7.1-RELEASE-p7
Wed Aug 26 11:19:37 PDT 2009 Extracting extra docs for FreeBSD/amd64 7.1-RELEASE-p7
Wed Aug 26 11:19:42 PDT 2009 Indexing world0 for FreeBSD/amd64 7.1-RELEASE-p7
Wed Aug 26 11:23:02 PDT 2009 Extracting world+src for FreeBSD/amd64 7.1-RELEASE-p7
Thu Sep 30 18:23:29 UTC 2010 Building world for FreeBSD/amd64 7.1-RELEASE-p7
Thu Sep 30 19:18:15 UTC 2010 Distributing world for FreeBSD/amd64 7.1-RELEASE-p7
Thu Sep 30 19:19:18 UTC 2010 Building and distributing kernels for FreeBSD/amd64 7.1-RELEASE-p7
Thu Sep 30 19:30:52 UTC 2010 Constructing world components for FreeBSD/amd64 7.1-RELEASE-p7
Thu Sep 30 19:31:03 UTC 2010 Distributing source for FreeBSD/amd64 7.1-RELEASE-p7
Thu Sep 30 12:32:25 PDT 2010 Moving components into staging area for FreeBSD/amd64 7.1-RELEASE-p7
Wed Aug 26 12:32:39 PDT 2009 Extracting extra docs for FreeBSD/amd64 7.1-RELEASE-p7
Wed Aug 26 12:32:43 PDT 2009 Indexing world1 for FreeBSD/amd64 7.1-RELEASE-p7
Wed Aug 26 12:35:54 PDT 2009 Locating build stamps for FreeBSD/amd64 7.1-RELEASE-p7
Wed Aug 26 12:36:58 PDT 2009 Reverting changes due to build stamps for FreeBSD/amd64 7.1-RELEASE-p7
Wed Aug 26 12:37:14 PDT 2009 Cleaning staging area for FreeBSD/amd64 7.1-RELEASE-p7
Wed Aug 26 12:37:14 PDT 2009 Preparing to copy files into staging area for FreeBSD/amd64 7.1-RELEASE-p7
Wed Aug 26 12:37:15 PDT 2009 Copying data files into staging area for FreeBSD/amd64 7.1-RELEASE-p7
Wed Aug 26 12:43:23 PDT 2009 Copying metadata files into staging area for FreeBSD/amd64 7.1-RELEASE-p7
Wed Aug 26 12:43:25 PDT 2009 Constructing metadata index and tag for FreeBSD/amd64 7.1-RELEASE-p7
...
Files found which include build stamps:
kernel|generic|/GENERIC/hptrr.ko
kernel|generic|/GENERIC/kernel
world|base|/boot/loader
world|base|/boot/pxeboot
world|base|/etc/mail/freebsd.cf
world|base|/etc/mail/freebsd.submit.cf
world|base|/etc/mail/sendmail.cf
world|base|/etc/mail/submit.cf
world|base|/lib/libcrypto.so.5
world|base|/usr/bin/ntpq
world|base|/usr/include/osreldate.h
world|base|/usr/lib/libalias.a
world|base|/usr/lib/libalias_cuseeme.a
world|base|/usr/lib/libalias_dummy.a
world|base|/usr/lib/libalias_ftp.a
...
Values of build stamps, excluding library archive headers:
v1.2 (Aug 26 2009 18:13:46)
v1.2 (Aug 26 2009 18:11:44)
@(#)FreeBSD 7.1-RELEASE-p7 #0: Wed Aug 26 18:11:50 UTC 2009
FreeBSD 7.1-RELEASE-p7 #0: Wed Aug 26 18:11:50 UTC 2009
    root@server.myhost.com:/usr/obj/usr/src/sys/GENERIC
7.1-RELEASE-p7
Wed Aug 26 17:29:15 UTC 2009
Wed Aug 26 17:29:15 UTC 2009
##### built by root@server.myhost.com on Wed Aug 26 17:49:58 UTC 2009
##### built by root@server.myhost.com on Wed Aug 26 17:49:58 UTC 2009
##### built by root@server.myhost.com on Wed Aug 26 17:49:58 UTC 2009
##### built by root@server.myhost.com on Wed Aug 26 17:49:58 UTC 2009
Wed Aug 26 17:20:39 UTC 2009
ntpq 4.2.4p5-a Wed Aug 26 17:29:42 UTC 2009 (1)
 * Copyright (c) 1992-2009 The FreeBSD Project.
Wed Aug 26 17:20:39 UTC 2009
Wed Aug 26 17:29:30 UTC 2009
Aug 26 2009
ntpd 4.2.4p5-a Wed Aug 26 17:29:41 UTC 2009 (1)
ntpdate 4.2.4p5-a Wed Aug 26 17:29:42 UTC 2009 (1)
ntpdc 4.2.4p5-a Wed Aug 26 17:29:42 UTC 2009 (1)
Wed Aug 26 17:55:02 UTC 2009
Wed Aug 26 17:55:02 UTC 2009
Wed Aug 26 17:55:02 UTC 2009
Wed Aug 26 17:20:39 UTC 2009
...</screen>

    <para>As atualizaes so exibidas, e uma aprovao 
      requisitada.</para>

    <screen>New updates:
kernel|generic|/GENERIC/kernel.symbols|f|0|0|0555|0|7c8dc176763f96ced0a57fc04e7c1b8d793f27e006dd13e0b499e1474ac47e10|
kernel|generic|/GENERIC/kernel|f|0|0|0555|0|33197e8cf15bbbac263d17f39c153c9d489348c2c534f7ca1120a1183dec67b1|
kernel|generic|/|d|0|0|0755|0||
src|base|/|d|0|0|0755|0||
src|bin|/|d|0|0|0755|0||
src|cddl|/|d|0|0|0755|0||
src|contrib|/contrib/bind9/bin/named/update.c|f|0|10000|0644|0|4d434abf0983df9bc47435670d307fa882ef4b348ed8ca90928d250f42ea0757|
src|contrib|/contrib/bind9/lib/dns/openssldsa_link.c|f|0|10000|0644|0|c6805c39f3da2a06dd3f163f26c314a4692d4cd9a2d929c0acc88d736324f550|
src|contrib|/contrib/bind9/lib/dns/opensslrsa_link.c|f|0|10000|0644|0|fa0f7417ee9da42cc8d0fd96ad24e7a34125e05b5ae075bd6e3238f1c022a712|
...
FreeBSD/amd64 7.1-RELEASE update build complete.  Please review
the list of build stamps printed above and the list of updated
files to confirm that they look sensible, then run
# sh -e approve.sh amd64 7.1-RELEASE
to sign the build.</screen>

    <para>Siga o mesmo processo descrito anteriormente para aprovar a
      compilao:</para>

    <screen>&prompt.root; <userinput>sh -e scripts/approve.sh amd64 7.1-RELEASE</userinput>
Wed Aug 26 12:50:06 PDT 2009 Signing build for FreeBSD/amd64 7.1-RELEASE
Wed Aug 26 12:50:06 PDT 2009 Copying files to patch source directories for FreeBSD/amd64 7.1-RELEASE
Wed Aug 26 12:50:06 PDT 2009 Copying files to upload staging area for FreeBSD/amd64 7.1-RELEASE
Wed Aug 26 12:50:07 PDT 2009 Updating databases for FreeBSD/amd64 7.1-RELEASE
Wed Aug 26 12:50:07 PDT 2009 Cleaning staging area for FreeBSD/amd64 7.1-RELEASE

The FreeBSD/amd64 7.1-RELEASE update build has been signed and is
ready to be uploaded.  Remember to run
# sh -e umountkey.sh
to unmount the decrypted key once you have finished signing all
the new builds.</screen>

    <para>Depois de aprovar a compilao, faa a transferncia do
      software para o servidor de distribuio:</para>

    <informalexample>
      <screen>&prompt.root; <userinput>cd /usr/local/freebsd-update-server</userinput>
&prompt.root; <userinput>sh scripts/upload.sh amd64 7.1-RELEASE</userinput></screen>
    </informalexample>

    <para>Para referncia, segue o log de uma execuo completa do
      <link xlink:href="diff.txt"><filename>diff.sh</filename></link>.</para>
  </sect1>

  <sect1 xml:id="tips">
    <title>Dicas</title>

    <itemizedlist>
      <listitem>
	<para>Se uma verso personalizada tiver sido compilada usando
	  o <link xlink:href="&url.articles.releng;/release-build.html">procedimento</link>
	  nativo do <command>make release</command>, o cdigo do
	  <application>freebsd-update-server</application> ir
	  funcionar a partir da sua verso.  Por exemplo, uma verso
	  sem o ports ou sem a documentao pode ser compilada 
	  limpando-se as funcionalidades pertencentes s sub-rotinas 
	  de documentao <function>findextradocs()</function>,
	  <function>addextradocs()</function> e alterando o local de
	  download na <function>fetchiso()</function>,
	  respectivamente, no <filename>scripts/build.subr</filename>.
	  Em um ltimo passo, mude o hash &man.sha256.1; em
	  <filename>build.conf</filename> na sua respectiva verso e
	  arquitetura e ento voc est pronto para compilar sua
	  verso personalizada.</para>

	<screen># Compare ${WORKDIR}/release and ${WORKDIR}/$1, identify which parts
# of the world|doc subcomponent are missing from the latter, and
# build a tarball out of them.
findextradocs () {
}

# Add extra docs to ${WORKDIR}/$1
addextradocs () {
}
</screen>
      </listitem>
      <listitem>
	<para>Adicionando a opo <option>-j
	  <replaceable>NMERO</replaceable></option> nas etapas
	  <buildtarget>buildworld</buildtarget> e
	  <buildtarget>obj</buildtarget> no script
	  <filename>scripts/build.subr</filename> pode acelerar o
	  processo dependendo do hardware usado, entretanto isto no 
	  necessrio.  Usar esta opo em outras etapas no 
	  recomendado, pois pode fazer a compilao ficar
	  instvel.</para>

	<screen>#Build the world
log "Building world"
cd /usr/src &amp;&amp;
make -j 2 ${COMPATFLAGS} buildworld 2&gt;&amp;1

# Distribute the world
log "Distributing world"
cd /usr/src/release &amp;&amp;
make -j 2 obj &amp;&amp;
  make ${COMPATFLAGS} release.1 release.2 2&gt;&amp;1</screen>
      </listitem>

      <listitem>
	<para>Crie uma entrada SRV apropriada no <link xlink:href="&url.books.handbook;/network-dns.html">DNS</link>
	  para o servidor de atualizao, e coloque outros servidores
	  com pesos variados.  Usar este recurso ir permitir que voc
	  distribua a carga do processo de atualizao entre vrios
	  servidores, entretanto esta dica no ser necessria a menos
	  que voc deseje prover um servio redundante.</para>

	<screen> 
	_http._tcp.update.myserver.com.                  IN SRV   0 2 80   host1.myserver.com.
							    SRV   0 1 80   host2.myserver.com.
							    SRV   0 0 80   host3.myserver.com.</screen>
      </listitem>
    </itemizedlist>
  </sect1>
</article>