Changes between Version 13 and Version 14 of RpmHowToPackagers


Ignore:
Timestamp:
Aug 24, 2011, 9:33:48 PM (13 years ago)
Author:
dmik
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • RpmHowToPackagers

    v13 v14  
    127127It is sometimes necessary to modify the CONFIG.SYS file during installation, even when using RPM. One of the examples is when your package installs a device driver that needs to be loaded at boot time or when a global environment variable needs to be set. This can be done from the {{{%post}}} section using the special macro {{{%cube}}} which is based on the CUBE tool.
    128128
    129 For example, this snippet will add a DEVICE= line to CONFIG.SYS after the first DEVICE= line (or to the bottom if there are no DEVICE= statements), add an environment variable (using the same logic) and back up the old CONFIG.SYS file as CONFIG.SYS.YUM. Note that the backup file name is only specified in the __first__ {{{%cube}}} statement since you only need to create the backup file __once__ -- before you start any modifications.
     129For example, this snippet will add a DEVICE= line to CONFIG.SYS after the first DEVICE= line (or to the bottom if there are no DEVICE= statements), add an environment variable (using the similar logic).
    130130{{{
    131131%post
    132 %cube {ADDLINE "DEVICE=%UNIXROOT%\usr\%{_lib}\mydrv.sys" (AFTER "DEVICE="} %{os2_config_sys} %{os2_config_sys}.yum >nul
     132%cube {ADDLINE "DEVICE=%UNIXROOT%\usr\%{_lib}\mydrv.sys" (AFTER "DEVICE="} %{os2_config_sys} >nul
    133133%cube {ADDLINE "SET MYENVVAR=myvalue" (AFTER "SET "} %{os2_config_sys} >nul
    134134echo; echo "NOTE:"