2. One of the first things I do with each new "I think I'll keep this one" installation is to edit rc.shutdown (in /etc/rc.d) and add an 'eject' statement at the bottom. This enables me to remove the CD I forget was still in the tray. Otherwise I have to power up just to take it out which often means aborting a boot-up. Is this A Bad Idea for deep and mysterious Linux reasons, or is it An OK Idea? If it's the latter could it go into the release?
I don't know if there's a good reason not to. If it were to be done, two things would need to be done first:
1: Make sure the CD is unmounted (probably previous code has handled this already)
2: Only eject if Puppy was actually run from the cd. This can be done by checking the PMEDIA variable. If it equals "usbcd" or "cd", then eject.
Another thing is that a lot of people probably
don't want Puppy to eject their CD when they get done, because they always boot it, but don't want to bother with installing Grub, so they use the CD to boot. So in those cases, ejecting would be bad.
We could have a way to save the preference somewhere, though. The file holding the preference would need to be read up near the top of the script, before the filesystems are unmounted.
But, people who run with pfix=ram all the time don't have a way to save the setting. So maybe an option could be added to the shutdown script asking first, with a ten second timeout, after which it will default to not eject. People who just use Puppy all the time won't need to stick around for the shutdown to finish anyway, so for them it's fine. For people who want their disk out, they need to stick around to retrieve the disk anyway, so having to hit enter an extra time isn't a big issue.
So in summary, if there isn't a good reason not to, we could do this:
*Near the top, load a preference file from somewhere (/etc/eject_on_shutdown?) and store in a variable ($EJECT_ON_SHUTDOWN).
*Near bottom, after all filesystems are unmounted, check the $PMEDIA variable. If "cd" or "usbcd", then:
*if $EJECT_ON_SHUTDOWN not set, or set to ask, display prompt with 5-second timeout, defaulting to no-eject.
*else if set to true, eject.