Commit c93d5dcb authored by Franco Fichtner's avatar Franco Fichtner

rc: employ the same write probe trick for early installer menu

parent bd772534
...@@ -29,6 +29,24 @@ ...@@ -29,6 +29,24 @@
POSSIBILITY OF SUCH DAMAGE. POSSIBILITY OF SUCH DAMAGE.
*/ */
function is_install_media()
{
/*
* Despite unionfs underneath, / is still not writeable,
* making the following the perfect test for install media.
*/
$file = '/.probe.for.install.media';
$fd = @fopen($file, 'w');
if ($fd) {
fclose($fd);
unlink($file);
return false;
}
return true;
}
function rescue_detect_keypress() function rescue_detect_keypress()
{ {
$timeout = 9; $timeout = 9;
...@@ -141,8 +159,8 @@ set_device_perms(); ...@@ -141,8 +159,8 @@ set_device_perms();
unmute_kernel_msgs(); unmute_kernel_msgs();
echo "done.\n"; echo "done.\n";
// Display rescue configuration option /* Display live system's early boot options */
if ($g['platform'] == 'cdrom') { if (is_install_media()) {
rescue_detect_keypress(); rescue_detect_keypress();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment