Difference between revisions of "Whichsys.c32"

From Syslinux Wiki
Jump to: navigation, search
m
m (Examples: More alternatives and additional examples)
Line 15: Line 15:
 
whichsys.c32 -iso- chain.c32 hd0 -sys- chain.c32 hd1 swap
 
whichsys.c32 -iso- chain.c32 hd0 -sys- chain.c32 hd1 swap
 
</pre>
 
</pre>
 +
<pre>
 +
COM32 whichsys.c32
 +
APPEND -iso- chain.c32 hd0 -sys- chain.c32 hd1 swap
 +
</pre>
 +
<pre>
 +
COM32 whichsys.c32
 +
APPEND -iso- localboot.c32 -1 -sys- chain.c32 hd1 swap
 +
</pre>
 +
 
Load a specifc config file for each bootloader:
 
Load a specifc config file for each bootloader:
 
<pre>
 
<pre>
 
whichsys.c32 -iso- config iso.cfg -sys- config sys.cfg -pxe- config pxe.cfg
 
whichsys.c32 -iso- config iso.cfg -sys- config sys.cfg -pxe- config pxe.cfg
 
</pre>
 
</pre>
 +
<pre>
 +
COM32 whichsys.c32
 +
APPEND -sys- config.c32 sys.cfg -iso- config.c32 iso.cfg
 +
</pre>
 +
<pre>
 +
COM32 whichsys.c32
 +
APPEND -ext- COM32 config.c32 <path/to/>ext.cfg -iso- COM32 config.c32 <path/to/>iso.cfg
 +
</pre>
 +
 +
Load a specifc LABEL entry (from the same config file) for each bootloader:
 +
<pre>
 +
COM32 whichsys.c32
 +
APPEND -sys- label4sys -iso- label4iso
 +
</pre>
 +
where "label4sys" and "label4iso" are additional LABEL entries in the same "cfg" file as the whichsys.c32 statement.

Revision as of 02:00, 2 June 2012


About

whichsys.c32 is a COM32 module for Syslinux that determines which command to execute, based on the Syslinux bootloader variant from which it is run.

It is only available in Syslinux 4.02 or later.

Usage

Usage:    whichsys.c32 [-iso- command] [-pxe- command] [-sys- command]

Examples

Boot the first hard disk when booted from ISOLINUX, boot the second hard disk (internal hard disk when your USB drive is detected as hard disk 1 by the BIOS) and swap drive numbers when booted from SYSLINUX:

whichsys.c32 -iso- chain.c32 hd0 -sys- chain.c32 hd1 swap
COM32 whichsys.c32
APPEND -iso- chain.c32 hd0 -sys- chain.c32 hd1 swap
COM32 whichsys.c32
APPEND -iso- localboot.c32 -1 -sys- chain.c32 hd1 swap 

Load a specifc config file for each bootloader:

whichsys.c32 -iso- config iso.cfg -sys- config sys.cfg -pxe- config pxe.cfg
COM32 whichsys.c32
APPEND -sys- config.c32 sys.cfg -iso- config.c32 iso.cfg
COM32 whichsys.c32
APPEND -ext- COM32 config.c32 <path/to/>ext.cfg -iso- COM32 config.c32 <path/to/>iso.cfg

Load a specifc LABEL entry (from the same config file) for each bootloader:

COM32 whichsys.c32
APPEND -sys- label4sys -iso- label4iso

where "label4sys" and "label4iso" are additional LABEL entries in the same "cfg" file as the whichsys.c32 statement.