" . gettext("If you would like to boot from this newly duplicated slice please set it using the bootup information area."); $class='alert-success'; } else { $savemsg = gettext("There was an error while duplicating the slice. Operation aborted."); $class='alert-danger'; } // Re-Survey slice info nanobsd_detect_slice_info(); } if ($_POST['changero']) { if (!DEBUG && is_writable("/")) { conf_mount_ro(); } else { conf_mount_rw(); } } if ($_POST['setrw']) { if (!DEBUG) { conf_mount_rw(); if (isset($_POST['nanobsd_force_rw'])) $config['system']['nanobsd_force_rw'] = true; else unset($config['system']['nanobsd_force_rw']); write_config("Changed Permanent Read/Write Setting"); conf_mount_ro(); } else { $savemsg = 'Saved r/w permanently'; $class = 'alert-success'; } } print_info_box("The options on this page are intended for use by advanced users only."); if ($savemsg) print_info_box($savemsg, $class); require_once('classes/Form.class.php'); $form = new Form(false); $section = new Form_Section('NanoBSD Option'); $section->addInput(new Form_StaticText( 'Image Size', $NANOBSD_SIZE )); $slicebtn = new Form_Button('bootslice', 'Switch Slice'); $slicebtn->removeClass('btn-primary')->addClass('btn-default btn-sm'); $section->addInput(new Form_StaticText( 'Bootup slice', $ACTIVE_SLICE . ' ' . $slicebtn )); if (is_writable("/")) { $refcount = refcount_read(1000); /* refcount_read returns -1 when shared memory section does not exist */ /* refcount can be zero here when the user has set nanobsd_force_rw */ /* refcount 1 is normal, so only display the count for abnormal values */ if ($refcount == 1 || $refcount == 0 || $refcount == -1) { $refdisplay = ""; } else { $refdisplay = " (Reference count " . $refcount . ")"; } $lbl = gettext("Read/Write") . $refdisplay; if (!isset($config['system']['nanobsd_force_rw'])) $btnlbl = gettext("Switch to Read-Only"); } else { $lbl = gettext("Read-Only"); if (!isset($config['system']['nanobsd_force_rw'])) $btnlbl = gettext("Switch to Read/Write"); } $robtn = new Form_Button('changero', $btnlbl); $robtn->removeClass('btn-primary')->addClass('btn-default btn-sm'); $section->addInput(new Form_StaticText( 'Read/Write status', $lbl . ' ' . $robtn )); $section->addInput(new Form_Checkbox( 'nanobsd_force_rw', 'Permanent Read/Write', 'Keep media mounted read/write at all times. ', isset($config['system']['nanobsd_force_rw']) ))->setHelp('This setting is only temporary, and can be switched dynamically in the background.'); $permbtn = new Form_Button('setrw', 'Save'); $permbtn->removeClass('btn-primary')->addClass('btn-default btn-sm'); $section->addInput(new Form_StaticText( null, $permbtn )); $section->addInput(new Form_Input( 'destslice', null, 'hidden', $COMPLETE_PATH )); $dupbtn = new Form_Button('duplicateslice', 'Duplicate ' . $COMPLETE_BOOT_PATH . ' -> ' . $TOFLASH); $dupbtn->removeClass('btn-primary')->addClass('btn-default btn-sm'); $section->addInput(new Form_StaticText( 'Duplicate boot slice', $dupbtn ))->setHelp('This will duplicate the bootup slice to the alternate slice. Use this if you would like to duplicate the known good working boot partition to the alternate.'); $section->addInput(new Form_StaticText( 'RRD/DHCP Backup', 'These options have been relocated to the ' . '' . 'System > Advanced, Miscellaneous tab.' )); if (file_exists("/conf/upgrade_log.txt")) { $viewbtn = new Form_Button('viewupgradelog', 'View log'); $viewbtn->removeClass('btn-primary')->addClass('btn-default btn-sm'); $section->addInput(new Form_StaticText( 'View previous upgrade log', $viewbtn )); } $form->add($section); print($form); if (file_exists("/conf/upgrade_log.txt") && $_POST['viewupgradelog']) { ?>