Difference between revisions of "Ifcpu.c32"

From Syslinux Wiki
Jump to: navigation, search
(Updating ifcpu)
m (Minor misc. changes.)
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
 
[[Category:Comboot]]
 
[[Category:Comboot]]
[[Category:Move To Scripting Engine]]
+
[[Category:Examples]]
 +
[[Category:Modules]]
 +
'''ifcpu.c32''' is a comboot module for Syslinux that checks some CPU flags
 +
and loads the appropriate label in a Syslinux configuration file.
  
= About =
+
This module is available in Syslinux 3.84 or later.
'''ifcpu.c32''' is a comboot module for Syslinux that checks some CPU flags and loads the appropriate label in a pxelinux.cfg file.
+
Some options were added in later versions.
  
This is only available in Syslinux 3.84 or later.
+
== Requirements ==
 
+
= Requirements =  
+
 
* working Syslinux environment
 
* working Syslinux environment
* two booting entry
+
* two booting entries (labels)
  
= Syntax =  
+
== Syntax ==
  ifcpu.c32 <options> <cpu_features> -- first_label -- second_label
+
{|
 +
|
 +
  ifcpu.c32 <''options''> <''cpu_features''> -- ''first_label'' -- ''second_label''
 +
|}
  
if the <cpu_features> match the current host, first_label is loaded, else let's boot second_label.
+
When <tt>ifcpu.c32</tt> is used with no additional parameters, the usage help is printed.
  
The use of '''--''' is required!
+
If the <tt>''cpu_features''</tt> match the current host,
 +
then <tt>''first_label''</tt> is loaded,
 +
else let's boot <tt>''second_label''</tt>.
 +
 
 +
The use of "<code>'''--'''</code>" is required!
  
 
== Options ==
 
== Options ==
*    debug     : display some debugging messages
+
; debug
*    dry-run   : just do the detection, don't boot
+
: display some debugging messages
 +
; dry-run
 +
: just do the detection, don't boot
  
 
== CPU Features ==
 
== CPU Features ==
*    64       : CPU have to be x86_64 compatible
+
; 64
*    hvm       : Processor must have hardware virtualization (hvm or svm)
+
: CPU has to be x86_64 compatible
*    multicore : Processor must be multi-core
+
; hvm
*    smp       : System have to be SMP
+
: Processor must have hardware virtualization (hvm or svm)
if you want to match many cpu features, just separate them with a single space
+
; hypervisor
 +
: Processor is running under an hypervisor
 +
; multicore
 +
: Processor must be multi-core
 +
; pae
 +
: Processor features Physical Address Extension (PAE)
 +
; smp
 +
: System has to be SMP
 +
 
 +
If you want to match several cpu features, just separate them with a single space.
  
 
== Example ==
 
== Example ==
Here is an example pxelinux.cfg file for booting
+
{|
 +
|
 
<pre>
 
<pre>
    label test
+
LABEL test
        com32 ifcpu.c32
+
COM32 ifcpu.c32
        append 64 hvm multicore -- boot_entry_1 -- boot_entry_2
+
APPEND 64 hvm multicore -- boot_entry_1 -- boot_entry_2
    label boot_entry_1
+
LABEL boot_entry_1
        kernel vmlinuz
+
KERNEL vmlinuz_64
        append ...
+
APPEND ...
    label boot_entry_2
+
LABEL boot_entry_2
        kernel vmlinuz_64
+
KERNEL vmlinuz
        append ...
+
APPEND ...
 
+
 
</pre>
 
</pre>
 +
|}
  
= Further Reading =
+
== See Also ==
None
+
* [[Ifcpu64.c32]]: Detection of 64bits capable CPUs

Latest revision as of 05:52, 15 June 2019

ifcpu.c32 is a comboot module for Syslinux that checks some CPU flags and loads the appropriate label in a Syslinux configuration file.

This module is available in Syslinux 3.84 or later. Some options were added in later versions.

Requirements

  • working Syslinux environment
  • two booting entries (labels)

Syntax

ifcpu.c32 <options> <cpu_features> -- first_label -- second_label

When ifcpu.c32 is used with no additional parameters, the usage help is printed.

If the cpu_features match the current host, then first_label is loaded, else let's boot second_label.

The use of "--" is required!

Options

debug
display some debugging messages
dry-run
just do the detection, don't boot

CPU Features

64
CPU has to be x86_64 compatible
hvm
Processor must have hardware virtualization (hvm or svm)
hypervisor
Processor is running under an hypervisor
multicore
Processor must be multi-core
pae
Processor features Physical Address Extension (PAE)
smp
System has to be SMP

If you want to match several cpu features, just separate them with a single space.

Example

LABEL test
 COM32 ifcpu.c32
 APPEND 64 hvm multicore -- boot_entry_1 -- boot_entry_2
LABEL boot_entry_1
 KERNEL vmlinuz_64
 APPEND ...
LABEL boot_entry_2
 KERNEL vmlinuz
 APPEND ...

See Also