Triple-dash for linux kernel command line

I am trying to add a switch to send the Linux kernel log to the serial console on XenServer6.

The kernel command parameters can be edited in the EXTLinux configuration file ( /boot/extlinux.conf ).

Here is an excerpt:

 serial 1 115200 default xe prompt 1 timeout 50 label xe # XenServer kernel mboot.c32 append /boot/xen.gz mem=1024G dom0_max_vcpus=4 dom0_mem=752M lowmem_emergency_pool=1M crashkernel=64M@32M console= vga=mode-0x0311 --- /boot/vmlinuz-2.6-xen root=LABEL=root-tfnnfzfp ro xencons=hvc com2=115200,8n1 console=com2 console=hvc0 console=tty0 quiet vga=785 splash --- /boot/initrd-2.6-xen.img label xe-serial # XenServer (Serial) kernel mboot.c32 append /boot/xen.gz com1=115200,8n1 console=com1,vga mem=1024G dom0_max_vcpus=4 dom0_mem=752M lowmem_emergency_pool=1M crashkernel=64M@32M --- /boot/vmlinuz-2.6-xen root=LABEL=root-tfnnfzfp ro console=tty0 xencons=hvc console=hvc0 --- /boot/initrd-2.6-xen.img 

What is the meaning of triple dashes ( --- ) on the command line?

Does 3 boot files load?

+4
source share
1 answer

TL DR Yes, it is. ExtLinux should load both Xen and the Linux kernel. For this, mboot.c32 is used. --- Separates the Xen image path and its command line from the Linux image path and its command line.

This is how ExtLinux (indeed, all boot loaders in SysLinux ) implements the multitasking required to boot Xen.

Most simple boot configurations load only the kernel. There, which the bootloader loads on the command line, where you expect this. In the style of Syslinux:

 label Simple kernel linux.c32 append <linux kernel filename> <linux command line> 

Or in Grub:

 title Simple Boot root (hd0,0) kernel <linux kernel filename> <linux command line> 

More complex boot configurations can load the Xen boot and kernel. They use a system called "multiboot", which loads both and gives them each their own command line. This allows Xen to transfer its commands and Linux its commands. You can even go to another stage to load something else, like the initial ramdisk. In the style of SysLinux:

 label Complex kernel mboot.32 append <xen kernel filename> <xen command line> --- <linux kernel filename> <kernel command line> --- <initrd filename> 

Or in Grub:

 label Complex Boot kernel <xen kernel filename> <xen command line> module <linux kernel filename> <linux command line> module <initrd filename> 

If you used grub, this is actually indicated in their own stanzas. Grub acts as a kind of superloader, since it can be loaded with many small modules for functions such as multiboot (or different file systems, etc.). In this case, Grub does most of this magic without knowing.

Syslinux and family share work in different ways. Instead of having one giant bootloader that should handle all situations, they have two layers that have many different parts. At the top, they have a main bootloader that knows that the system boots it (i.e. syslinux knows the BIOS boot with files in the FAT file system, pxelinux knows that it loads things over the network, isolinux knows how to load files from the CD and etc.). Extlinux is the only one that knows how to boot from the Ext2, Ext3, Ext4 or BTRFS file system.

Other common functions are implemented as “comboot” modules that can connect to any of the bootloaders. For instance:

In the case of multiboot, they load the mboot.c32 module, which implements multitasking. Unlike Grub and the family (who know about several command lines), syslinux should include all modules and their command lines on the same command line. Since - is often used as an argument separator in other programs, they decided to use --- to distinguish between modules.

In this case, Xen requires multitasking, which requires the syntax to separate command lines for the Xen Hypervisor kernel and the Linux kernel, which runs as its first privileged guest.

+6
source

All Articles