From owner-p4-projects@FreeBSD.ORG Wed Jun 27 23:22:38 2012 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 639ED1065673; Wed, 27 Jun 2012 23:22:36 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 1A2D2106566B for ; Wed, 27 Jun 2012 23:22:36 +0000 (UTC) (envelope-from brooks@freebsd.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id DD9DC8FC0C for ; Wed, 27 Jun 2012 23:22:35 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id q5RNMZ9d026387 for ; Wed, 27 Jun 2012 23:22:35 GMT (envelope-from brooks@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id q5RNMZIc026384 for perforce@freebsd.org; Wed, 27 Jun 2012 23:22:35 GMT (envelope-from brooks@freebsd.org) Date: Wed, 27 Jun 2012 23:22:35 GMT Message-Id: <201206272322.q5RNMZIc026384@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to brooks@freebsd.org using -f From: Brooks Davis To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 213577 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Jun 2012 23:22:38 -0000 http://p4web.freebsd.org/@@213577?ac=10 Change 213577 by brooks@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 \n"); + printf("usage: showimage \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();