aboutsummaryrefslogblamecommitdiff
path: root/pt_BR.ISO8859-1/articles/freebsd-update-server/article.xml
blob: ff46f40f4f327184e0c2c335b0a45a049c1b5238 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12



                                                                                                                                      
  






                                                                                                                                                                                                    
 
                                                       



                                                                                                                                                                                                                                                                                                                                                 




                                        
 


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           
         
 
                                  
                                 

                                                                                                                                                     

          
                               


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          

          
                                
                                  
 
                                                                                                                                                  


                  
                                                      

              
                                                                                                                                                                   



                 
                                                                                                                                                                                                                             


                 
                                                                                                                                                                                                       


                 
                                                                                                                                                                                                                                                                                                                                                                                                                


                 
                                                                                                                                                                     



                   
                                
                                                                    
 
                                                                                                                                                                                                                                                                      
 
                                                                                                                                                           
 
                                                                                                                                                
 
                                                                                                                               
 

                                                                               



                                                      
                                                                           




                               
                                                                                       

                     
                                                       

                                           
                                                                  

                                         
                                                                            

                      
                                                        


                                 


                                                                                                                                                                                                                                                                                                                                                                                                


                                       
                                                                                                                         
 
                                                                             


                                    


                                                                                                                                                                                                                                                                                                                                                                                                


                                     
                                                                                          


                                    
                                                                                                   


                  
                                                                                                                                                                                                                                                                                                                                                                                               


               
                                                                   

                         
                                                                                                                                        



                          
                                                                                                                                                                                                                                 

                         
                                                                   
                                                                                                    








                                                                             
                                                           



                                        
                                                                                                                                                                                                                                                                                 


                                     


                                                                                                                                                                                                                                                                                                                                                                                                                                                     





                      
                        
                                                        
 
                                                                                                                                                                                                                                                                                                                    
 
                                                                        



















                                                                                       
                                                                                                                                                                                     

           
                                                                           

                     

                                                                                                                  

                      
                                                                                                             
 
                                                                                          





































                                                                                              
                                                                                                                                                                                               

             
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     



































                                                                                                    
                                                          

































                                                                      
                                                                                                                                                                                                                                                                                                                                                                                  

                     

                                                                                           

                      
                                                                                                





                                                                                                    
                                                                                                            

                     

                                                                                                                    


                      
                                                                                                                                                                                                                                                     

                       

                                                                                                                                              


                        

                                                                       
 

























                                                                                                                                                                                                                                                                                                                                                                                                                                                           

               
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          

                
                                                                                                                                   

          
                        
                                      
 
                                                                                                                                                                                                                                                                                            
 
                                                              
 
                                                                             


                  
                                                                                              


                 
                                                                         


                   
                                                                                                                                                    

                     

                                                                                                                      

                      


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        

                     
                                                                                                                                                         


                      


                                                                                                                                                                                                                                         


             
                                                                                                                                                                                      

              
                                                                                                                                                                                                                                                            

                     

                                                                                                                    

                      
                                                                                                                     
 
                                                                                               






































































                                                                                                       
                                                                                

















                                                                                                                                       
                                                                                            
 
                                                                                                











                                                                                                    
                                                                              

                     

                                                                                                                    

                      
                                                                                                                                   

          
                       

                        
















                                                                                                                                                                                                                                                                           

                  


                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           





                                                                

                  

                 











                                                                                                                                                                                                                                                                                                                                                                                                                                           


                 




                                                                                                                                                                                                                                                                                                                                                                                                                         



                   
