Advertisement
richardlumscio

Untitled

Dec 10th, 2013
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Boot no Linux - Processo / Pt-English
  2.  
  3. Estou a ler atualmente o livro
  4. "Programação Avançada Em Linux" de Glecon pela editora
  5. Novatec, e em um dos capitulos é mostrado como construir
  6. uma mini distro com o uso do busybox(apps base linux/gnu), iptables.
  7. Mas estou obtendo erro, a inicialização ocorre mas infelizmente não
  8. cai no bash. Andei a ler o livro "Linux From Scratch" atráz
  9. de uma luz mas estou tendo dificuldade.
  10.  
  11. Basicamente os procedimentos foram:
  12.  
  13. 1. Criar o diretorio tunix;
  14. 2. compilar o kernel gerando bzImage, e compilar o busybox;
  15. 3. criar a imagem (exemplo tunix.img);
  16. 4. gerar arquivo gz do diretorio raiz (contendo busybox instalado, e subdiretorios);
  17. 5. criar um arquivo syslinux.cfg (arquivo com as informações do boot);
  18. 6. montar a imagem (tunix.img) copiando bzImage, a imagem do diretorios raiz (que fora criado),
  19. e o arquivo configuração syslinux.cfg para o local onde foi montada a imagem;
  20. 7. Desmontar o diretorio onde foi montada a imagem (no tunix.img)
  21. 8. rodar o comando # syslinux -s <tunix.img>
  22. 9. Gravar em disquete (exemplo do livro), ou testar com o qemu;
  23.  
  24. (1).Por Dentro do Processo de Inicialização do Linux
  25. http://www.ibm.com/developerworks/br/library/l-linuxboot/
  26.  
  27. -----------------------------------------------------------------------------------------------
  28.  
  29. #/etc/rcS
  30.  
  31. #!bin/sh
  32. mount -t proc none /proc
  33. mount -t sysfs none /sys
  34. ifconfig -a
  35. /bin/sh
  36.  
  37.  
  38.  
  39. #syslinux.cfg
  40. default linux
  41. prompt 0
  42. label Linux
  43. KERNEL vmlinuz
  44. APPEND load_ramdisk=1 initrd=rootfs.gz root=/dev/ram0 rw
  45.  
  46. #inittab
  47. # Este é o primeiro script
  48. ::sysinit:/etc/init.d/rcS
  49. # Comece com o shell "askfirst" no console
  50. ::askfirst:­/bin/sh
  51. # O que fazer quando restartar um processo init
  52. ::restart:/sbin/init
  53. # O que fazer antes de reiniciar
  54. ::ctrlaltdel:/sbin/reboot
  55. ::shutdown:/bin/umount ­a ­r
  56.  
  57. Boot in Linux - Process
  58.  
  59. I'm currently reading the book
  60. " Advanced Programming in Linux " Glecon from the publisher
  61. Novatec , and one of the chapters is shown how to construct
  62. a mini distro using busybox ( based apps linux / gnu ) , iptables .
  63. But I am getting error , initialization occurs but unfortunately not
  64. falls in bash . I've been reading the book " Linux From Scratch " Ago
  65. a light but am having difficulty.
  66.  
  67. Basically procedures were :
  68.  
  69. 1. Create the directory Tunix ;
  70. 2 . generating compile the bzImage kernel , and compile busybox ;
  71. 3 . create the image ( tunix.img example) ;
  72. 4 . generate gz file from the root directory ( containing busybox installed and subdirectories ) ;
  73. 5 . create a syslinux.cfg file ( file with the information of boot ) ;
  74. 6 . mount the image ( tunix.img ) copying bzImage , the image of the root directories ( which had been created ) ,
  75. and syslinux.cfg configuration file to the location where the image was assembled ;
  76. 7 . Unmount the directory where the image was mounted ( in tunix.img )
  77. 8 . run the command # syslinux - s <tunix.img>
  78. 9. Write to disk ( eg the book ) , or test with qemu ;
  79.  
  80. ( 1 ) . Inside the Linux Boot Process
  81. http://www.ibm.com/developerworks/br/library/l-linuxboot/
  82.  
  83. -------------------------------------------------- ---------------------------------------------
  84.  
  85. # / etc / rcS
  86.  
  87. # ! bin / sh
  88. mount- t proc none / proc
  89. mount- t sysfs none / sys
  90. ifconfig-a
  91. / bin / sh
  92.  
  93.  
  94.  
  95. # syslinux.cfg
  96. linux default
  97. prompt 0
  98. label Linux
  99. KERNEL vmlinuz
  100. Load_ramdisk APPEND initrd = 1 = rootfs.gz root = / dev/ram0 rw
  101.  
  102. # inittab
  103. # This is the first script
  104. :: sysinit :/ etc / init.d / rcS
  105. # Start with the shell " askfirst " in console
  106. askfirst :: :-/ bin / sh
  107. # What to do when restarting an init process
  108. :: restart :/ sbin / init
  109. # What to do before rebooting
  110. ctrlaltdel :: :/ sbin / reboot
  111. :: shutdown :/ bin / umount - a- r
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement