Commit 881a01ce authored by Franco Fichtner's avatar Franco Fichtner

inc: auto_login() isn't needed, but we need to invoke stuff on boot

parent 31b7aa52
...@@ -998,63 +998,10 @@ function setup_serial_port($when="save", $path="") { ...@@ -998,63 +998,10 @@ function setup_serial_port($when="save", $path="") {
} }
unset($on_off, $console_type, $serial_type); unset($on_off, $console_type, $serial_type);
fclose($fd); fclose($fd);
auto_login();
reload_ttys(); reload_ttys();
conf_mount_ro(); conf_mount_ro();
} }
function auto_login()
{
global $config;
/*
* This function appends the autologin extension in /etc/gettytab
* for the main console. This only works with a vanilla config;
* it is likely that manual editing by the user will make this
* function stop working properly. In case of no match, throw a
* little error...
*/
$getty_file = "/etc/gettytab";
$getty_text = explode("\n", file_get_contents($getty_file));
$getty_al = isset($config['system']['disableconsolemenu']) ? "" : "al=root:";
$getty_base = "\t:ht:np:sp#9600:";
$getty_new = $getty_base . $getty_al;
$getty_ok = false;
foreach ($getty_text as $getty_old) {
if (!strncmp($getty_old, $getty_base, strlen($getty_base))) {
if (!strcmp($getty_old, $getty_new)) {
/* already the correct setting */
return;
}
$getty_ok = true;
}
}
if (!$getty_ok) {
log_error(gettext("Could not toggle auto login setting."));
return;
}
$fd = fopen($getty_file, "w");
if (!$fd) {
log_error(gettext("Could not write auto login setting."));
return;
}
foreach ($getty_text as $getty_old) {
if (!strncmp($getty_old, $getty_base, strlen($getty_base))) {
fprintf($fd, "%s\n", $getty_new);
} else {
fprintf($fd, "%s\n", $getty_old);
}
}
fclose($fd);
}
function is_serial_enabled() function is_serial_enabled()
{ {
global $g, $config; global $g, $config;
......
<?php <?php
/* $Id$ */
/* /*
system.inc
part of m0n0wall (http://m0n0.ch/wall) part of m0n0wall (http://m0n0.ch/wall)
Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>. Copyright (C) 2003-2004 Manuel Kasper <mk@neon1.net>.
...@@ -1681,6 +1680,11 @@ function system_reboot_cleanup() { ...@@ -1681,6 +1680,11 @@ function system_reboot_cleanup() {
stop_packages(); stop_packages();
} }
function system_console_configure()
{
setup_serial_port();
}
function system_dmesg_save() function system_dmesg_save()
{ {
global $g; global $g;
......
...@@ -295,6 +295,9 @@ echo "done.\n"; ...@@ -295,6 +295,9 @@ echo "done.\n";
/* start load balancer daemon */ /* start load balancer daemon */
relayd_configure(); relayd_configure();
/* configure console menu */
system_console_configure();
/* start DHCP service */ /* start DHCP service */
services_dhcpd_configure(); services_dhcpd_configure();
......
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