Sophie

Sophie

distrib > Arklinux > devel > x86_64 > by-pkgid > 5b940e974faae500b8be8331a3cc5064 > files > 9

mkinitrd-5.0.17-24ark.src.rpm

--- mkinitrd-5.0.17/nash/nash.c.initttys~	2006-07-08 18:55:19.000000000 +0200
+++ mkinitrd-5.0.17/nash/nash.c	2006-07-08 18:55:19.000000000 +0200
@@ -1637,6 +1637,25 @@
 	return 0;
 }
 
+static int initttysCommand(char *cmd, char *end) {
+	char *ttys_str;
+	int ttys = 7;
+	if (cmd = getArg(cmd, end, &ttys_str))
+		ttys = atoi(ttys_str);
+	if(ttys > 100)
+		return 1;
+
+	char tty_dev[11];
+	for(int i=0; i<ttys; i++) {
+		sprintf(tty_dev, "/dev/tty%u", i);
+		int fd=open(tty_dev, O_RDWR);
+		write(fd, "\n", 1);
+		fsync(fd);
+		close(fd);
+	}
+	return 0;
+}
+
 static int
 mkrootdevCommand(char *cmd, char *end)
 {
@@ -2341,6 +2360,7 @@
     { "switchroot", switchrootCommand },
     { "umount", umountCommand },
     { "waitfor", waitforCommand },
+    { "initttys", initttysCommand },
     { NULL, },
 };
 
--- mkinitrd-5.0.17/mkinitrd.initttys~	2006-07-08 18:55:19.000000000 +0200
+++ mkinitrd-5.0.17/mkinitrd	2006-07-08 19:01:10.000000000 +0200
@@ -907,7 +907,7 @@
 fi
 
 if [ -n "$splash" ]; then
-	cemit <<EOF
+    cemit <<EOF
 if nosplash nosplash
 if nofb nosplash
 mknod /dev/fbsplash c /sys/class/misc/fbsplash/dev
@@ -955,6 +955,21 @@
 emit "mkblkdevs"
 fi
 
+if [ "$FBMOD" = "radeonfb" ]; then
+    # There's a bug in radeonfb/fbsplash interaction -- we need to
+    # initialize TTYs and re-init fbsplash
+    cemit <<EOF
+if nosplash noworkaround
+if nofb noworkaround
+initttys 7
+splash_util -c setmode --mode=v --vc=0 -t $splash
+splash_util -c setmode --mode=s --vc=0 -t $splash
+splash_util -c repaint --mode=s --vc=0 -t $splash
+noworkaround:
+EOF
+fi
+
+
 for MODULE in $MODULES; do
     text=""
     module=`echo $MODULE | sed "s|.*/||" | sed "s/.k\?o$//"`