aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xrc.d/init.d/halt29
-rw-r--r--src/console_check.c25
2 files changed, 25 insertions, 29 deletions
diff --git a/rc.d/init.d/halt b/rc.d/init.d/halt
index ce6b24b1..2eb77582 100755
--- a/rc.d/init.d/halt
+++ b/rc.d/init.d/halt
@@ -99,34 +99,7 @@ if [ -f /etc/sysconfig/clock ]; then
fi
fi
-CLOCKDEF=""
-CLOCKFLAGS="$CLOCKFLAGS --systohc"
-
-case "$UTC" in
- yes|true)
- CLOCKFLAGS="$CLOCKFLAGS -u";
- CLOCKDEF="$CLOCKDEF (utc)";
- ;;
- no|false)
- CLOCKFLAGS="$CLOCKFLAGS --localtime";
- CLOCKDEF="$CLOCKDEF (localtime)";
- ;;
-esac
-
-case "$ARC" in
- yes|true)
- CLOCKFLAGS="$CLOCKFLAGS -A";
- CLOCKDEF="$CLOCKDEF (arc)";
- ;;
-esac
-case "$SRM" in
- yes|true)
- CLOCKFLAGS="$CLOCKFLAGS -S";
- CLOCKDEF="$CLOCKDEF (srm)";
- ;;
-esac
-
-[ -x /sbin/hwclock ] && action $"Syncing hardware clock to system time" /sbin/hwclock $CLOCKFLAGS
+[ -x /sbin/hwclock ] && action $"Syncing hardware clock to system time" /sbin/hwclock --systohc
# Try to unmount tmpfs filesystems to avoid swapping them in. Ignore failures.
tmpfs=$(awk '$2 ~ /^\/($|proc|dev)/ { next; }
diff --git a/src/console_check.c b/src/console_check.c
index 60dc89e2..e188ebe5 100644
--- a/src/console_check.c
+++ b/src/console_check.c
@@ -9,6 +9,7 @@
#include <sys/ioctl.h>
#include <linux/serial.h>
+#include <linux/serial_core.h>
struct speeds
{
@@ -91,11 +92,29 @@ int compare_termios_to_console(char *dev, int *speed) {
return 0;
}
+char *serial_tty_name(int type) {
+ switch (type) {
+ case PORT_8250...PORT_MAX_8250:
+ return "ttyS";
+ case PORT_PMAC_ZILOG:
+ return "ttyPZ";
+ case PORT_MPSC:
+ return "ttyMM";
+ case PORT_CPM:
+ return "ttyCPM";
+ case PORT_MPC52xx:
+ return "ttyPSC";
+ default:
+ return NULL;
+ }
+}
+
char *check_serial_console(int *speed) {
int fd;
char *ret = NULL, *device;
char twelve = 12;
struct serial_struct si, si2;
+ char *tty_name;
memset(&si, 0, sizeof(si));
memset(&si2, 0, sizeof(si));
@@ -108,7 +127,11 @@ char *check_serial_console(int *speed) {
goto out;
close(fd);
- asprintf(&device, "ttyS%d", si.line);
+ tty_name = serial_tty_name(si.type);
+ if (!tty_name)
+ goto out;
+
+ asprintf(&device, "%s%d", tty_name, si.line);
fd = open(device, O_RDWR|O_NONBLOCK);
if (fd == -1)
goto out;