<?xml version="1.0" encoding="utf-8"?>
<!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'>FreeBSD
  Update Server</application>">
]>
<article xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:its="http://www.w3.org/2005/11/its" version="5.0" xml:lang="pt_BR">
  <info>
    <title>Construa seu próprio servidor de atualização do FreeBSD</title>

    <author><personname> <firstname>Jason</firstname> <surname>Helfman</surname> </personname> <affiliation> <address>Jason Helfman <email>jgh@FreeBSD.org</email></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">
      <para>FreeBSD is a registered trademark of the FreeBSD Foundation.</para>
      <para>Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this document, and the FreeBSD Project was aware of the trademark claim, the designations have been followed by the <quote></quote> or the <quote>®</quote> symbol.</para>
      <para>Intel, Celeron, Centrino, Core, EtherExpress, i386, i486, Itanium, Pentium, and Xeon are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries.</para>
      <para>AMD, AMD Athlon, AMD Opteron, AMD Phenom, AMD Sempron, AMD Turion, Athlon, Élan, Opteron, and PCnet are trademarks of Advanced Micro Devices, Inc.</para>
    </legalnotice>

    <pubdate>$FreeBSD$</pubdate>

    <releaseinfo>$FreeBSD$</releaseinfo>

    <abstract>
      <para>Este artigo descreve a construção de um <application>servidor de atualizações do FreeBSD</application> interno. O <link xlink:href="https://svnweb.freebsd.org/base/user/cperciva/freebsd-update-build/">freebsd-update-server</link> foi escrito por Colin Percival <email>cperciva@FreeBSD.org</email>, Oficial de Segurança Emérito do FreeBSD. Para usuários que acham conveniente atualizar seus sistemas em um servidor de atualização oficial, construir seu próprio <application>FreeBSD Update Server</application> pode ajudar a estender sua funcionalidade suportando versões do FreeBSD ajustadas manualmente ou fornecendo um espelho local que permitirá atualizações mais rápidas para várias máquinas.</para>
    </abstract>
  </info>

  <sect1 xml:id="acknowledgments">
    <title>Agradecimentos</title>

    <para>Este artigo foi publicado posteriormente no <link xlink:href="http://bsdmag.org/magazine/1021-bsd-as-a-desktop">BSD Magazine</link>.</para>
  </sect1>

  <sect1 xml:id="introduction">
    <title>Introdução</title>

    <para>Usuários experientes ou administradores são muitas vezes responsáveis por várias máquinas ou ambientes. Eles entendem as difíceis demandas e desafios da manutenção de tal infraestrutura. A execução de um <application>Servidor de Atualização do FreeBSD</application> facilita a implantação de patches de segurança e software em máquinas de teste selecionadas antes de implementá-las nas maquinas em produção. Isso também significa que vários sistemas podem ser atualizados a partir da rede local, em vez de uma conexão de Internet potencialmente mais lenta. Este artigo descreve os passos envolvidos na criação de um <application>Servidor de Atualização do FreeBSD </application> interno.</para>
  </sect1>

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

    <para>Para construir um <application>Servidor de Atualização do FreeBSD</application> interno, alguns requisitos devem ser atendidos.</para>

    <itemizedlist>
      <listitem>
	<para>Um sistema FreeBSD em execução.</para>

	<note>
	  <para>No mínimo, as atualizações requerem a criação de uma versão do FreeBSD maior ou igual a versão do release alvo para a distribuição.</para>
	</note>
      </listitem>

      <listitem>
	<para>Uma conta de usuário com pelo menos 4 GB de espaço disponível. Isso permitirá a criação de atualizações para 7.1 e 7.2, mas os requisitos de espaço exatos podem mudar de versão para versão.</para>
      </listitem>

      <listitem>
	<para>Uma conta com acesso ao <citerefentry><refentrytitle>ssh</refentrytitle><manvolnum>1</manvolnum></citerefentry> em uma máquina remota para carregar atualizações distribuídas.</para>
      </listitem>

      <listitem>
	<para>Um servidor web, como o <link xlink:href="@@URL_RELPREFIX@@/doc/en_US.ISO8859-1/books/handbook/network-apache.html">Apache</link>, com mais da metade do espaço necessário para a construção. Por exemplo, as compilações de teste para 7.1 e 7.2 consomem uma quantidade total de 4 GB e o espaço do servidor da web necessário para distribuir essas atualizações é de 2.6 GB.</para>
      </listitem>

      <listitem>
	<para>Conhecimento básico de shell script com o Bourne shell, <citerefentry><refentrytitle>sh</refentrytitle><manvolnum>1</manvolnum></citerefentry>.</para>
      </listitem>
    </itemizedlist>
  </sect1>

  <sect1 xml:id="Configuration">
    <title>Configuração: Instalação &amp; Configuração</title>

    <para>Faça o download do software <link xlink:href="https://svnweb.freebsd.org/base/user/cperciva/freebsd-update-build/">freebsd-update-server</link> instalando <package>devel/subversion</package> e <package>security/ca_root_nss</package>, e execute:</para>

    <screen><prompt>%</prompt> <userinput>svn co https://svn.freebsd.org/base/user/cperciva/freebsd-update-build freebsd-update-server</userinput></screen>

    <para>Atualize o <filename>scripts/build.conf</filename> apropriadamente. Ele é criado durante todas as operações de construção.</para>

    <para>Aqui está o <filename>build.conf</filename> padrão, que deve 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>Parâmetros para consideração seriam:</para>

    <calloutlist>
      <callout arearefs="ftp-id">
	<para>Este é o local onde as imagens ISO são baixadas (pela sub-rotina <function>fetchiso()</function> do <filename>scripts/build.subr</filename>). A localização configurada não está limitada a URIs de FTP. Qualquer esquema de URI suportado pelo utilitário padrão <citerefentry><refentrytitle>fetch</refentrytitle><manvolnum/></citerefentry> deve funcionar bem.</para>

	<para>Personalizações para o código de <function>fetchiso()</function> podem ser instaladas copiando o script padrão <filename>build.subr</filename> para a área específica do release e da arquitetura em <filename>scripts/RELEASE/ARCHITECTURE/build.subr</filename> e aplicando alterações locais.</para>
      </callout>

      <callout arearefs="buildhost-id">
	<para>O nome do host em construção. Esta informação será exibida em sistemas atualizados ao executar:</para>

	  <screen><prompt>%</prompt> <userinput>uname -v</userinput></screen>
      </callout>

      <callout arearefs="sshkey-id">
	<para>A chave <application>SSH</application> para fazer upload de arquivos para o servidor de atualizações. Um par de chaves pode ser criado digitando <command>ssh-keygen -t dsa</command>. Este parâmetro é opcional; a autenticação de senha padrão será usada como um método de autenticação secundário quando a <literal>SSHKEY</literal> não estiver definida.</para>

	<para>A página de manual do <citerefentry><refentrytitle>ssh-keygen</refentrytitle> <manvolnum>1</manvolnum></citerefentry> contém informações mais detalhadas sobre o <application>SSH</application> e as etapas apropriadas para criar e usar um.</para>
      </callout>

      <callout arearefs="mstacct-id">
	<para>Conta para fazer upload de arquivos para o servidor de atualização.</para>
      </callout>

      <callout arearefs="mstdir-id">
	<para>Diretório no servidor de atualização para o qual os arquivos são enviados.</para>
      </callout>
    </calloutlist>

    <para>O arquivo padrão <filename>build.conf</filename> fornecido com o código-fonte do <application>freebsd-update-server</application> é adequado para a criação de versões i386 do FreeBSD. Como um exemplo de criação de um servidor de atualização para outras arquiteturas, as etapas a seguir descrevem as alterações necessárias na configuração para o amd64:</para>

    <procedure>
      <step>
	<para>Crie um ambiente de compilação para o amd64:</para>

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

      <step>
	<para>Instale um <filename>build.conf</filename> no diretório de criação recém-criado. As opções de configuração de compilação para o FreeBSD 7.2-RELEASE com arquitetura amd64 devem ser semelhantes 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 <citerefentry><refentrytitle>sha256</refentrytitle><manvolnum>1</manvolnum></citerefentry> usada para fazer o hash para a release desejada é publicada no respectivo <link xlink:href="@@URL_RELPREFIX@@/releases/">anúncio de release</link>.</para>
	  </callout>

	  <callout arearefs="eol-id">
	    <para>Para gerar o número "End of Life" para o <filename>build.conf</filename>, consulte o "EOL estimado" publicado no <link xlink:href="@@URL_RELPREFIX@@/security/security.html">Site de Segurança do FreeBSD</link>. O valor de <literal>EOL</literal> pode ser derivado da data listada no site, usando o utilitário <citerefentry><refentrytitle>date</refentrytitle><manvolnum>1</manvolnum></citerefentry>, por exemplo:</para>

	  <screen><prompt>%</prompt> <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>Compilando o Código de Atualização</title>

    <para>O primeiro passo é executar o <filename>scripts/make.sh</filename>. Isso criará alguns binários, criará diretórios e irá gerar uma chave de assinatura RSA usada para aprovar as compilações. Nesta etapa, uma senha terá que ser fornecida para a criação final da chave de assinatura.</para>

    <screen><prompt>#</prompt> <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>Mantenha um backup do fingerprint gerado. Este valor é necessário para o arquivo <filename>/etc/freebsd-update.conf</filename> para as atualizações binárias.</para>
    </note>

    <para>Neste ponto, estamos prontos para montar uma construção.</para>

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

    <para>O que se segue é uma amostra de uma execução da compilação<emphasis>inicial</emphasis>.</para>

    <screen><prompt>#</prompt> <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>Então a compilação do world é executada novamente, com patches para world. Uma explicação mais detalhada pode ser encontrada em <filename>scripts/build.subr</filename>.</para>

    <warning>
      <para>Durante este segundo ciclo de compilação, o daemon do protocolo de tempo de rede, <citerefentry><refentrytitle>ntpd</refentrytitle><manvolnum>8</manvolnum></citerefentry>, é desativado. Segundo o Colin Percival <email>cperciva@FreeBSD.org</email>, Oficial de segurança emérito do FreeBSD, "a compilação do código do <link xlink:href="https://svnweb.freebsd.org/base/user/cperciva/freebsd-update-build/">freebsd-update-server</link> precisa identificar os timestamps que são armazenados nos arquivos para que possam ser ignorados ao comparar builds para determinar quais arquivos precisam ser atualizados. Essa busca de timestamp trabalha com duas construções com 400 dias de diferença e compara 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 construção é concluída.</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>Aprove a compilação se tudo estiver correto. Mais informações sobre como determinar isso podem ser encontradas no arquivo fonte distribuído chamado <filename>USAGE</filename>. Execute <filename>scripts/approve.sh</filename>, conforme indicado. Isso assinará a release e moverá os componentes para uma área de preparação adequada para o upload.</para>

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

    <screen><prompt>#</prompt> <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>Após o processo de aprovação ser concluído, o procedimento de upload pode ser iniciado.</para>

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

    <note>
      <para>No caso de o código de atualização precisar ser reenviado, isso pode ser feito mudando para o diretório de distribuições públicas para o release alvo e atualizando os atributos do arquivo <emphasis>carregado</emphasis>.</para>

      <informalexample>
	<screen><prompt>#</prompt> <userinput>cd /usr/local/freebsd-update-server/pub/<replaceable>7.2-RELEASE/amd64</replaceable></userinput>
