Changes between Version 13 and Version 14 of RpmHowToPackagers
- Timestamp:
- Aug 24, 2011, 11:33:48 PM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
RpmHowToPackagers
v13 v14 127 127 It 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. 128 128 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 s ame 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.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 similar logic). 130 130 {{{ 131 131 %post 132 %cube {ADDLINE "DEVICE=%UNIXROOT%\usr\%{_lib}\mydrv.sys" (AFTER "DEVICE="} %{os2_config_sys} %{os2_config_sys}.yum>nul132 %cube {ADDLINE "DEVICE=%UNIXROOT%\usr\%{_lib}\mydrv.sys" (AFTER "DEVICE="} %{os2_config_sys} >nul 133 133 %cube {ADDLINE "SET MYENVVAR=myvalue" (AFTER "SET "} %{os2_config_sys} >nul 134 134 echo; echo "NOTE:"