Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
70d96a6e
Commit
70d96a6e
authored
Mar 17, 2017
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rc: merge the new installer/importer combo
parent
c6c30530
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
54 deletions
+23
-54
rc
src/etc/rc
+6
-14
rc.bootup
src/etc/rc.bootup
+5
-29
rc.importer
src/etc/rc.importer
+12
-11
No files found.
src/etc/rc
View file @
70d96a6e
...
...
@@ -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
...
...
src/etc/rc.bootup
View file @
70d96a6e
...
...
@@ -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
...
...
src/etc/rc.importer
View file @
70d96a6e
...
...
@@ -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
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment