Commit 70d96a6e authored by Franco Fichtner's avatar Franco Fichtner

rc: merge the new installer/importer combo

parent c6c30530
......@@ -71,7 +71,7 @@ attempts=0
while [ ${attempts} -lt 3 ]; do
fsck -C -y /
fsck -C -y /
if mount -a 2>/dev/null; then
if mount -a 2> /dev/null; then
# bail if all is well
break
fi
......@@ -99,19 +99,11 @@ fi
# set keyboard map if needed
/etc/rc.d/syscons onestart
# set up config directory structure
mkdir -p /conf/backup
mkdir -p /conf/sshd
# Bootstrap config.xml if necessary
if [ ! -f /conf/config.xml ]; then
echo -n "Bootstrapping config.xml..."
cp /usr/local/etc/config.xml /conf/config.xml
echo "done."
fi
# run the config importer during early startup
/usr/local/etc/rc.importer -b
# Enable console output if its muted.
/sbin/conscontrol mute off >/dev/null
/sbin/conscontrol mute off > /dev/null
setup_mfs_link()
{
......@@ -217,7 +209,7 @@ chmod 1777 /tmp
echo -n "."
/sbin/ldconfig -elf /usr/lib /usr/local/lib /lib
/etc/rc.d/ldconfig start 2>/dev/null
/etc/rc.d/ldconfig start 2> /dev/null
# Launching kbdmux(4)
if [ -f "/dev/kbdmux0" ]; then
......@@ -270,7 +262,7 @@ rm /var/run/booting
/usr/local/etc/rc.opnsense start
echo -n "Starting CRON..."
cd /tmp && /usr/sbin/cron -s 2>/dev/null
cd /tmp && /usr/sbin/cron -s 2> /dev/null
echo "done."
/usr/local/sbin/beep.sh start
......
......@@ -58,6 +58,10 @@ foreach ($inc_files as $inc_file) {
echo "done.\n";
global $config;
$config = parse_config(true);
convert_config();
/*
* Now mute console messages from kernel for this script, it
* has consequences for printing bootup info and can clobber
......@@ -65,34 +69,6 @@ echo "done.\n";
*/
system_console_mute();
/* loopback device is required early for syslog and the installer */
interfaces_loopback_configure(true);
$setup_installer = is_install_media();
if ($setup_installer) {
echo 'Press any key to start the early installer: ';
$key = timeout();
if ($key != "\n") {
echo "\n";
}
if (isset($key)) {
passthru('/usr/local/etc/rc.installer');
if (file_exists('/tmp/install_complete')) {
passthru('/usr/local/etc/rc.reboot');
exit;
}
}
/* config may have changed via installer import */
OPNsense\Core\Config::getInstance()->forceReload();
}
global $config;
$config = parse_config(true);
convert_config();
system_devd_configure(true);
system_login_configure(true);
......@@ -162,7 +138,7 @@ if ($ipsec_dynamic_hosts) {
// generate configuration data for all installed templates
configd_run('template reload *');
if ($setup_installer) {
if (is_install_media()) {
/*
* Installer mode requires setting up an extra user and
* we will protect it with root's password. We can only
......
......@@ -110,21 +110,22 @@ probe_for_part()
DEVS=
PART=
if [ -n "${DO_BOOT}" ]; then
touch ${INSTALL} 2> /dev/null
if [ -f ${INSTALL} -a -f /conf/config.xml ]; then
bootstrap_and_exit
fi
if ! timeout_prompt \
'Press any key to start the configuration importer:' .......; then
bootstrap_and_exit
fi
elif [ -n "${1}" ]; then
if [ -n "${1}" ]; then
if ! probe_for_part ${1}; then
bootstrap_and_exit
fi
else
if [ -n "${DO_BOOT}" ]; then
touch ${INSTALL} 2> /dev/null
if [ -f ${INSTALL} -a -f /conf/config.xml ]; then
bootstrap_and_exit
fi
if ! timeout_prompt \
'Press any key to start the configuration importer:' .......; then
bootstrap_and_exit
fi
fi
DEVS=$(camcontrol devlist)
fi
......
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