aboutsummaryrefslogtreecommitdiff
path: root/misc/fbdump
diff options
context:
space:
mode:
authorB. Watson <yalhcru@gmail.com>2017-03-24 17:35:21 -0400
committerDavid Spencer <idlemoor@slackbuilds.org>2017-03-26 02:15:17 +0100
commit0208372e56d8eceac8d42b7ffd193c748a867280 (patch)
treeb5c8eea6ec45d02a00e943682ab02fa0cd4773b7 /misc/fbdump
parenta90a23fa4ad4c775db726859ec6a72c04321f0ea (diff)
misc/fbdump: Updated for version 0.4.2, new maintainer.
Signed-off-by: B. Watson <yalhcru@gmail.com> Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
Diffstat (limited to 'misc/fbdump')
-rw-r--r--misc/fbdump/README11
-rw-r--r--misc/fbdump/fbdump.194
-rw-r--r--misc/fbdump/fbdump.SlackBuild49
-rw-r--r--misc/fbdump/fbdump.info4
-rw-r--r--misc/fbdump/fbdump.rst78
-rw-r--r--misc/fbdump/fflush_stdout.diff11
6 files changed, 231 insertions, 16 deletions
diff --git a/misc/fbdump/README b/misc/fbdump/README
index 1840f205929a3..c7cd539bb1fa5 100644
--- a/misc/fbdump/README
+++ b/misc/fbdump/README
@@ -1,8 +1,15 @@
+fbdump (captures the visible portion of framebuffer to stdout)
+
fbdump is a simple tool that captures the contents of the visible portion of
the Linux framebuffer device and writes it to the standard output as a PPM
file. In other words, it takes a screenshot of anything running on the
framebuffer. It currently has fairly complete support for packed-pixel
framebuffer types and also works with the VGA16 framebuffer driver.
-To get a popular image format, issue a command like
-'fbdump | pnmtopng > shot.png'
+To get a popular image format, issue a command like:
+
+ fbdump | pnmtopng > shot.png
+
+Note: fbdump is rather slow on modern systems with high-resolution
+framebuffers at 32-bit color depth. On the maintainer's system, it takes
+8 seconds to dump a 1920x1080x32 framebuffer. Be patient.
diff --git a/misc/fbdump/fbdump.1 b/misc/fbdump/fbdump.1
new file mode 100644
index 0000000000000..dfe262ea46d64
--- /dev/null
+++ b/misc/fbdump/fbdump.1
@@ -0,0 +1,94 @@
+.\" Man page generated from reStructuredText.
+.
+.TH FBDUMP 1 "2017-03-24" "0.4.2" "SlackBuilds.org"
+.SH NAME
+fbdump \- Dumps the contents of the framebuffer to stdout as a PPM file
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.\" RST source for fbdump(1) man page. Convert with:
+.
+.\" rst2man.py fbdump.rst > fbdump.1
+.
+.\" rst2man.py comes from the SBo development/docutils package.
+.
+.\" converting from pod:
+.
+.\" s/B<\([^>]*\)>/**\1**/g
+.
+.\" s/I<\([^>]*\)>/*\1*/g
+.
+.SH SYNOPSIS
+.sp
+fbdump [\fI\-fb <device>\fP] [\fI\-vt <terminal>\fP] [\fI\-delay <sec>\fP]
+.SH DESCRIPTION
+.sp
+fbdump is a simple tool that captures the contents of the visible portion
+of the Linux framebuffer device and writes it to the standard output as
+a PPM file. In other words, it takes a screenshot of anything running on
+the framebuffer. It currently has fairly complete support for packed\-pixel
+framebuffer types and also works with the VGA16 framebuffer driver.
+.SH OPTIONS
+.INDENT 0.0
+.TP
+.B \fB\-fb\fP \fIdevice\fP
+Path to the framebuffer device to dump. Default: \fI/dev/fb0\fP\&.
+.TP
+.B \fB\-vt\fP \fIterminal\fP
+Bring virtual terminal number \fIterminal\fP to the foreground before dumping.
+Default: dump current foreground terminal.
+.TP
+.B \fB\-delay\fP \fIsec\fP
+Wait \fIsec\fP seconds before dumping. Default: dump immediately.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-\-help
+Display usage and exit.
+.UNINDENT
+.SH EXAMPLES
+.sp
+To dump the framebuffer as a PNG image:
+.INDENT 0.0
+.INDENT 3.5
+fbdump | pnmtopng > grab.png
+.UNINDENT
+.UNINDENT
+.SH COPYRIGHT
+.sp
+See the file /usr/doc/fbdump\-0.4.2/COPYING for license information.
+.SH AUTHORS
+.sp
+fbdump was written by Richard Drummond <\fI\%evilrich@rcdrummond.net\fP>.
+.sp
+This man page written for the SlackBuilds.org project
+by B. Watson, and is licensed under the WTFPL.
+.SH SEE ALSO
+.sp
+The fbdump homepage: \fI\%http://www.rcdrummond.net/fbdump/\fP
+.\" Generated by docutils manpage writer.
+.
diff --git a/misc/fbdump/fbdump.SlackBuild b/misc/fbdump/fbdump.SlackBuild
index d267206d8b134..37847bb764869 100644
--- a/misc/fbdump/fbdump.SlackBuild
+++ b/misc/fbdump/fbdump.SlackBuild
@@ -2,9 +2,11 @@
# Slackware build script for fbdump
-# Ryan P.C. McQuen | Everett, WA | ryanpcmcquen@member.fsf.org
+# Previously maintained by:
+# Ryan P.C. McQuen | Everett, WA | <email removed>
-# Copyright 2010 Binh Nguyen <binhvng@gmail.com>
+# Original author:
+# Copyright 2010 Binh Nguyen <email removed>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -24,14 +26,30 @@
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+# Now maintained by B. Watson (yalhcru@gmail.com)
+
+# 20170324 bkw:
+# - take over maintenance.
+# - fix major bug: output was being truncated, producing invalid ppm files!
+# - add man page.
+# - i486=>i586.
+# - minor script updates.
+# - update README.
+# - BUILD=2.
+
+# TODO: see if there's a way to make fbdump faster. It's taking 8 sec
+# to dump a 1920x1080x32bit framebuffer, and that's a pretty common
+# framebuffer format these days. Compiling with lots of optimizations
+# doesn't seem to help (even switching from gcc to clang).
+
PRGNAM=fbdump
VERSION=${VERSION:-0.4.2}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
- i?86) ARCH=i486 ;;
+ i?86) ARCH=i586 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
@@ -42,14 +60,14 @@ TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}
-if [ "$ARCH" = "i486" ]; then
- SLKCFLAGS="-O2 -march=i486 -mtune=i686"
+if [ "$ARCH" = "i586" ]; then
+ SLKCFLAGS="-O2 -march=i586 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
- SLKCFLAGS="-O2 -fPIC"
+ SLKCFLAGS="-O3 -fPIC -funroll-loops -fvectorize"
LIBDIRSUFFIX="64"
else
SLKCFLAGS="-O2"
@@ -71,6 +89,12 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+# 20170324 bkw: maybe returning from main() used to cause stdout to
+# be flushed, back when fbdump was new... but these days we need to
+# explicitly flush the buffer, or the output file is truncated.
+patch -p1 < $CWD/fflush_stdout.diff
+
+CC=clang \
CFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
@@ -84,14 +108,15 @@ CFLAGS="$SLKCFLAGS" \
--build=$ARCH-slackware-linux
make
-make install DESTDIR=$PKG
+make install-strip DESTDIR=$PKG
-find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
- | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
+# man page written for this build, based on --help output and
+# text from the homepage.
+mkdir -p $PKG/usr/man/man1
+gzip -9c < $CWD/$PRGNAM.1 > $PKG/usr/man/man1/$PRGNAM.1.gz
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a AUTHORS COPYING ChangeLog INSTALL NEWS README TODO \
- $PKG/usr/doc/$PRGNAM-$VERSION
+cp -a AUTHORS C* NEWS README TODO $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
diff --git a/misc/fbdump/fbdump.info b/misc/fbdump/fbdump.info
index c76009b5b94fe..790bce43a32a5 100644
--- a/misc/fbdump/fbdump.info
+++ b/misc/fbdump/fbdump.info
@@ -6,5 +6,5 @@ MD5SUM="85ae97c0800a2caf2b04ad7764e3915b"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
-MAINTAINER="Ryan P.C. McQuen"
-EMAIL="ryanpcmcquen@member.fsf.org"
+MAINTAINER="B. Watson"
+EMAIL="yalhcru@gmail.com"
diff --git a/misc/fbdump/fbdump.rst b/misc/fbdump/fbdump.rst
new file mode 100644
index 0000000000000..0b61bb6ec98e4
--- /dev/null
+++ b/misc/fbdump/fbdump.rst
@@ -0,0 +1,78 @@
+.. RST source for fbdump(1) man page. Convert with:
+.. rst2man.py fbdump.rst > fbdump.1
+.. rst2man.py comes from the SBo development/docutils package.
+
+.. |version| replace:: 0.4.2
+.. |date| date::
+
+.. converting from pod:
+.. s/B<\([^>]*\)>/**\1**/g
+.. s/I<\([^>]*\)>/*\1*/g
+
+======
+fbdump
+======
+
+-------------------------------------------------------------
+Dumps the contents of the framebuffer to stdout as a PPM file
+-------------------------------------------------------------
+
+:Manual section: 1
+:Manual group: SlackBuilds.org
+:Date: |date|
+:Version: |version|
+
+SYNOPSIS
+========
+
+fbdump [*-fb <device>*] [*-vt <terminal>*] [*-delay <sec>*]
+
+DESCRIPTION
+===========
+
+fbdump is a simple tool that captures the contents of the visible portion
+of the Linux framebuffer device and writes it to the standard output as
+a PPM file. In other words, it takes a screenshot of anything running on
+the framebuffer. It currently has fairly complete support for packed-pixel
+framebuffer types and also works with the VGA16 framebuffer driver.
+
+OPTIONS
+=======
+
+**-fb** *device*
+ Path to the framebuffer device to dump. Default: */dev/fb0*.
+
+**-vt** *terminal*
+ Bring virtual terminal number *terminal* to the foreground before dumping.
+ Default: dump current foreground terminal.
+
+**-delay** *sec*
+ Wait *sec* seconds before dumping. Default: dump immediately.
+
+--help
+ Display usage and exit.
+
+EXAMPLES
+========
+
+To dump the framebuffer as a PNG image:
+
+ fbdump | pnmtopng > grab.png
+
+COPYRIGHT
+=========
+
+See the file /usr/doc/fbdump-|version|/COPYING for license information.
+
+AUTHORS
+=======
+
+fbdump was written by Richard Drummond <evilrich@rcdrummond.net>.
+
+This man page written for the SlackBuilds.org project
+by B. Watson, and is licensed under the WTFPL.
+
+SEE ALSO
+========
+
+The fbdump homepage: http://www.rcdrummond.net/fbdump/
diff --git a/misc/fbdump/fflush_stdout.diff b/misc/fbdump/fflush_stdout.diff
new file mode 100644
index 0000000000000..cfd4bea51c399
--- /dev/null
+++ b/misc/fbdump/fflush_stdout.diff
@@ -0,0 +1,11 @@
+diff -Naur fbdump-0.4.2/src/surface.c fbdump-0.4.2.patched/src/surface.c
+--- fbdump-0.4.2/src/surface.c 2007-03-02 22:13:50.000000000 -0500
++++ fbdump-0.4.2.patched/src/surface.c 2017-03-24 16:54:08.538269897 -0400
+@@ -49,6 +49,7 @@
+
+ /* Write out the converted pixels to the stream. */
+ fwrite( buf, width * 3, 1, stream );
++ fflush(stream);
+
+ /* And get a ptr to the next row. */
+ rowptr += s->modulo;