Date: Sat, 20 Aug 2016 18:43:29 +0000 (UTC) From: Alexey Dokuchaev <danfe@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r420524 - in head/sysutils: . read-edid read-edid/files Message-ID: <201608201843.u7KIhTlq086348@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: danfe Date: Sat Aug 20 18:43:29 2016 New Revision: 420524 URL: https://svnweb.freebsd.org/changeset/ports/420524 Log: Add a port of read-edid utility, a pair of tools for reading the EDID from a monitor. It is mostly useful to read LCD matrix manufacturer and model. WWW: http://www.polypux.org/projects/read-edid/ NB: TIMESTAMP line in distinfo should read as follows, but has to stay in its current form due to a bug in the hook script: TIMESTAMP (read-edid-3.0.2.tar.gz) = 1430271430 Added: head/sysutils/read-edid/ head/sysutils/read-edid/Makefile (contents, props changed) head/sysutils/read-edid/distinfo (contents, props changed) head/sysutils/read-edid/files/ head/sysutils/read-edid/files/patch-CMakeLists.txt (contents, props changed) head/sysutils/read-edid/files/patch-get-edid_classic.c (contents, props changed) head/sysutils/read-edid/files/patch-get-edid_i2c-dev.h (contents, props changed) head/sysutils/read-edid/files/patch-get-edid_i2c.c (contents, props changed) head/sysutils/read-edid/pkg-descr (contents, props changed) head/sysutils/read-edid/pkg-message (contents, props changed) Modified: head/sysutils/Makefile Modified: head/sysutils/Makefile ============================================================================== --- head/sysutils/Makefile Sat Aug 20 18:39:58 2016 (r420523) +++ head/sysutils/Makefile Sat Aug 20 18:43:29 2016 (r420524) @@ -888,6 +888,7 @@ SUBDIR += rdiff-backup SUBDIR += rdiff-backup-devel SUBDIR += rdup + SUBDIR += read-edid SUBDIR += realsync SUBDIR += recoverdm SUBDIR += reed Added: head/sysutils/read-edid/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/read-edid/Makefile Sat Aug 20 18:43:29 2016 (r420524) @@ -0,0 +1,19 @@ +# Created by: Alexey Dokuchaev <danfe@FreeBSD.org> +# $FreeBSD$ + +PORTNAME= read-edid +PORTVERSION= 3.0.2 +CATEGORIES= sysutils +MASTER_SITES= http://www.polypux.org/projects/${PORTNAME}/ + +MAINTAINER= danfe@FreeBSD.org +COMMENT= Tools for reading the EDID from a monitor + +LIB_DEPENDS= libx86.so:devel/libx86 + +USES= cmake localbase + +PLIST_FILES= bin/get-edid bin/parse-edid man/man1/get-edid.1.gz +PORTDOCS= AUTHORS ChangeLog LICENSE README + +.include <bsd.port.mk> Added: head/sysutils/read-edid/distinfo ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/read-edid/distinfo Sat Aug 20 18:43:29 2016 (r420524) @@ -0,0 +1,3 @@ +TIMESTAMP = 1430271430 +SHA256 (read-edid-3.0.2.tar.gz) = c7c6d8440f5b90f98e276829271ccea5b2ff5a3413df8a0f87ec09f834af186f +SIZE (read-edid-3.0.2.tar.gz) = 17508 Added: head/sysutils/read-edid/files/patch-CMakeLists.txt ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/read-edid/files/patch-CMakeLists.txt Sat Aug 20 18:43:29 2016 (r420524) @@ -0,0 +1,11 @@ +--- CMakeLists.txt.orig 2014-02-05 16:27:26 UTC ++++ CMakeLists.txt +@@ -12,6 +12,6 @@ if (I2CBUILD OR CLASSICBUILD) + endif () + add_subdirectory (parse-edid) + +-INSTALL(FILES get-edid.1 DESTINATION share/man/man1) +-INSTALL(FILES AUTHORS ChangeLog COPYING README DESTINATION ++INSTALL(FILES get-edid.1 DESTINATION man/man1) ++INSTALL(FILES AUTHORS ChangeLog LICENSE README DESTINATION + share/doc/read-edid) Added: head/sysutils/read-edid/files/patch-get-edid_classic.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/read-edid/files/patch-get-edid_classic.c Sat Aug 20 18:43:29 2016 (r420524) @@ -0,0 +1,34 @@ +--- get-edid/classic.c.orig 2015-04-29 01:08:34 UTC ++++ get-edid/classic.c +@@ -1,12 +1,12 @@ + /* (c) 2000,2001,2002 John Fremlin */ + /* (c) 2010,2011 Matthew Kern */ + #ifdef CLASSICBUILD ++#include <fcntl.h> + #include <stdio.h> + #include <stdlib.h> + #include <assert.h> + #include <string.h> + #include <sys/types.h> +-#include <sys/io.h> + #include <unistd.h> + + #include <libx86.h> +@@ -135,8 +135,17 @@ classicmain( unsigned contr, int qit ) + return 10; + } + ++#if defined(__linux__) + ioperm(0, 0x400 , 1); + iopl(3); ++#elif defined(__FreeBSD__) ++#define DEV_IO_PATH "/dev/io" ++ if (open(DEV_IO_PATH, O_RDONLY) < 0) { ++ display("%s(): failed to open %s\n", __func__, DEV_IO_PATH); ++ return 11; ++ } ++#undef DEV_IO_PATH ++#endif + + + /*if ( argc == 1 ) Added: head/sysutils/read-edid/files/patch-get-edid_i2c-dev.h ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/read-edid/files/patch-get-edid_i2c-dev.h Sat Aug 20 18:43:29 2016 (r420524) @@ -0,0 +1,21 @@ +--- get-edid/i2c-dev.h.orig 2011-10-04 19:57:18 UTC ++++ get-edid/i2c-dev.h +@@ -25,9 +25,17 @@ + #ifndef LIB_I2CDEV_H + #define LIB_I2CDEV_H + +-#include <linux/types.h> ++#include <sys/types.h> + #include <sys/ioctl.h> + ++#if defined(__FreeBSD__) ++typedef int8_t __s8; ++typedef int16_t __s16; ++typedef int32_t __s32; ++typedef uint8_t __u8; ++typedef uint16_t __u16; ++typedef uint32_t __u32; ++#endif + + /* -- i2c.h -- */ + Added: head/sysutils/read-edid/files/patch-get-edid_i2c.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/read-edid/files/patch-get-edid_i2c.c Sat Aug 20 18:43:29 2016 (r420524) @@ -0,0 +1,17 @@ +--- get-edid/i2c.c.orig 2014-11-21 11:52:13 UTC ++++ get-edid/i2c.c +@@ -24,7 +24,13 @@ int open_i2c_dev(int i2cbus) { + char filename[16]; + unsigned long funcs; + +- sprintf(filename, "/dev/i2c-%d", i2cbus); ++ sprintf(filename, ++#if defined(__linux__) ++ "/dev/i2c-%d", ++#elif defined(__FreeBSD__) ++ "/dev/iic%d", ++#endif ++ i2cbus); + i2cfile = open(filename, O_RDWR); + + if (i2cfile < 0 && errno == ENOENT) { Added: head/sysutils/read-edid/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/read-edid/pkg-descr Sat Aug 20 18:43:29 2016 (r420524) @@ -0,0 +1,9 @@ +read-edid is a pair of tools (originally by John Fremlin) for reading the +EDID from a monitor. It should work with most monitors made since 1996, +assuming the video card supports the standard read commands (most do). + +Two tools are provided: get-edid, which gets the raw EDID information from +the monitor, and parse-edid, which turns the raw binary information into a +xorg.conf-compatible monitor section (or xrandr-compatible modelines). + +WWW: http://www.polypux.org/projects/read-edid/ Added: head/sysutils/read-edid/pkg-message ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/read-edid/pkg-message Sat Aug 20 18:43:29 2016 (r420524) @@ -0,0 +1,13 @@ +FreeBSD has mapping at zero address feature turned off since 8.0-RC2: + + http://security.freebsd.org/advisories/FreeBSD-EN-09:05.null.asc + +This is required to read EDID data via classical VBE interface (to avoid +"mmap /dev/mem: Invalid argument" message from libx86). To temporarily +disable this protection, issue the following command: + + # sysctl security.bsd.map_at_zero=1 + +To return to secure state: + + # sysctl security.bsd.map_at_zero=0
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608201843.u7KIhTlq086348>