<prompt>#</prompt> <userinput>touch -t <replaceable>200801010101.01</replaceable> uploaded</userinput></screen>
      </informalexample>
    </note>

    <!-- If freebsd-update works with other http servers too, we should
	 avoid making the instructions Apache-specific here. -->

<!-- there are specific web instructions in the uploaded code that pertain to Apache. I believe it is worded fine here, now, and if others choose to use another web server, that is their choice to figure out -->
    <para>Os arquivos enviados precisarão estar no diretório de documentos raiz do servidor web para que as atualizações sejam distribuídas. A configuração exata irá variar dependendo do servidor web usado. Para o servidor web <application>Apache</application>, consulte a sessão <link xlink:href="@@URL_RELPREFIX@@/doc/en_US.ISO8859-1/books/handbook/network-apache.html">Configuração de servidores Apache</link> no Handbook.</para>

    <!-- This note seems either out of place.  I find it hard to read and it
	 is a bit difficult to understand why it is related to the rest of
	 this section.  It looks like something that would fit nicely in an
	 introductory section about the way a freebsd-update server works. -->
    <!-- Agreed, it does not suite very well here.  But it is now included
         above.  I think it can be removed now.  gabor -->
    <!-- Taken out until we decide what to do with it -->

<!-- Agreed. However, I believe the placement of this works fine as it is.
    <note>
      <para>Updates for the current release of the &os; system you are
	updating, and what you want to upgrade <emphasis>to</emphasis> need
	to be built in order for &os; Update Server to work properly.  This
	is necessary for merging of files between releases.  For example, if
	you are updating a system from &os; 7.1 to &os; 7.2, you will need
	to have update code built for &os; 7.1-RELEASE and
	&os; 7.2-RELEASE.</para>
    </note> -->

    <!-- What is a 'KeyPrint'? -->
      <para>Atualize o <literal>KeyPrint</literal> e <literal>ServerName</literal> do cliente no arquivo <filename>/etc/freebsd-update.conf</filename>, e execute as atualizações conforme instruído na <link xlink:href="@@URL_RELPREFIX@@/doc/en_US.ISO8859-1/books/handbook/updating-upgrading-freebsdupdate.html">Seção de Atualização do FreeBSD</link> no Handbook.</para>

<!-- Sorry folks, but I disagree here. I believe it is worded fine. If anything, drop everything after "perform" and change "updates" to "FreeBSD Updates" and link that to the handbook -->

    <important>
      <para>Para que o <application>Servidor de Atualização do FreeBSD</application> funcione corretamente, atualizações para ambas releases <emphasis>atual</emphasis> e a release <emphasis>que se deseja atualizar</emphasis> precisam ser compilados. Isso é necessário para determinar as diferenças de arquivos entre as releases. Por exemplo, ao atualizar um sistema FreeBSD de 7.1-RELEASE para 7.2-RELEASE, as atualizações precisarão ser construídas e carregadas em seu servidor de distribuição para ambas as versões.</para>
    </important>

    <para>Para referência, toda a execução do <link xlink:href="init.txt"><filename>init.sh</filename></link> é anexada.</para>
  </sect1>

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

    <para>Toda vez que é anunciado um <link xlink:href="@@URL_RELPREFIX@@/security/advisories.html">aviso de segurança</link> ou uma <link xlink:href="@@URL_RELPREFIX@@/security/notices.html">notificação de segurança</link>, um patch de atualização pode ser construído.</para>

    <para>Para este exemplo, o 7.1-RELEASE será usado.</para>

    <para>Algumas suposições são feitas para uma versão diferente:</para>

    <itemizedlist>
      <listitem>
	<para>Configure a estrutura de diretórios correta para a compilação inicial.</para>
      </listitem>

      <listitem>
	<para>Execute uma compilação inicial para o 7.1-RELEASE.</para>
      </listitem>
    </itemizedlist>

    <para>Crie o diretório de correção do respectivo release no diretório <filename>/usr/local/freebsd-update-server/patches/</filename>.</para>

    <informalexample>
      <screen><prompt>%</prompt> <userinput>mkdir -p /usr/local/freebsd-update-server/patches/7.1-RELEASE/</userinput>
