Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 13 Jun 2014 10:23:01 GMT
From:      seiya@FreeBSD.org
To:        svn-soc-all@FreeBSD.org
Subject:   socsvn commit: r269516 - in soc2014/seiya/bootsplash: etc sys/dev/fb
Message-ID:  <201406131023.s5DAN1Zm060135@socsvn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: seiya
Date: Fri Jun 13 10:23:00 2014
New Revision: 269516
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=269516

Log:
  terminate bootsplash just before the end of userland initialization
  

Modified:
  soc2014/seiya/bootsplash/etc/rc
  soc2014/seiya/bootsplash/sys/dev/fb/bsplash.c

Modified: soc2014/seiya/bootsplash/etc/rc
==============================================================================
--- soc2014/seiya/bootsplash/etc/rc	Fri Jun 13 08:53:49 2014	(r269515)
+++ soc2014/seiya/bootsplash/etc/rc	Fri Jun 13 10:23:00 2014	(r269516)
@@ -141,6 +141,9 @@
 	fi
 fi
 
+# terminate boot splash
+kenv BOOT_PROGRESS=100 > /dev/null
+
 echo ''
 date
 exit 0

Modified: soc2014/seiya/bootsplash/sys/dev/fb/bsplash.c
==============================================================================
--- soc2014/seiya/bootsplash/sys/dev/fb/bsplash.c	Fri Jun 13 08:53:49 2014	(r269515)
+++ soc2014/seiya/bootsplash/sys/dev/fb/bsplash.c	Fri Jun 13 10:23:00 2014	(r269516)
@@ -57,7 +57,7 @@
 }
 
 static int
-bsplash_early_init2(void)
+bsplash_init(void)
 {
 	caddr_t		image = NULL;
 	void		*p;
@@ -102,6 +102,8 @@
 {
 	static int	count = 0;
 	static int	y = 0;
+	char		*s;
+	int		progress = 0;
 
 	for (;;){
 		if (draw_bmp(adp, &bmp_info, y, 1024, 768) == 0){
@@ -112,14 +114,20 @@
 				y += 768;
 		}
 
-		/* FIXME */
-		if (count > 50){
+		s = getenv("BOOT_PROGRESS");
+		if (s != NULL){
+			progress = strtol(s, NULL, 10);
+			freeenv(s);
+		}
+
+		if (progress >= 100 || count > 50 /* FXIME */){
+			/* terminate boot splash */
 			vidd_set_mode(adp, M_TEXT_80x25);
 			kthread_exit();
 		}
 
 		count++;
-		pause("bsplash", 15);
+		pause("bsplash", 3*hz /* FIXME: this is because draw_bmp() takes too long time */);
 	}
 }
 
@@ -158,7 +166,7 @@
 {
 	switch ((modeventtype_t)type) {
 	case MOD_LOAD:
-		bsplash_early_init2();
+		bsplash_init();
 		break;
 	case MOD_UNLOAD:
 		bsplash_uninit();



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201406131023.s5DAN1Zm060135>