Mudanças entre as edições de "Criando Kernel RT Ubuntu 12.04"
Linha 1: | Linha 1: | ||
− | Atualize | + | As informações abaixo são baseadas em: https://rt.wiki.kernel.org/index.php/RT_PREEMPT_HOWTO |
+ | |||
+ | Atualize o apt-get: | ||
# apt-get update | # apt-get update | ||
− | + | ||
− | Baixe o kernel: | + | Baixe o kernel da versão desejada de http://www.kernel.org/pub/linux/kernel/v3.x . Nos exemplos abaixo, o kernel é o 3.4.52: |
$ wget http://www.kernel.org/pub/linux/kernel/v3.x/linux-3.4.52.tar.bz2 | $ wget http://www.kernel.org/pub/linux/kernel/v3.x/linux-3.4.52.tar.bz2 | ||
− | Baixe o patch: | + | Baixe o patch RT para o kernel escolhido de http://www.kernel.org/pub/linux/kernel/projects/rt/ Se não existir, escolha outro kernel (ver acima). No exemplo abaixo, o patch é para o kernel 3.4.52: |
$ wget http://www.kernel.org/pub/linux/kernel/projects/rt/3.4/patch-3.4.52-rt67.patch.bz2 | $ wget http://www.kernel.org/pub/linux/kernel/projects/rt/3.4/patch-3.4.52-rt67.patch.bz2 | ||
− | Logo após | + | Logo após, instale os pacotes abaixo: |
+ | |||
+ | $ sudo apt-get install gcc libncurses5-dev | ||
− | |||
Após instalar os pacotes, digite: | Após instalar os pacotes, digite: | ||
− | + | $ sudo su | |
# cd /usr/src/ | # cd /usr/src/ | ||
# cp /< diretório onde voce baixou seu kernel>/linux-3.4.52.tar.bz2 . | # cp /< diretório onde voce baixou seu kernel>/linux-3.4.52.tar.bz2 . | ||
Linha 36: | Linha 39: | ||
# make oldconfig | # make oldconfig | ||
− | O | + | O make vai fazer algumas perguntas, responda com o padrão EXCETO sobre as opções real time e modo debug. As orientações do site original são: |
+ | |||
+ | * enable CONFIG_PREEMPT_RT | ||
+ | * activated the High-Resolution-Timer Option (Attention, the amount of supported platforms by the HR timer is still very limited. Right now the option is only supported on x86 systems, PowerPC and ARM Support are however in queue.) | ||
+ | * disabled all Power Management Options like ACPI or APM (not all ACPI functions are "bad", but you will have to check very carefully to find out which function will affect your real time system. Thus it's better to simply disable them all if you don't need them. APM, however, is a no-go.) NOTE: Since rt patch 2.6.18-rt6 you will probably have to activate ACPI option to activate high resolution timer. Since the TSC timer on PC platforms, as used in the previous versions, are now marked as unsuitable for hrt mode due to many lacks of functionalities and reliabilities, you will need i.E. pm_timer as provided by ACPI to use as clock source. To activate the pm_timer, you can just activate the ACPI_SUPPORT in menuconfig and deactivate all other sub modules like "fan", "processor" or "button". If you have an old pc, which lacks ACPI support, you might have problems using the high resolution timer. | ||
+ | |||
+ | * Further interesting options can be found under the "Kernel Hacking" menu entry This menu lists options for system debugging and performance measurement. Keep in mind that the debug options may either increase the kernel size or cause higher latencies. If you do not want to debug the kernel or get some automatically produced histograms, make sure that you don't activate any unnecessary options here. If you have activated any latency critical options the kernel will warn at boot time. | ||
+ | |||
Logo após isso, execute o comando: | Logo após isso, execute o comando: |
Edição das 16h30min de 29 de março de 2016
As informações abaixo são baseadas em: https://rt.wiki.kernel.org/index.php/RT_PREEMPT_HOWTO
Atualize o apt-get:
# apt-get update
Baixe o kernel da versão desejada de http://www.kernel.org/pub/linux/kernel/v3.x . Nos exemplos abaixo, o kernel é o 3.4.52:
$ wget http://www.kernel.org/pub/linux/kernel/v3.x/linux-3.4.52.tar.bz2
Baixe o patch RT para o kernel escolhido de http://www.kernel.org/pub/linux/kernel/projects/rt/ Se não existir, escolha outro kernel (ver acima). No exemplo abaixo, o patch é para o kernel 3.4.52:
$ wget http://www.kernel.org/pub/linux/kernel/projects/rt/3.4/patch-3.4.52-rt67.patch.bz2
Logo após, instale os pacotes abaixo:
$ sudo apt-get install gcc libncurses5-dev
Após instalar os pacotes, digite:
$ sudo su # cd /usr/src/ # cp /< diretório onde voce baixou seu kernel>/linux-3.4.52.tar.bz2 . # cp /< diretório onde voce baixou seu patch>/patch-3.4.52-rt67.patch.bz2 .
Descompacte o kernel:
# tar -jxvf linux-3.4.52.tar.bz2
Mude para o diretório do kernel:
# cd linux-3.4.52
Faca o patch do kernel:
# bzcat ../patch-3.4.52-rt67.patch.bz2 | patch -p1
Obtenha a configuração atual no novo kernel:
# make oldconfig
O make vai fazer algumas perguntas, responda com o padrão EXCETO sobre as opções real time e modo debug. As orientações do site original são:
- enable CONFIG_PREEMPT_RT
- activated the High-Resolution-Timer Option (Attention, the amount of supported platforms by the HR timer is still very limited. Right now the option is only supported on x86 systems, PowerPC and ARM Support are however in queue.)
- disabled all Power Management Options like ACPI or APM (not all ACPI functions are "bad", but you will have to check very carefully to find out which function will affect your real time system. Thus it's better to simply disable them all if you don't need them. APM, however, is a no-go.) NOTE: Since rt patch 2.6.18-rt6 you will probably have to activate ACPI option to activate high resolution timer. Since the TSC timer on PC platforms, as used in the previous versions, are now marked as unsuitable for hrt mode due to many lacks of functionalities and reliabilities, you will need i.E. pm_timer as provided by ACPI to use as clock source. To activate the pm_timer, you can just activate the ACPI_SUPPORT in menuconfig and deactivate all other sub modules like "fan", "processor" or "button". If you have an old pc, which lacks ACPI support, you might have problems using the high resolution timer.
- Further interesting options can be found under the "Kernel Hacking" menu entry This menu lists options for system debugging and performance measurement. Keep in mind that the debug options may either increase the kernel size or cause higher latencies. If you do not want to debug the kernel or get some automatically produced histograms, make sure that you don't activate any unnecessary options here. If you have activated any latency critical options the kernel will warn at boot time.
Logo após isso, execute o comando:
# make menunconfig
Caso tenha algo a mudar no kernel, mude nesses menus.
Ao finalizar, salve as configurações e continue como descrito abaixo:
# make bzImage && make modules && make modules_install
Vai demorar, por isso espere.
Após finalizar sem erro, agora é copiar o kernel para /boot:
# cp arch/x86_64/boot/bzImage /boot/vmlinuz-3.4.52-rt67 # cp System.map /boot/System.map-3.4.52-rt67 # cp .config /boot/config-3.4.52-rt67
Gere a imagem:
# cd /boot # mkinitramfs -o initramfs-3.4.52-rt67.img 3.4.52-rt67
Atualize o grub:
# grub2-mkconfig -o /boot/grub2/grub.cfg ou # update-grub
Reinicie o computador para verificar se tudo está certo.