| 1 | == Crear USB oglive desde cero == |
| 2 | Es necesario: |
| 3 | * Inintrd de opengnesys (oginitrd.img) modificado para emular pxe y descargar la entrada de grldr (menu.lst) y el kernel de OlpenGnsys |
| 4 | * Grub2 compilado para sistemas efi de 64 bits (bootx64.efi) |
| 5 | * Archivo grub.cfg con el menu de arranque |
| 6 | * Pendrive |
| 7 | |
| 8 | 1)Preparacion de la unidad de arranque |
| 9 | Ejecutar las siguientes instrucciones en la para unidad del pendrive: |
| 10 | ?> parted -s /dev/sdX mklabel GPT |
| 11 | ?> parted -sm /dev/sdX mkpartfs EFI fat32 20.5k 210m 2 |
| 12 | |
| 13 | 2)Compilacion de grub2 |
| 14 | Una vez descargado grub de la direccion y descomprimido ejecutar las siguientes instruccuines : |
| 15 | ?> sudo apt-get install bison libopts25 libselinux1-dev autogen m4 autoconf help2man libopts25-dev flex libfont-freetype-perl automake autotools-dev freetype2-demos texinfo |
| 16 | ?> export EFI_ARCH=x86_64 |
| 17 | ?> ./configure --with-platform=efi --target=${EFI_ARCH} --program-prefix="" |
| 18 | ?> make |
| 19 | ?> sudo ./grub-mkimage -O x86_64-efi -d ./grub-core -o bootx64.efi -p "" part_gpt part_msdos ntfs ntfscomp hfsplus fat ext2 normal chain boot configfile linux multiboot video_fb efi_gop efi_uga font test search |
| 20 | ?> montar el Pendrive y Crear una carpeta /efi/boot/grub |
| 21 | ?> sudo cp bootx64.efi *.mod *.lst /mnt/sdaX/efi/boot/grub |
| 22 | |
| 23 | 3)copiar ogvmlinux y oginitrd en la carpeta /mnt/sdaX/efi/boot |
| 24 | |
| 25 | 4)Creacion del menu de arranque |
| 26 | Ejemplo de configuracion del archivo grub.cfg : |
| 27 | |
| 28 | #definicion de variables |
| 29 | ######################## |
| 30 | |
| 31 | set timeout=3 |
| 32 | set default=0 |
| 33 | #search.file /efi/boot/bootx64.efi root |
| 34 | set nextboot="pxe" |
| 35 | |
| 36 | #controladores graficos para grub |
| 37 | ################################## |
| 38 | |
| 39 | set GRUB2_PREFIX_DIR=/efi/boot/grub/ |
| 40 | insmod $GRUB2_PREFIX_DIR/video_fb.mod |
| 41 | insmod $GRUB2_PREFIX_DIR/efi_gop.mod |
| 42 | insmod $GRUB2_PREFIX_DIR/efi_uga.mod |
| 43 | #insmod $GRUB2_PREFIX_DIR/font.mod |
| 44 | |
| 45 | if loadfont $GRUB2_PREFIX_DIR/fonts/unicode.pf2 ; then |
| 46 | #set gfxmode=auto |
| 47 | #set gfxmode=1920x1080 |
| 48 | set gfxmode=1280x720 |
| 49 | #insmod $GRUB2_PREFIX_DIR/gfxterm.mod |
| 50 | fi |
| 51 | terminal_output gfxterm |
| 52 | background_image /fondos/1280x720.png |
| 53 | set COLOR_NORMAL="black/black" |
| 54 | set COLOR_HIGHLIGHT="black/light-gray" |
| 55 | ################################## |
| 56 | #if loadfont $GRUB2_PREFIX_DIR/fonts/unicode.pf2 |
| 57 | #then |
| 58 | #insmod $GRUB2_PREFIX_DIR/gfxterm.mod |
| 59 | #set gfxmode=auto |
| 60 | #set gfxpayload=keep |
| 61 | #terminal_output gfxterm |
| 62 | #fi |
| 63 | #terminal_output console |
| 64 | |
| 65 | #Menus de inicio |
| 66 | ################################## |
| 67 | fakebios |
| 68 | insmod $GRUB2_PREFIX_DIR/test.mod |
| 69 | search.file /boot.mac nextboot |
| 70 | |
| 71 | if [ test $nextboot == "pxe" ] |
| 72 | then |
| 73 | |
| 74 | set nextboot="pxe" |
| 75 | search.file /boot.win nextboot |
| 76 | if [ test $nextboot != "pxe" ] |
| 77 | then |
| 78 | menuentry 'Windows 7' --class os { |
| 79 | search.file /Windows/Boot/EFI/bootmgr.efi root |
| 80 | loadbios /efi/boot/vbios.bin /efi/boot/int10.bin |
| 81 | chainloader +1 |
| 82 | } |
| 83 | set nextboot="pxe" |
| 84 | fi |
| 85 | |
| 86 | menuentry 'Cliente pxe en kernel IOG ker3.8 og1.05' --class gnu-linux --class gnu --class os { |
| 87 | search.file /efi/boot/bootx64.efi root |
| 88 | loadbios /efi/boot/vbios.bin /efi/boot/int10.bin |
| 89 | linux /efi/boot/clientepxe/ogvmlinuz vga=788 acpi=force ip=dhcp |
| 90 | initrd /efi/boot/clientepxe/oginitrd.img |
| 91 | } |
| 92 | set nextboot="pxe" |
| 93 | search.file /boot.me nextboot |
| 94 | if [ test $nextboot != "pxe" ] |
| 95 | then |
| 96 | |
| 97 | menuentry 'Cliente pxe en kernel IOG ker3.8 og1.05 (boot.me)' --class gnu-linux --class gnu --class os { |
| 98 | search.file /boot.me root |
| 99 | loadbios /efi/boot/vbios.bin /efi/boot/int10.bin |
| 100 | linux /efi/boot/clientepxe/ogvmlinuz vga=788 acpi=force ip=dhcp |
| 101 | initrd /efi/boot/clientepxe/oginitrd.img |
| 102 | } |
| 103 | menuentry 'Cliente pxe en ogClient IOG ker3.7 og1.04' --class gnu-linux --class gnu --class os { |
| 104 | search.file /boot.me root |
| 105 | loadbios /efi/boot/vbios.bin /efi/boot/int10.bin |
| 106 | linux /efi/boot/clientepxe.3.7/ogvmlinuz vga=788 acpi=force ip=dhcp |
| 107 | initrd /efi/boot/clientepxe.3.7/oginitrd.img |
| 108 | } |
| 109 | set nextboot="pxe" |
| 110 | fi |
| 111 | |
| 112 | search.fs_label ogClient nextboot |
| 113 | if [ test $nextboot != "pxe" ] |
| 114 | then |
| 115 | #solo para arranque desde pendrive |
| 116 | menuentry "ogclien online" { |
| 117 | search.fs_label ogClient root |
| 118 | linux /boot/ogvmlinuz ro vga=788 irqpoll acpi=on boot=oginit og2nd=sqfs ogprotocol=smb ogactiveadmin=true ogdebug=true ip=dhcp boot=oginit quiet splash irqpoll acpi=on og2nd=sqfs ogactiveadmin=false ogdebug=false ogupdateinitrd=true vga=788 LANG=es_ES ip=172.17.69.230:172.17.69.233:172.17.69.254:255.255.255.0:BootOffLine:eth0:none group=Aula1 ogrepo=172.17.69.233 oglive=172.17.69.233 oglog=172.17.69.233 ogshare=172.17.69.233 |
| 119 | initrd /boot/oginitrd.img |
| 120 | } |
| 121 | |
| 122 | menuentry "ogclien local repo online" { |
| 123 | search.fs_label ogClient root |
| 124 | linux /boot/ogvmlinuz ro vga=788 irqpoll acpi=on boot=oginit og2nd=sqfs ogprotocol=local ogactiveadmin=true ogdebug=false ip=dhcp boot=oginit quiet splash irqpoll acpi=on og2nd=sqfs ogactiveadmin=false ogdebug=false ogupdateinitrd=true vga=788 LANG=es_ES ip=172.17.69.230:172.17.69.233:172.17.69.254:255.255.255.0:BootOffLine:eth0:none group=Aula1 ogrepo=172.17.69.233 oglive=172.17.69.233 oglog=172.17.69.233 ogshare=172.17.69.233 |
| 125 | initrd /boot/oginitrd.img |
| 126 | } |
| 127 | |
| 128 | menuentry "ogclien offline debug noip" { |
| 129 | search.fs_label ogClient root |
| 130 | linux /boot/ogvmlinuz ro vga=788 irqpoll acpi=on boot=oginit og2nd=sqfs ogprotocol=local ogactiveadmin=true ogdebug=true ip=none |
| 131 | initrd /boot/oginitrd.img |
| 132 | } |
| 133 | menuentry "ogclien offline bash noip" { |
| 134 | search.fs_label ogClient root |
| 135 | linux /boot/ogvmlinuz ro vga=788 irqpoll acpi=on boot=oginit oginit=/bin/bash og2nd=sqfs ogprotocol=local ogactiveadmin=true ogdebug=false ip=none |
| 136 | initrd /boot/oginitrd.img |
| 137 | } |
| 138 | |
| 139 | menuentry "ogclien offline debug ip=dhcp" { |
| 140 | search.fs_label ogClient root |
| 141 | linux /boot/ogvmlinuz ro vga=788 irqpoll acpi=on boot=oginit og2nd=sqfs ogprotocol=local ogactiveadmin=true ogdebug=true ip=dhcp |
| 142 | initrd /boot/oginitrd.img |
| 143 | } |
| 144 | set nextboot="pxe" |
| 145 | fi |
| 146 | fi |
| 147 | |
| 148 | #siempre presentara la opcion de arranque en macosx |
| 149 | |
| 150 | #if [test $nextboot == "hd1,gpt1" ] then |
| 151 | menuentry 'Macosx hd1,2' --class gnu-linux --class gnu --class os { |
| 152 | search.file /System/Library/CoreServices/boot.efi root |
| 153 | #set root=(hd1,gpt2) |
| 154 | chainloader /System/Library/CoreServices/boot.efi |
| 155 | #chainloading +1 |
| 156 | } |
| 157 | |
| 158 | |
| 159 | |
| 160 | |