aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Pires Soares <igorsoares@gmail.com>2008-03-20 19:09:18 +0000
committerIgor Pires Soares <igorsoares@gmail.com>2008-03-20 19:09:18 +0000
commit57a504d475f998118ccae93c05750aefa95954da (patch)
treea907184bbfbbf44c17adf2f420bcbcea11cbd7f5
parent7cc7cc1cc78aca89b7d943a4fb119a526b496f63 (diff)
parent1b76162517a5e742201e7c7974a2d6e0d437f789 (diff)
downloadinitscripts-57a504d475f998118ccae93c05750aefa95954da.tar
initscripts-57a504d475f998118ccae93c05750aefa95954da.tar.gz
initscripts-57a504d475f998118ccae93c05750aefa95954da.tar.bz2
initscripts-57a504d475f998118ccae93c05750aefa95954da.tar.xz
initscripts-57a504d475f998118ccae93c05750aefa95954da.zip
Merge branch 'master' of ssh://git.fedorahosted.org/git/initscripts
-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;