Ambos lados, revisión anterior
Revisión previa
Próxima revisión
|
Revisión previa
Última revisión
Ambos lados, revisión siguiente
|
es:howtos:slackware_admin:set_up_syslinux_as_boot_loader_on_uefi_based_hardware [2019/02/06 01:51 (UTC)] ak3.devel |
es:howtos:slackware_admin:set_up_syslinux_as_boot_loader_on_uefi_based_hardware [2019/02/06 04:06 (UTC)] ak3.devel |
<note warning> Traduciendo ak3.devel | |
| |
| |
</note><!-- Add your text below. We strongly advise to start with a Headline (see button bar above). --> | |
====== Set up SYSLINUX as boot loader on UEFI based hardware ====== | |
SYSLINUX is a boot loader that loads Linux (among other things) from FAT filesystem. [[http://www.syslinux.org/wiki/index.php?title=The_Syslinux_Project | The Syslinux Project]], of which SYSLINUX the boot loader is a part, contains also ISOLINUX, EXTLINUX and PXELINUX, basically its variants to boot from optical media, ext2/3/4, Btrfs, XFS, UFS/FFS and NTFS or from network. | |
| |
UEFI support seems to have been added in version 6 of SYSLINUX, while Slackware comes with version 4, which means it can not be set up during Slackware installation, unless one prepares SYSLINUX files on another machine. | <!-- Add your text below. We strongly advise to start with a Headline (see button bar above). --> |
| ====== Configure SYSLINUX como cargador de arranque en hardware basado en UEFI ====== |
| SYSLINUX es un cargador de arranque que carga Linux (entre otras cosas) desde el sistema de archivos FAT. [[http://www.syslinux.org/wiki/index.php?title=The_Syslinux_Project | The Syslinux Project]], del cual forma parte SYSLINUX, el cargador de arranque, también contiene ISOLINUX, EXTLINUX y PXELINUX, básicamente sus variantes para arrancar desde medios ópticos, ext2 / 3/4, Btrfs, XFS, UFS / FFS y NTFS o desde red. |
| |
| El soporte de UEFI parece haberse agregado en la versión 6 de SYSLINUX, mientras que Slackware viene con la versión 4, lo que significa que no se puede configurar durante la instalación de Slackware, a menos que uno prepare los archivos SYSLINUX en otra máquina. |
| |
===== Why SYSLINUX ===== | |
That being said, why bother with SYSLINUX? A couple of reasons: | |
| |
* LILO/ELILO is reportedly no longer maintained, the time may come we will have to switch to something else. | ===== Por qué SYSLINUX ===== |
* Learning SYSLINUX may be worthwhile, because aside from serving as LILO/ELILO replacement, it can do many other things (e.g. PXE) | Dicho esto, ¿por qué molestarse con SYSLINUX? Un par de razones: |
* Compared to GRUB, it is, well, less humongous and intimidating. After all, configuration files resemble those of LILO/ELILO. | |
| |
| * Se informa que LILO / ELILO ya no se mantiene, puede que llegue el momento en que tendremos que cambiar a otra cosa. |
| * El aprendizaje de SYSLINUX puede valer la pena, ya que además de servir como reemplazo de LILO / ELILO, puede hacer muchas otras cosas (por ejemplo, PXE) |
| * Comparado con GRUB, es, bueno, menos humilde e intimidante. Después de todo, los archivos de configuración se parecen a los de LILO / ELILO. |
| |
===== Why UEFI ===== | |
It is not as though there is some choice; machines nowadays //are// UEFI. One can, however, choose to set UEFI to so called "CSM" or sometimes "Legacy" mode. In this mode, UEFI acts as BIOS, i.e. reads the first sector (MBR) of a hard drive and loads and executes non-UEFI boot loader such as LILO from there. As opposed to UEFI in, say, UEFI mode, when it reads, loads and executes UEFI-aware boot loader from //EFI boot partition//. | |
| |
Frankly, there are no compelling reasons not to use CSM (note that it is possible to use [[http://docs.slackware.com/howtos:slackware_admin:installing_with_gpt_without_uefi | GPT partitions without UEFI]]). On the contrary, there are reasons to avoid UEFI booting, because: | ===== Por qué UEFI ===== |
| No es como si hubiera alguna opción; Las máquinas hoy en día son UEFI. Sin embargo, se puede optar por configurar UEFI en el llamado modo "CSM" o, a veces, en "Legacy". En este modo, UEFI actúa como BIOS, es decir, lee el primer sector (MBR) de un disco duro y carga y ejecuta desde allí el cargador de arranque no UEFI, como LILO. A diferencia de UEFI en, digamos, el modo UEFI, cuando lee, carga y ejecuta el cargador de arranque compatible con UEFI desde // partición de arranque EFI //. |
| |
* On some machines, it is not possible to turn off secure boot without also turning off UEFI booting (i.e. without turning on CSM). | Francamente, no hay razones de peso para no usar CSM (tenga en cuenta que es posible usar [[http://docs.slackware.com/howtos:slackware_admin:installing_with_gpt_without_uefi | GPT partitions without UEFI]]. Por el contrario, hay razones para evitar el arranque UEFI, porque: |
* On some machines, it is possible to turn off secure boot, but anything but what came with the machine will not boot anyway. | |
* On some machines, UEFI tries really hard to boot Windows and ignores or resets boot order. | |
* On some machines, installing Linux in UEFI mode may brick the machine. | |
| |
But, as with LILO, the day may come we will need to move on. | * En algunas máquinas, no es posible desactivar el inicio seguro sin desactivar también el inicio UEFI (es decir, sin activar CSM). |
| * En algunas máquinas, es posible desactivar el arranque seguro, pero todo lo que venga con la máquina no se iniciará de todos modos. |
| * En algunas máquinas, UEFI intenta realmente iniciar Windows e ignora o restablece el orden de inicio. |
| * En algunas máquinas, la instalación de Linux en modo UEFI puede bloquear la máquina. |
| |
| Pero, al igual que con LILO, puede que llegue el día en que tengamos que seguir adelante. |
| |
===== Installation ===== | |
There are basically two steps: first, preferably before you even install Slackware, partition the disk using [[https://en.wikipedia.org/wiki/GUID_Partition_Table | GPT]] and create EFI boot partition, second, compile and install SYSLINUX. | |
| |
But before you begin: | ===== Instalación ===== |
* back up your data, if you have anything of value on any of drives in the machine | Básicamente, hay dos pasos: primero, preferiblemente incluso antes de instalar Slackware, particione el disco usando [[https://en.wikipedia.org/wiki/GUID_Partition_Table | GPT]] y cree una partición de arranque EFI, luego compile e instale SYSLINUX. |
* boot to UEFI setup ("BIOS") and verify that boot method is set to "UEFI", not "CMS" or "Legacy" | |
* and also that Secure Boot is turned off | |
| |
==== Create EFI Boot Partition ==== | Pero antes de empezar: |
It is the place where UEFI will look for a boot loader. Several tools can be used to partition a drive and create EFI boot partition,: | * haga una copia de seguridad de sus datos, si tiene algo de valor en cualquiera de las unidades en la máquina |
* cfdisk (new versions; older do just DOS partitions) | * inicie con la configuración de UEFI ("BIOS") y verifique que el método de inicio esté establecido en "UEFI", no en "CMS" o "Legacy" |
* gdisk, an interactive tool and GPT counterpart to fdisk | * y también que el arranque seguro está desactivado |
* cgdisk, a menu-based tool and GPT counterpart to cfdisk | |
* sgdisk, apparently scriptable version of gdisk | |
| |
Let's assume you have empty 10GB drive /dev/sda. | ==== Crear partición de arranque EFI ==== |
| Es el lugar donde UEFI buscará un cargador de arranque. Se pueden usar varias herramientas para particionar una unidad y crear una partición de arranque EFI,: |
| * cfdisk (nuevas versiones; viejas hacen solo particiones DOS) |
| * gdisk, Una herramienta interactiva y contraparte de GPT para fdisk. |
| * cgdisk, una herramienta basada en menú y GPT equivalente a cfdisk |
| * sgdisk, versión aparentemente programable de gdisk |
| |
* Just in case, erase all previous MBR or GPT partitions. | Supongamos que tienes 10 GB de disco vacío /dev/sda. |
| |
| * Por si acaso, borre todas las particiones anteriores de MBR o GPT. |
<code> | <code> |
# sgdisk -Z /dev/sda | # sgdisk -Z /dev/sda |
</code> | </code> |
| |
* Verify the drive is clean. | * Verifique que la unidad esté limpia. |
<code> | <code> |
# gdisk -l /dev/sda | # gdisk -l /dev/sda |
</code> | </code> |
| |
* Partition the drive (using sgdisk or any above mentioned tool). Three partitions will be created, one for EFI, one for data and one for swap. | * Particione la unidad (utilizando sgdisk o cualquier herramienta mencionada anteriormente). Se crearán tres particiones, una para EFI, una para datos y otra para intercambio. |
<code> | <code> |
# sgdisk -n 1:0:+512M /dev/sda | # sgdisk -n 1:0:+512M /dev/sda |
</code> | </code> |
| |
* Do not forget to set correct partition codes. EFI boot partitions has code 'ef00'. | * No te olvides de configurar los códigos de partición correctos. Particiones de arranque EFI tiene código 'ef00'. |
<code> | <code> |
# sgdisk -t 1:ef00 /dev/sda | # sgdisk -t 1:ef00 /dev/sda |
</code> | </code> |
| |
* Verify layout. | * Verificar diseño. |
<code> | <code> |
# gdisk -l /dev/sda | # gdisk -l /dev/sda |
</code> | </code> |
| |
* Create FAT32 filesystem on EFI boot partition. | * Crear un sistema de archivos FAT32 en la partición de arranque EFI. |
<code> | <code> |
# mkfs.vfat -F 32 /dev/sda1 | # mkfs.vfat -F 32 /dev/sda1 |
</code> | </code> |
| |
That is pretty much it for EFI boot partition. You can do whatever you like with /dev/sda2 (RAID, LUKS, LVM, any filesystem) and install Slackware there, but leave EFI partition alone, that partition needs to be unencrypted and FAT32 formatted. | Eso es más o menos para la partición de arranque EFI. Puede hacer lo que quiera con /dev/sda2 (RAID, LUKS, LVM, cualquier sistema de archivos) e instalar Slackware allí, pero deje la partición EFI sola, esa partición debe estar sin cifrar y el formato FAT32. |
| |
| |
==== Set up SYSLINUX ==== | ==== Preparar SYSLINUX ==== |
=== Compilation === | === Compilación === |
Download [[https://www.kernel.org/pub/linux/utils/boot/syslinux/ | sources]] and compile. | Descarguelo desde [[https://www.kernel.org/pub/linux/utils/boot/syslinux/ | sources]] y compile. |
| |
<code> | <code> |
| |
| |
=== Set up boot loader === | === Configurar el cargador de arranque === |
Now copy the boot loader and a few modules, as well as kernel and initrd to EFI boot partition created earlier. Let's asssume /dev/sda1 is mounted as /boot/efi. | Ahora copie el cargador de arranque y algunos módulos, así como el kernel y initrd a la partición de arranque EFI creada anteriormente. Supongamos que /dev/sda1 está montado como /boot/efi. |
| |
* Copy the boot loader and a module for loading Linux. That is the bare minimum. And double check you are copying efi64 files. | * Copie el cargador de arranque y un módulo para cargar Linux. Eso es lo mínimo. Y vuelve a comprobar que estás copiando archivos efi64. |
<code> | <code> |
# cd /boot/efi | # cd /boot/efi |
</code> | </code> |
| |
* Copy some other modules, e.g. for creating cute boot menu. For full list of modules and dependencies, see [[http://www.syslinux.org/wiki/index.php?title=Library_modules | the list]]. | * Copia algunos otros módulos, por ej. para crear un lindo menú de arranque. Para ver la lista completa de módulos y dependencias, consulte [[http://www.syslinux.org/wiki/index.php?title=Library_modules | the list]]. |
<code> | <code> |
# cp /some/where/usr/share/syslinux/efi64/libutil.c32 . | # cp /some/where/usr/share/syslinux/efi64/libutil.c32 . |
</code> | </code> |
| |
* Create configuration file /boot/efi/EFI/SYSLINUX/syslinux.cfg. Bellow is an example of simple boot menu with two items. | * Cree el archivo de configuración /boot/efi/EFI/SYSLINUX/syslinux.cfg. A continuación se muestra un ejemplo de menú de arranque simple con dos elementos. |
* ''TIMEOUT 100'' tells the boot loader to wait 100 hundredths of second, i.e. 10 seconds for user input. | * ''TIMEOUT 100'' le dice al cargador de arranque que espere 100 centésimas de segundo, es decir, 10 segundos para la entrada del usuario. |
* If user selects nothing within 10 seconds, whatever is set as ''DEFAULT'' will be launched. | * Si el usuario no selecciona nada en 10 segundos, lo que esté configurado como ''DEFAULT'' se pondrá en marcha. |
* The first menu entry is Slackware 14.2. | * La primera entrada del menú es Slackware 14.2.. |
* ''LABEL'' is a name that can be used for ''DEFAULT''. | * ''LABEL'' es un nombre que puede ser usado para ''DEFAULT''. |
* ''MENU LABEL'' is a description. | * ''MENU LABEL'' es una descripción. |
* ''LINUX vmlinuz-huge-4.4.14'' tells the boot loader to boot kernel vmlinuz-4.4.14 from the same directory (i.e. EFI\SYSLINUX\vmlinuz-4.4.14) | * ''LINUX vmlinuz-huge-4.4.14'' le dice al cargador de arranque que arranque el kernel vmlinuz-4.4.14 desde el mismo directorio (es decir, EFI\SYSLINUX\vmlinuz-4.4.14) |
* ''APPEND /dev/vgroot/V_ROOT 4'' is kernel command line telling the kernel to mount /dev/vgroot/V_ROOT as / (root). Obviously that is a logical volume in this case, but it could be e.g. plain /dev/sda2. The second argument, '4', will be in fact passed by kernel to init, which will start to runlevel 4 instead of default 3 (as per /etc/inittab), i.e. will start to graphical multi-user mode with X window system. | * ''APPEND /dev/vgroot/V_ROOT 4'' es la línea de comando del kernel que le dice al kernel que monte /dev/vgroot/V_ROOT como / (root). Obviamente, este es un volumen lógico en este caso, pero podría ser, por ejemplo, /dev/sda2. El segundo argumento, '4', de hecho pasará de kernel a init, que comenzará a ejecutar el nivel de ejecución 4 en lugar del predeterminado 3 (según /etc/inittab), es decir, comenzará al modo multiusuario gráfico con el sistema de ventanas X . |
* ''INITRD initrd.gz-4.4.14'' is an initrd image that is mounted as temporary / before the final / is mounted. Typically, an initrd is needed if kernel has to load some additional modules to access the root device, or has to perform some actions to make it accessible (think of RAID, LUKS, LVM). If you do not need initrd, simply delete this line. | * ''INITRD initrd.gz-4.4.14'' es una imagen initrd que se monta como temporal / antes de que se monte / final. Normalmente, se necesita un initrd si el kernel tiene que cargar algunos módulos adicionales para acceder al dispositivo raíz, o tiene que realizar algunas acciones para hacerlo accesible (piense en RAID, LUKS, LVM). Si no necesita initrd, simplemente elimine esta línea. |
* The second menu entry is largely the same, except that there is no '4' in ''APPEND /dev/vgroot/V_ROOT''. Simply put, this is non-graphical safe mode. If X window system fails to start for whatever reason, you may end up with not only black screen, but also blocked keyboard and mouse and therefore unable to fix the cause. So it is a good idea to have this option prepared beforehand (another method to use otherwise unusable machine with broken X is to SSH-in, though it is a less reliable method). | * TLa segunda entrada del menú es prácticamente la misma, excepto que no hay '4' en '' APPEND /dev/vgroot/V_ROOT ''. En pocas palabras, este es un modo seguro no gráfico. Si el sistema de ventanas X no se inicia por cualquier motivo, puede terminar no solo con la pantalla negra, sino también con el teclado y el mouse bloqueados y, por lo tanto, no puede arreglar la causa. Por lo tanto, es una buena idea tener esta opción preparada de antemano (otro método para usar una máquina inutilizable con una X rota es la entrada SSH, aunque es un método menos confiable) |
<file - /boot/efi/EFI/SYSLINUX/syslinux.cfg> | <file - /boot/efi/EFI/SYSLINUX/syslinux.cfg> |
UI menu.c32 | UI menu.c32 |
</file> | </file> |
| |
* Still in /boot/efi/EFI/SYSLINUX, copy kernel here. Huge is the safer option. Generic may require initrd and more modules in it. If you do not know which they are, the machine might not boot, so go with the huge. | * Aún en /boot/efi/EFI/SYSLINUX, copie el kernel aquí. Huge es la opción más segura. El genérico puede requerir initrd y más módulos en él. Si no sabe cuáles son, es posible que la máquina no arranque, así que vaya con la huge. |
<code> | <code> |
# cp /boot/vmlinuz-huge-4.4.14 . | # cp /boot/vmlinuz-huge-4.4.14 . |
</code> | </code> |
| |
* Create initrd if needed and copy here too. Man for options, but basically the command bellow creates an initrd that will contain some USB-related modules to enable keyboard input (because /dev/sda2 is encrypted (LUKS) and user will have to type in a passphrase). | * Cree initrd si es necesario y copie aquí también. ejecute man para las opciones, pero básicamente el siguiente comando crea un initrd que contendrá algunos módulos relacionados con USB para habilitar la entrada del teclado (porque /dev/sda2 está cifrado (LUKS) y el usuario tendrá que escribir una frase de contraseña). |
<code> | <code> |
# mkinitrd -c -k 4.4.14 -C /dev/sda2 -L -R -f xfs -m xfs:hid:hid-generic:usbhid:xhci-hcd:xhci-pci:ehci-hcd:ehci-pci:ohci-hcd:ohci-pci:uhci-hcd:uhci-pci:usb-storage -r /dev/vgroot/V_ROOT -o /boot/initrd.gz-4.4.14 | # mkinitrd -c -k 4.4.14 -C /dev/sda2 -L -R -f xfs -m xfs:hid:hid-generic:usbhid:xhci-hcd:xhci-pci:ehci-hcd:ehci-pci:ohci-hcd:ohci-pci:uhci-hcd:uhci-pci:usb-storage -r /dev/vgroot/V_ROOT -o /boot/initrd.gz-4.4.14 |
</code> | </code> |
| |
* Finally, add SYSLINUX to UEFI boot menu. Note that there will be in fact two boot menus. The first is UEFI boot menu that will typically onyl show up if you press some key (e.g. F12 on Dell, F9 on HP, F11 with AsRock mainboard, often just Esc) and will present you with a list of devices or boot loaders to boot. Depending on how crappy your UEFI is, SYSLINUX may or may not show up there. | * Finalmente, agregue SYSLINUX al menú de arranque de UEFI. Tenga en cuenta que de hecho habrá dos menús de arranque. El primero es el menú de arranque UEFI que normalmente se mostrará solo si presiona alguna tecla (por ejemplo, F12 en Dell, F9 en HP, F11 con la placa base AsRock, a menudo solo Esc) y le presentará una lista de dispositivos o cargadores de arranque para que arranque . Dependiendo de qué tan malo sea tu UEFI, SYSLINUX puede o no aparecer allí. |
The second boot menu is that of SYSLINUX, i.e. what you typed to syslinux.cfg and will show up either if you do not tigger UEFI boot menu or trigger it and then select either SYSLINUX or device (hard drive) it is on. | El segundo menú de inicio es el de SYSLINUX, es decir, lo que escribió en syslinux.cfg y aparecerá si no activa el menú de inicio de UEFI o lo activa y luego selecciona SYSLINUX o dispositivo (disco duro) en el que está activado. |
<code> | <code> |
# efibootmgr -c -d /dev/sda -p 1 -l \\EFI\\SYSLINUX\\syslinux.efi -L "SYSLINUX" | # efibootmgr -c -d /dev/sda -p 1 -l \\EFI\\SYSLINUX\\syslinux.efi -L "SYSLINUX" |
</code> | </code> |
| |
* Syslinux has been added with code 0000 (Boot0000) and is 1st in boot order. If it was not, order would have to changed: | * Syslinux se ha agregado con el código 0000 (Boot0000) y es el primero en el orden de arranque. Si no fuera así, habría que cambiar el orden: |
<code> | <code> |
# efibootmgr -o 0000,0001,0002 | # efibootmgr -o 0000,0001,0002 |
</code> | </code> |
| |
* On some machines, it may be possible to change order also in UEFI (meaning its GUI/setup utility). | * En algunas máquinas, puede ser posible cambiar el orden también en UEFI (es decir, su GUI / utilidad de configuración). |
| |
| |
==== Troubleshooting ==== | ==== Solución de problemas ==== |
If your machine complains it has nothing to boot, that may indicate efibootmgr command was incorrect or somehow did not register. You may then try to force it to boot SYSLINUX by moving and renaming it to EFI\Boot\bootx64.efi, which is kind of fallback option; the machine will try to boot that at some point. | Si su máquina se queja, no tiene nada que arrancar, eso puede indicar que el comando efibootmgr fue incorrecto o de alguna manera no se registró. Luego, puede intentar forzarlo para que inicie SYSLINUX moviéndolo y cambiándolo de nombre a EFI \ Boot \ bootx64.efi, que es una opción alternativa; La máquina intentará arrancar eso en algún momento. |
| |
<code> | <code> |