Now, to figure out how to do that with commands, which can be done after the WPS is active (preferably BEFORE the drive gets used), but even better would be BEFORE the WPS gets started.
Well, that was an interesting adventure.
The LVM drive letter cannot just be hidden, and restored. It must be changed to something else, then changed back. This must also be done AFTER the WPS has started, or it gets ignored by the WPS. The format can be done BEFORE the WPS has started.
I want the RAMDISK to have letter R:, and be formatted as JFS, so my solution is:
In QSSETUP.CMD (root of the boot drive):
RAMDISK R:
MD C:\TEMP
log save c:\log.txt
RAMDISK R: makes a default size RAMDISK (only memory above 4 GB), and gives it LVM letter R:.
MD C:\TEMP makes a directory on that RAMDISK (remember that this command file works in the QSINIT shell, so the RAMDISK letter is C: )
log save c:\log.txt saves the log file to the RAMDISK (I need a file on the disk, to prevent a problem later on).
Next, I need a way to do the format to either HPFS, or JFS. I do that with makeR.CMD, which contains:
COPY R:\* M:\RTRACKER
FORMAT.COM R: /FS:JFS /V:RAMDISK < RAMFMTRESP.TXT
md R:\TEMP
COPY R:\* M:\RTRACKER This copies the files from the root of the RAMDISK to a directory RTRACKER (which must exist). I do this for two reasons: 1) to be able to transfer files from the shell to OS/2. 2) If there is no file, the boot will stop demanding an Enter.
FORMAT.COM R: /FS:JFS /V:RAMDISK < RAMFMTRESP.TXT This does the format to JFS, in this case, and adds a volume label. (Simply substitute HPFS for JFS, if you wish to use HPFS.) RAMFMTRESP.TXT contains the single letter "Y" (without the quotes) as the first letter in the first line, followed by a blank line (this automatically responds Yes to the format command).
md R:\TEMP
Since the drive was formatted, I need to restore the contents. Here i simply make a directory. You could UNZIP a fixed set of files, and directories, if you wish. REMEMBER that all of this will go away with a system shutdown, or crash.
Next, I put the lines:
CALL=C:\OS2\CMD.EXE /Q /C C:\makeR.cmd
SET tmp=r:\temp
SET temp=r:\temp
SET tmpdir=r:\temp
at the end of CONFIG.SYS.
CALL=C:\OS2\CMD.EXE /Q /C C:\makeR.cmd runs makeR.CMD, as described above.
The SET commands should replace any that may already exist, for those environment variables (you may want to make sure that it all works, before actually trying to use it for %TEMP%).
Now, for the part that makes it work properly:
At the beginning of STARTUP.CMD (the file may not exist, if not, create it). I put:
lvm /driveletter:[ Vol.00 ],X:
lvm /driveletter:[ Vol.00 ],R:
<whatever else you have/need in STARTUP.CMD>
lvm /driveletter:[ Vol.00 ],X: This changes the RAMDRIVE letter to X:, which is a drive letter that I use,
but it must never exist at boot time. Note the spaces in "[ Vol.00 ]".
lvm /driveletter:[ Vol.00 ],R: This changes the RAMDISK letter back to R:, which causes a new drive mount, which resolves the previous discrepancies.
Note, that I cannot just assign a different drive letter (X:) when QSINIT makes the drive, and then change it to the final letter (R:) to mount the drive. That works okay, BUT if I do that the SET variables won't be assigned when CONFIG.SYS is executed, and they will demand an Enter because the drive doesn't exist. If the variables are assigned, after the WPS starts (in STARTUP.CMD), they are not set in the permanent environment. The double drive letter change is the easiest way around that, that I have found.
It is somewhat messy, but it works properly (I think). Any suggestions, or comments are welcome.