<prompt>%</prompt> <userinput>cd /usr/local/freebsd-update-server/patches/7.1-RELEASE</userinput></screen>
    </informalexample>

    <para>Como exemplo, pegue o patch para <citerefentry><refentrytitle>named</refentrytitle><manvolnum>8</manvolnum></citerefentry>. Leia o comunicado, e pegue o arquivo necessário de <link xlink:href="@@URL_RELPREFIX@@/security/advisories.html"> Avisos de Segurança do FreeBSD </link>. Mais informações sobre a interpretação do comunicado podem ser encontradas no <link xlink:href="@@URL_RELPREFIX@@/doc/en_US.ISO8859-1/books/handbook/security-advisories.html">Handbook do FreeBSD</link>.</para>

    <para>No <link xlink:href="https://security.freebsd.org/advisories/FreeBSD-SA-09:12.bind.asc">resumo de segurança</link>, este comunicado é chamado <literal>SA-09:12.bind</literal>. Depois de baixar o arquivo, é necessário renomear o arquivo para um nível de correção apropriado. Sugere-se manter isso consistente com os níveis oficiais de correção do FreeBSD, mas seu nome pode ser escolhido livremente. Para esta compilação, vamos seguir a prática atualmente estabelecida do FreeBSD e chamar isso de <literal>p7</literal>. Renomeie o arquivo:</para>

    <informalexample>
      <screen><prompt>%</prompt> <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 compilação em nível de patch, supõe-se que os patches anteriores estejam no lugar. Quando uma compilação de patch é executada, ela executará todas os patches contidos no diretório de patch.</para>

      <para>Pode haver patches personalizados adicionados a qualquer compilação. Use o número zero ou qualquer outro número.</para>
    </note>

    <warning>
      <para>Cabe ao administrador do <application>Servidor de Atualização do FreeBSD</application> tomar as medidas apropriadas para verificar a autenticidade de cada patch.</para>
    </warning>

    <para>Neste ponto, um <emphasis>diff</emphasis> está pronto para ser construído. O software verifica primeiro para ver se um <filename>scripts/init.sh</filename> foi executado na respectiva versão antes de executar a construção do diff.</para>

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

    <para>O que se segue é um exemplo de uma execução de uma compilação <emphasis>diferencial</emphasis>.</para>

    <screen><prompt>#</prompt> <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 atualizações são impressas e a aprovação é solicitada.</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 uma compilação:</para>

    <screen><prompt>#</prompt> <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 compilação, faça o upload do software:</para>

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

    <para>Para referência, toda a execução do <link xlink:href="diff.txt"><filename>diff.sh</filename></link> é anexada.</para>
  </sect1>

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

    <!-- These are nice tips, but there are only a few of them and they need a
	 bit of rewording to make sense.  I'd like to see something that
	 explains at least the following for every tip:

	 * Why is this tip necessary?  What is the original problem it tries
	   to solve?
	 * How to install the changes of the tip, preferably in a <procedure>
	   element, with clearly separated steps.
	 * How to check that the changes of the tip had a measurable and
	   noticeable effect.

	 We can do this in a followup commit.  It doesn't have to be completed
	 *before* we commit this to CVS. -->

