Pantek Library
Hosting Provided By
CybrHost
High Speed Hosting
Index: debian-installer-utils/debian/changelog
===================================================================
--- debian-installer-utils/debian/changelog	(revision 50280)
+++ debian-installer-utils/debian/changelog	(working copy)
@@ -1,3 +1,9 @@
+debian-installer-utils (1.50sci1) UNRELEASED; urgency=low
+
+  * Add serial-console-info utility
+
+ -- dann frazier   Thu, 29 Nov 2007 14:48:58 -0700
+
 debian-installer-utils (1.50) unstable; urgency=low
 
   [ Frans Pop ]
Index: debian-installer-utils/debian/rules
===================================================================
--- debian-installer-utils/debian/rules	(revision 50280)
+++ debian-installer-utils/debian/rules	(working copy)
@@ -42,7 +42,8 @@
 	dh_install -pdi-utils anna-install apt-install debconf-disconnect \
 			      debconf-get debconf-set log-output \
 			      register-module search-path update-dev \
-			      user-params in-target list-devices bin
+			      user-params in-target list-devices \
+			      serial-console-info bin
 	dh_install -pdi-utils chroot-setup.sh lib
 	dh_installdirs -pdi-utils usr/lib/post-base-installer.d
 	install register-module.post-base-installer debian/di-utils/usr/lib/post-base-installer.d/10register-module
Index: debian-installer-utils/serial-console-info.c
===================================================================
--- debian-installer-utils/serial-console-info.c	(revision 0)
+++ debian-installer-utils/serial-console-info.c	(revision 0)
@@ -0,0 +1,32 @@
+/*
+ * If /dev/console is mapped to a serial device, report the device name
+ * and speed.  The readlink /proc/self/fd/0 trick doesn't always work.
+ * An example of this is ia64, where the EFI console settings are detected
+ * and used by default.
+ */
+
+#include 
+#include 
+#include 
Do you need help?X
+#include +#include + +int main(int argc, char **argv) +{ + int fd; + struct serial_struct serial_info; + + fd = open("/dev/console", O_RDWR); + if(fd < 0) + return -1; + + if(ioctl(fd, TIOCGSERIAL, &serial_info) == -1) + return -1; + + close(fd); + + printf("DEV=ttyS%d\n", serial_info.line); + printf("SPEED=%d\n", serial_info.baud_base); + + return 0; +} Index: debian-installer-utils/Makefile =================================================================== --- debian-installer-utils/Makefile (revision 50280) +++ debian-installer-utils/Makefile (working copy) @@ -1,5 +1,5 @@ ifndef TARGETS -TARGETS=mapdevfs log-output +TARGETS=mapdevfs log-output serial-console-info endif CFLAGS=-Wall -W -Os -fomit-frame-pointer -g @@ -15,6 +15,9 @@ log-output: log-output.c $(CC) $(CFLAGS) $^ -o $@ -ldebian-installer +serial-console-info: serial-console-info.c + $(CC) $(CLFAGS) $^ -o $@ + strip: $(TARGETS) $(STRIP) $^

Contact Us  Legal Notices  Order Services Online 
Pantek Home  Privacy Policy  IT news  Site Map  Pantek Library