Specifying common variables across multiple boot menu entries

Red Hat Enterprise Linux 8.6 LPAR mode z/VM guest KVM guest

The zipl environment feature is useful in the case of multiple boot menu entries.

Procedure

  1. Create a zipl environment file that holds only the keyword-value pairs for common variables.
    For example:
    # cat /etc/ziplenv
    COMMON=nosmt 
    
  2. Introduce the ${COMMON} variable to the kernel parameters in the boot menu configurations.
    [defaultboot]
    defaultauto
    target=/boot
    
    # First boot configuration (DASD)
    [boot1]
    ramdisk=/boot/initrd
    parameters='root=/dev/ram0 ro ${COMMON}' 
    image=/boot/image-1
    target=/boot
    
    # Second boot configuration (DASD)
    [boot2]
    image=/boot/mnt/image-3
    ramdisk=/boot/mnt/initrd
    parmfile=/boot/mnt/parmf-3
    target=/boot
    
    ...
    For the boot2 configuration section, the parmfile option specifies a kernel parameter file that contains kernel parameters, including the ${COMMON} variable, for example:
    # cat /boot/mnt/parmf-3
    ....
    CRASH=256M
    PANIC_TIMEOUT=panic=8
    ${COMMON} 
    
  3. Call zipl to install multiple boot configurations that include the ${COMMON} variable.
    For example, to make zipl install both boot configuration boot1 and boot2:
    # zipl 
    At boot time, the ${COMMON} variable is replaced by nosmt, as specified in the installed zipl environment block by the keyword COMMON.

Results

The zipl environment block now defines the COMMON keyword:
# zipl-editenv --list
...
COMMON=nosmt

IPL any boot configuration that uses a command line with the ${COMMON} variable, and display the actual command line:

# cat /proc/cmdline
... nosmt ...
To not have nosmt set, first ensure that the environment file does not define the COMMON variable, or defines it as an empty string:
# cat /etc/ziplenv
COMMON=
Then install the boot record.
However, if you do not want to re-install the boot record, you can either set the COMMON variable to the empty string in the already installed zipl environment block:
# zipl-editenv -s COMMON=
# zipl-editenv -l
COMMON=
Or remove it from the zipl environment block:
# zipl-editenv -u COMMON
# zipl-editenv -l