PERFORCE change 213577 for review

Brooks Davis brooks at FreeBSD.org
Wed Jun 27 23:22:38 UTC 2012


http://p4web.freebsd.org/@@213577?ac=10

Change 213577 by brooks at brooks_ecr_current on 2012/06/27 23:22:17

	Add booting, upgrade in progress, and upgrade complete images.
	
	Add a -b option to make the screen black.

Affected files ...

.. //depot/projects/ctsrd/beribsd/src/ctsrd/showimage/images/Makefile#2 edit
.. //depot/projects/ctsrd/beribsd/src/ctsrd/showimage/images/booting.png#1 add
.. //depot/projects/ctsrd/beribsd/src/ctsrd/showimage/images/upgrade-complete.png#1 add
.. //depot/projects/ctsrd/beribsd/src/ctsrd/showimage/images/upgrade-inprogress.png#1 add
.. //depot/projects/ctsrd/beribsd/src/ctsrd/showimage/showimage.c#2 edit

Differences ...

==== //depot/projects/ctsrd/beribsd/src/ctsrd/showimage/images/Makefile#2 (text+ko) ====

@@ -1,7 +1,9 @@
 #	From: @(#)Makefile	8.1 (Berkeley) 6/8/93
 # $FreeBSD: src/share/misc/Makefile,v 1.27 2007/12/19 01:28:17 imp Exp $
 
-FILES=	upgrade-complete.png
+FILES=	booting.png \
+	upgrade-complete.png \
+	upgrade-inprogress.png
 
 NO_OBJ=
 BINDIR?=        ${SHAREDIR}

==== //depot/projects/ctsrd/beribsd/src/ctsrd/showimage/showimage.c#2 (text+ko) ====

@@ -48,16 +48,15 @@
 usage(void)
 {
 	
-	printf("usage: showimage <image>\n");
+	printf("usage:	showimage <image>\n");
+	printf("	showimage -b\n");
 	exit(1);
 }
 
 int
 main(int argc, char *argv[])
 {
-	int		 alpha, ch, i, ofd;
-	pid_t		 pid = 0;
-	char		*ep;
+	int		 blank = 0;
 	char		 imgpath[MAXPATHLEN];
 	u_int32_t	*image;
 	struct timespec	stime;
@@ -65,16 +64,26 @@
 	if (argc != 2)
 		usage();
 
-	if (*argv[1] == '/')
-		strncpy(imgpath, argv[1], sizeof(imgpath));
-	else
-		snprintf(imgpath, sizeof(imgpath), "%s/%s", IMGDIR, argv[1]);
+	fb_init();
+
+	if (strcmp(argv[1], "-b") == 0)
+		blank=1;
+
 	image = malloc(sizeof(u_int32_t) * fb_height * fb_width);
 	if (image == NULL)
 		err(1, "malloc");
-	read_png_file(imgpath, image, fb_width, fb_height);
+
+	if (blank)
+		memset(image, 0, sizeof(u_int32_t) * fb_height * fb_width);
+	else {
+		if (*argv[1] == '/')
+			strncpy(imgpath, argv[1], sizeof(imgpath));
+		else
+			snprintf(imgpath, sizeof(imgpath), "%s/%s", IMGDIR,
+			    argv[1]);
+		read_png_file(imgpath, image, fb_width, fb_height);
+	}
 
-	fb_init();
 	fb_post(image);
 	fb_fade2on();
 	fb_fade2on();


More information about the p4-projects mailing list