Specifying variables for future use

6.10 LPAR mode z/VM guest KVM guest

You can extend a zipl environment file to include keywords that are not used yet, but can be in the future.

About this task

You can add keywords for future use by setting them to empty strings. Using such reserved keywords helps you avoid boot record re-installation in the future, when you want to add more parameters to the kernel command line.

Procedure

  1. Assume the same command line as before:
    root=/dev/dasda1 panic=9
    
    To add a variable that can be used in the future, add one or more variables to the command line, for example ${MYVARIABLE_1} ${MYVARIABLE_2}:
    root=/dev/dasda1 panic=9 ${MYVARIABLE_1} ${MYVARIABLE_2}

    Ensure that all variables are separated by blanks from other variables.

  2. Use a zipl environment file to set values for the keywords.
    You now need to define keyword-value pairs for these variables in a zipl environment file. Keyword-value pairs set to the empty string resolve to the empty string until you define values for them:
    # cat /etc/ziplenv
    root=/dev/dasda1
    panic=9
    MYVARIABLE_1=
    MYVARIABLE_2=
  3. Run zipl to install a boot configuration.
  4. Reboot with the prepared boot configuration, and log in.
    Display the command line that was used for the currently running Linux instance. You notice that the original command line is unchanged:
    # cat /proc/cmdline
    root=/dev/dasda1 panic=9 ...

Results

The original installation works as before, but you can now use zipl-editenv to assign a value in the zipl environment block for a specific IPL device. For example:
# zipl-editenv --set MYVARIABLE_1=console=ttyS1
# zipl-editenv --list
root=/dev/dasda1
panic=9
MYVARIABLE_1=console=ttyS1 
MYVARIABLE_2=

The value for a reserved keyword must be the complete kernel parameter specification. For many kernel parameters this is a <parameter>=<parameter_value> pair, for example panic=9.

After rebooting, you can see that the new value was applied to the installation as it shows up in the command line:
# cat /proc/cmdline
root=/dev/dasda1 panic=9 console=ttyS1 ...