diff options
-rw-r--r-- | sys-apps/915resolution/915resolution-0.5.3-r1.ebuild | 49 | ||||
-rw-r--r-- | sys-apps/915resolution/ChangeLog | 16 | ||||
-rw-r--r-- | sys-apps/915resolution/files/915resolution-0.5.3-freebsd.patch | 95 | ||||
-rw-r--r-- | sys-apps/915resolution/files/digest-915resolution-0.5.3-r1 | 3 | ||||
-rw-r--r-- | sys-apps/915resolution/files/initd-r1 | 59 |
5 files changed, 221 insertions, 1 deletions
diff --git a/sys-apps/915resolution/915resolution-0.5.3-r1.ebuild b/sys-apps/915resolution/915resolution-0.5.3-r1.ebuild new file mode 100644 index 000000000000..cbdf019b18b5 --- /dev/null +++ b/sys-apps/915resolution/915resolution-0.5.3-r1.ebuild @@ -0,0 +1,49 @@ +# Copyright 1999-2007 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-apps/915resolution/915resolution-0.5.3-r1.ebuild,v 1.1 2007/06/08 18:04:35 lavajoe Exp $ + +inherit eutils flag-o-matic + +DESCRIPTION="Utility to patch VBIOS of Intel 855 / 865 / 915 chipsets" +HOMEPAGE="http://www.geocities.com/stomljen/" +SRC_URI="http://www.geocities.com/stomljen/${P}.tar.gz" + +LICENSE="public-domain" +SLOT="0" +KEYWORDS="~x86-fbsd" +IUSE="" + +DEPEND="" +RDEPEND="" + +src_unpack() { + unpack ${A} + cd "${S}" + + epatch "${FILESDIR}/${P}-freebsd.patch" +} + +src_compile() { + filter-flags -O -O1 -O2 -O3 -Os + emake clean + emake CFLAGS="${CFLAGS}" || die "Compiliation failed." +} + +src_install() { + dosbin ${PN} + newconfd "${FILESDIR}/confd" ${PN} + newinitd "${FILESDIR}/initd-r1" ${PN} + dodoc README.txt changes.log chipset_info.txt dump_bios +} + +pkg_postinst() { + elog + elog "${PN} alters your video BIOS in a non-permanent way, this means" + elog "that there is no risk of permanent damage to your video card, but" + elog "it also means that it must be run at every boot. To set it up, " + elog "edit /etc/conf.d/${PN} to add your configuration and type the" + elog "following command to add it the your defautl runlevel:" + elog + elog " \"rc-update add ${PN} default\"" + elog +} diff --git a/sys-apps/915resolution/ChangeLog b/sys-apps/915resolution/ChangeLog index 267ca7c507fc..b546d566551c 100644 --- a/sys-apps/915resolution/ChangeLog +++ b/sys-apps/915resolution/ChangeLog @@ -1,6 +1,20 @@ # ChangeLog for sys-apps/915resolution # Copyright 1999-2007 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-apps/915resolution/ChangeLog,v 1.9 2007/04/17 16:52:24 genstef Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-apps/915resolution/ChangeLog,v 1.10 2007/06/08 18:04:35 lavajoe Exp $ + +*915resolution-0.5.3-r1 (08 Jun 2007) + + 08 Jun 2007; Joe Peterson <lavajoe@gentoo.org> + +files/915resolution-0.5.3-freebsd.patch, +files/initd-r1, + +915resolution-0.5.3-r1.ebuild: + Port to ~x86-fbsd by adding code from FreeBSD-compatible version of + 855resolution (found here: + http://www.sigusr1.org/~kurahone/misc-hacks/); remove optimization flags + (breaks assembly code part of build and is not necessary anyway); fix + init.d file to return correct error code if any of the resolutions in + config fail; improve formatting of log file; keyword with *only* + ~x86-fbsd for now awaiting testing on other archs + (bug #175500) 17 Apr 2007; Stefan Schweizer <genstef@gentoo.org> files/confd, metadata.xml: diff --git a/sys-apps/915resolution/files/915resolution-0.5.3-freebsd.patch b/sys-apps/915resolution/files/915resolution-0.5.3-freebsd.patch new file mode 100644 index 000000000000..462772940f7b --- /dev/null +++ b/sys-apps/915resolution/files/915resolution-0.5.3-freebsd.patch @@ -0,0 +1,95 @@ +diff -Nru 915resolution-0.5.3/915resolution.c 915resolution-0.5.3-new/915resolution.c +--- 915resolution-0.5.3/915resolution.c 2007-04-21 12:40:51 +0000 ++++ 915resolution-0.5.3-new/915resolution.c 2007-04-21 12:40:51 +0000 +@@ -22,7 +22,17 @@ + #include <string.h> + #include <sys/mman.h> + #include <fcntl.h> ++ ++#if defined(__NetBSD__) ++#include <sys/types.h> ++#include <machine/sysarch.h> ++#include "bsd_io.h" ++#elif defined(__FreeBSD__) ++#include "bsd_io.h" ++#elif defined(linux) + #include <sys/io.h> ++#endif ++ + #include <unistd.h> + #include <assert.h> + +@@ -163,12 +173,26 @@ + + + void initialize_system(char * filename) { +- + if (!filename) { ++#if defined(__FreeBSD__) ++ int iofd = open("/dev/io", O_RDONLY); ++ if (iofd == -1) { ++ perror("Unable to obtain the proper IO permissions"); ++ exit(2); ++ } ++#elif defined(__NetBSD__) ++ if (i386_iopl(3) < 0) { ++ perror("Unable to obtain the proper IO permissions"); ++ exit(2); ++ } ++#elif defined(linux) + if (iopl(3) < 0) { + perror("Unable to obtain the proper IO permissions"); + exit(2); + } ++#else ++#error Not ported to this operating system ++#endif + } + } + +diff -Nru 915resolution-0.5.3/bsd_io.h 915resolution-0.5.3-new/bsd_io.h +--- 915resolution-0.5.3/bsd_io.h 1970-01-01 00:00:00 +0000 ++++ 915resolution-0.5.3-new/bsd_io.h 2007-04-21 12:40:51 +0000 +@@ -0,0 +1,42 @@ ++#include <sys/types.h> ++ ++#ifndef _BSD_IO_H_ ++#define _BSD_IO_H_ ++ ++/* Ripped out of cpufunc.h, changed args to match Linux. */ ++static __inline u_int ++inl(u_int port) ++{ ++ u_int data; ++ ++ __asm __volatile("inl %%dx,%0" : "=a" (data) : "d" (port)); ++ return (data); ++} ++ ++static __inline u_char ++inb(u_int port) ++{ ++ u_char data; ++ ++ __asm __volatile("inb %%dx,%0" : "=a" (data) : "d" (port)); ++ return (data); ++} ++ ++static __inline void ++outl(u_int data, u_int port) ++{ ++ /* ++ * outl() and outw() aren't used much so we haven't looked at ++ * possible micro-optimizations such as the unnecessary ++ * assignment for them. ++ */ ++ __asm __volatile("outl %0,%%dx" : : "a" (data), "d" (port)); ++} ++ ++static __inline void ++outb(u_char data, u_int port) ++{ ++ __asm __volatile("outb %0,%1" : : "a" (data), "id" ((u_short)(port))); ++} ++ ++#endif diff --git a/sys-apps/915resolution/files/digest-915resolution-0.5.3-r1 b/sys-apps/915resolution/files/digest-915resolution-0.5.3-r1 new file mode 100644 index 000000000000..db576029788c --- /dev/null +++ b/sys-apps/915resolution/files/digest-915resolution-0.5.3-r1 @@ -0,0 +1,3 @@ +MD5 ed287778a53d02c31a7a6a52bc146291 915resolution-0.5.3.tar.gz 22583 +RMD160 a406c6810bbfcf94c5352ea1b1e9178af4078589 915resolution-0.5.3.tar.gz 22583 +SHA256 b64cab834b5e410bca555dc9db8e69f62f6f02496942f35ff4a68f3f27f1b542 915resolution-0.5.3.tar.gz 22583 diff --git a/sys-apps/915resolution/files/initd-r1 b/sys-apps/915resolution/files/initd-r1 new file mode 100644 index 000000000000..f63f2472aa61 --- /dev/null +++ b/sys-apps/915resolution/files/initd-r1 @@ -0,0 +1,59 @@ +#!/sbin/runscript + +depend() { + before xdm +} + +# Credit to David Leverton for this function which handily maps a bash array +# structure to positional parameters so existing configs work :) +# We'll deprecate arrays at some point though. +_get_array() { + if [ -n "${BASH}" ] ; then + case "$(declare -p "$1" 2>/dev/null)" in + "declare -a "*) + echo "set -- \"\${$1[@]}\"" + return + ;; + esac + fi + + echo "eval set -- \"\$$1\"" +} + +checkconfig() { + if [ -z "${replace}" ]; then + eerror "You need to have at least one resolution to replace" + eerror "/etc/conf.d/915resolution" + return 1 + fi + + # Start with a clean log file + cat /dev/null > ${log:-/dev/null} + + return 0 +} + +start() { + checkconfig || return 1 + + ebegin "Patching video BIOS with new video modes" + + retval=0 + first=0 + eval $(_get_array replace) + for mode in "$@"; do + # If this is not the first mode, insert a separator in the log + if [ ${first} -ne 0 ]; then + echo "" >> ${log:-/dev/null} + echo "---" >> ${log:-/dev/null} + echo "" >> ${log:-/dev/null} + fi + + # Set each mode, and remember the last bad return value if any fail + 915resolution ${mode} >> ${log:-/dev/null} || retval=$? + + first=1 + done + + eend ${retval} +} |