<!-- thank you, i just learned these in the process, and thought I would share. They are "tips" and not necessary, so I do see your point, and I would suggest maybe even renaming the section to something more appropriate. Nothing really comes to mind now, though. -->

<!-- this tip will allow you to maintain a custom release and custom kernel, and update it like any other binary update -->
    <itemizedlist>
      <listitem>
	<para>Se uma versão personalizada for criada usando o procedimento <command>make release</command> <link xlink:href="@@URL_RELPREFIX@@/doc/en_US.ISO8859-1/articles/releng/release-build.html">nativo</link>, o <application>freebsd-update-server</application> funcionará a partir do seu release. Como exemplo, uma versão sem ports ou documentação pode ser construída limpando funcionalidades de limpeza pertinentes às sub-rotinas de documentação <function>findextradocs()</function>, <function>addextradocs()</function> e alterando o local de download em <function>fetchiso()</function>, respectivamente, em <filename>scripts/build.subr</filename>. Como último passo, altere o hash <citerefentry><refentrytitle>sha256</refentrytitle><manvolnum>1</manvolnum></citerefentry> no arquivo <filename>build.conf</filename> sob sua respectiva versão e arquitetura e você estará pronto para criar sua versão personalizada.</para>

	<programlisting># 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 () { 
}</programlisting>
      </listitem>
      <listitem>
	<para>Adicionando flags <option>-j <replaceable>NUMERO</replaceable> </option> para os alvos <buildtarget>buildworld</buildtarget> e <buildtarget>obj</buildtarget> no script <filename>scripts/build.subr</filename> pode acelerar o processamento, dependendo do hardware usado, no entanto, não é necessário. O uso dessas flags em outros alvos não é recomendado, pois pode tornar a construção não confiável.</para>

	<programlisting>              # 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</programlisting>
      </listitem>

      <listitem>
	<para>Crie um registro <link xlink:href="@@URL_RELPREFIX@@/doc/en_US.ISO8859-1/books/handbook/network-dns.html">DNS</link> apropriado para o servidor de atualizações e coloque outros por trás dele com variáveis de pesos diferentes. O uso desse recurso fornecerá espelhos de atualização, no entanto, essa dica não é necessária, a menos que você deseje fornecer um serviço redundante.</para>

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