Added patch for uname bug #105741 (thanks _bambam) and fixed building on 2.6.14 kernels.
authorJoseph Jezak <josejx@gentoo.org>
Thu, 29 Sep 2005 03:05:43 +0000 (03:05 +0000)
committerJoseph Jezak <josejx@gentoo.org>
Thu, 29 Sep 2005 03:05:43 +0000 (03:05 +0000)
Package-Manager: portage-2.0.52-r1

app-emulation/mol/ChangeLog
app-emulation/mol/Manifest
app-emulation/mol/files/digest-mol-0.9.71_pre1-r3 [new file with mode: 0644]
app-emulation/mol/files/mol-uname.diff [new file with mode: 0644]
app-emulation/mol/files/mol-verify_area.diff [new file with mode: 0644]
app-emulation/mol/mol-0.9.71_pre1-r3.ebuild [new file with mode: 0644]

index ac3687499fb0f2ec8ebbcc13ad0582de0fdbc289..2fe121232f1ec725a19d5fd3a500124378622ed0 100644 (file)
@@ -1,6 +1,13 @@
 # ChangeLog for app-emulation/mol
 # Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-emulation/mol/ChangeLog,v 1.50 2005/08/06 21:05:49 carlo Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/mol/ChangeLog,v 1.51 2005/09/29 03:05:43 josejx Exp $
+
+*mol-0.9.71_pre1-r3 (29 Sep 2005)
+
+  29 Sep 2005; Joseph Jezak <josejx@gentoo.org> +files/mol-uname.diff,
+  +files/mol-verify_area.diff, +mol-0.9.71_pre1-r3.ebuild:
+  Added patch for uname bug #105741 (thanks _bambam) and fixed building on
+  2.6.14 kernels.
 
   06 Aug 2005; Carsten Lohrke <carlo@gentoo.org> mol-0.9.70.ebuild,
   mol-0.9.70-r1.ebuild, mol-0.9.71_pre1.ebuild, mol-0.9.71_pre1-r1.ebuild,
index 434440498bd0ec8e4176ce4806e811e8a67af200..c34484c27c10e233c402d32b7c30f0a3ef6089bc 100644 (file)
@@ -1,21 +1,35 @@
-MD5 4918ee55f2de727970e557ea98fc70dd mol-0.9.71_pre1.ebuild 4517
-MD5 64d6b0cac92a9184a83139de626d3c08 mol-0.9.71_pre1-r2.ebuild 5090
-MD5 90f79bdde801865b57b9e5f4645df4df mol-0.9.71_pre1-r1.ebuild 4819
-MD5 17cd94d375a868aa1424c87c33d451e8 mol-0.9.70-r1.ebuild 3939
-MD5 de9efa673e836fff41ac36232fc3e733 ChangeLog 9862
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
+MD5 8ca7b5ed6930915784abebce8a5c633c ChangeLog 10122
 MD5 56f8a1561157a28124d55347470da6c8 mol-0.9.70.ebuild 4047
+MD5 90f79bdde801865b57b9e5f4645df4df mol-0.9.71_pre1-r1.ebuild 4819
 MD5 3263d375abba2d098c636efc2b135ea5 metadata.xml 333
-MD5 3944510308e77b92ac85c07708947ad0 files/digest-mol-0.9.70-r1 64
-MD5 de4dd986b6c963eae483aebbab3d7a0d files/digest-mol-0.9.71_pre1-r1 121
-MD5 8d619246101648133ade3b39a2269e47 files/digest-mol-0.9.71_pre1-r2 187
+MD5 64d6b0cac92a9184a83139de626d3c08 mol-0.9.71_pre1-r2.ebuild 5090
+MD5 457d88cf9e8da3a70ef024b28d6032a0 mol-0.9.71_pre1-r3.ebuild 5208
+MD5 17cd94d375a868aa1424c87c33d451e8 mol-0.9.70-r1.ebuild 3939
+MD5 4918ee55f2de727970e557ea98fc70dd mol-0.9.71_pre1.ebuild 4517
+MD5 11a4255ad58825f89d459519290217c2 files/mol-verify_area.diff 4696
+MD5 f0299c003ac50a8f73bd8264889116d7 files/mol-0.9.71_pre1-linux-2.6.9.patch 2571
 MD5 934e9ecf483ff3c4e34bb6307212d776 files/mol-0.9.70-nopriority.patch 1853
-MD5 8eb2c97c995cba996b31b0ba38ef4fd0 files/mol-0.9.71_pre1-tmp-offset.patch 864
-MD5 3bf68312e4299f777065f55eea5297fa files/mol-0.9.71_pre1-nopriority.patch 1861
-MD5 37a24cbf6bb78c4d9bd4c79b18aab9d6 files/mol-0.9.71_pre1-big-filesystem.patch 6554
 MD5 659812abffbd24cf3a951dc3ea433827 files/mol-pciproxy-dump.patch 8955
+MD5 8d619246101648133ade3b39a2269e47 files/digest-mol-0.9.71_pre1-r3 187
+MD5 3944510308e77b92ac85c07708947ad0 files/digest-mol-0.9.70-r1 64
+MD5 37a24cbf6bb78c4d9bd4c79b18aab9d6 files/mol-0.9.71_pre1-big-filesystem.patch 6554
+MD5 2f8f758938db9b3cb5a13c0b33d989e3 files/mol-module-fix.patch 327
 MD5 453e05b555f037270dd6da665e100aa8 files/digest-mol-0.9.71_pre1 69
+MD5 0ea7bd65a5ff4666665a71fb9652aae8 files/mol-0.9.70-makefile-fix.patch 924
+MD5 8d619246101648133ade3b39a2269e47 files/digest-mol-0.9.71_pre1-r2 187
 MD5 3944510308e77b92ac85c07708947ad0 files/digest-mol-0.9.70 64
-MD5 2f8f758938db9b3cb5a13c0b33d989e3 files/mol-module-fix.patch 327
+MD5 de4dd986b6c963eae483aebbab3d7a0d files/digest-mol-0.9.71_pre1-r1 121
 MD5 1b1d52b69bcae00d0339c0f3f4ae9a6d files/mol-tiger.patch 3681
-MD5 0ea7bd65a5ff4666665a71fb9652aae8 files/mol-0.9.70-makefile-fix.patch 924
-MD5 f0299c003ac50a8f73bd8264889116d7 files/mol-0.9.71_pre1-linux-2.6.9.patch 2571
+MD5 8eb2c97c995cba996b31b0ba38ef4fd0 files/mol-0.9.71_pre1-tmp-offset.patch 864
+MD5 c0056d18f99396ba8607109a26dc9188 files/mol-uname.diff 618
+MD5 3bf68312e4299f777065f55eea5297fa files/mol-0.9.71_pre1-nopriority.patch 1861
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.2 (GNU/Linux)
+
+iD8DBQFDO1oDcsIHjyDViGQRAr0lAKCn2BSHgI1tywJVeGVdMM/AH3X58QCeOnZV
+cSEZwrSVvEaIq+l4e/+SHvM=
+=l3NX
+-----END PGP SIGNATURE-----
diff --git a/app-emulation/mol/files/digest-mol-0.9.71_pre1-r3 b/app-emulation/mol/files/digest-mol-0.9.71_pre1-r3
new file mode 100644 (file)
index 0000000..9b3d5b0
--- /dev/null
@@ -0,0 +1,3 @@
+MD5 b12e3beca8c90b56af09cb41f66920b0 mol-0.9.71_pre1.tar.bz2 1768219
+MD5 e4f4fb6e63380997c1ab6d554ca93c00 bootx.gz 33043
+MD5 b2f4c10dcadfa689cc54834f3d154884 mol-pciproxy.patch.bz2 16226
diff --git a/app-emulation/mol/files/mol-uname.diff b/app-emulation/mol/files/mol-uname.diff
new file mode 100644 (file)
index 0000000..97b3fa6
--- /dev/null
@@ -0,0 +1,20 @@
+--- scripts/mol_uname.bak      2005-09-28 21:41:58.000000000 -0400
++++ scripts/mol_uname  2005-09-28 21:42:24.000000000 -0400
+@@ -54,16 +54,7 @@
+ # Determine the version string of the running kernel
+ ###########################################################
+ 
+-unset SMP ALTIVEC
+-cat /proc/version | grep SMP > /dev/null 
+-[ $? == 0 ] && SMP="-smp"
+-
+-#only bother about altivec in 2.4
+-if [ -f /proc/ksyms ] ; then
+-    grep altivec /proc/ksyms > /dev/null 
+-    [ $? != 0 ] && ALTIVEC="-noav"
+-fi
+-THIS_UNAME=`uname -r`$SMP$ALTIVEC
++THIS_UNAME=`uname -r`
+ 
+ 
+ ###########################################################
diff --git a/app-emulation/mol/files/mol-verify_area.diff b/app-emulation/mol/files/mol-verify_area.diff
new file mode 100644 (file)
index 0000000..6f1a30d
--- /dev/null
@@ -0,0 +1,157 @@
+diff -ur src/kmod/include/misc.h src/kmod/include/misc.h
+--- src/kmod/include/misc.h    2005-09-14 13:30:23.362968000 +0200
++++ src/kmod/include/misc.h    2005-09-14 13:31:26.170893250 +0200
+@@ -17,6 +17,21 @@
+ #ifndef _H_MOD
+ #define _H_MOD
+ 
++/*
++ *  * Nico
++ *  */
++
++#include <linux/version.h>
++#include <asm/uaccess.h>
++
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,0)
++#define compat_verify_area(a,b,c)       ( ! access_ok(a,b,c) )
++#else
++#define compat_verify_area(a,b,c)       verify_area(a,b,c)
++#endif
++
++
++
+ extern int    g_num_sessions;                 /* number of active sessions */
+ 
+ struct kernel_vars;
+diff -ur src/kmod/Linux/dev.c src/kmod/Linux/dev.c
+--- src/kmod/Linux/dev.c       2005-09-14 13:30:23.302964250 +0200
++++ src/kmod/Linux/dev.c       2005-09-14 13:31:38.319652500 +0200
+@@ -153,7 +153,7 @@
+ 
+       switch( cmd ) {
+       case MOL_IOCTL_GET_DIRTY_FBLINES:  /* short *retbuf, int size -- npairs */
+-              if( verify_area(VERIFY_WRITE, (short*)p1, p2) )
++              if( compat_verify_area(VERIFY_WRITE, (short*)p1, p2) )
+                       break;
+               ret = get_dirty_fb_lines( kv, (short*)p1, p2 );
+               break;
+@@ -188,7 +188,7 @@
+               break;
+ 
+       case MOL_IOCTL_SET_RAM: /* void ( char *lvbase, size_t size ) */
+-              if( verify_area(VERIFY_WRITE, (char*)p1, p2) )
++              if( compat_verify_area(VERIFY_WRITE, (char*)p1, p2) )
+                       break;
+               kv->mmu.linux_ram_base = (char*)p1;
+               kv->mmu.ram_size = p2;
+diff -ur src/netdriver/sheep.c src/netdriver/sheep.c
+--- src/netdriver/sheep.c      2005-09-14 13:30:24.479037750 +0200
++++ src/netdriver/sheep.c      2005-09-14 13:31:11.169955750 +0200
+@@ -80,7 +80,13 @@
+  */
+ 
+ #ifdef LINUX_26
++
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12))
++#define compat_sk_alloc(a,b,c)  sk_alloc( (a), (b), &mol_proto, 1 )
++#else
+ #define compat_sk_alloc(a,b,c)        sk_alloc( (a), (b), (c), NULL )
++#endif
++
+ #define skt_set_dead(skt)     do {} while(0)
+ #define wmem_alloc            sk_wmem_alloc
+ #else
+@@ -156,8 +162,14 @@
+  * the IP address is wrong.)
+  */
+ 
++
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,14))
++static int
++sheep_net_receiver( struct sk_buff *skb, struct net_device *dev, struct packet_type *pt, struct net_device *orig_dev )
++#else
+ static int 
+ sheep_net_receiver( struct sk_buff *skb, struct net_device *dev, struct packet_type *pt )
++#endif
+ {
+       int multicast = (ETH_HDR(skb)->h_dest[0] & ETH_ADDR_MULTICAST);
+       const char *laddr = dev->dev_addr;
+@@ -242,6 +254,15 @@
+ /************************************************************************/
+ /*    misc device ops                                                 */
+ /************************************************************************/
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12))
++static struct proto mol_proto =
++{
++      .name     = "MOL",
++      .owner     = THIS_MODULE,
++      .obj_size    = sizeof(struct sock)
++};
++#endif
++
+ 
+ static int 
+ sheep_net_open( struct inode *inode, struct file *f )
+@@ -286,6 +318,10 @@
+       while( (skb=skb_dequeue(&v->queue)) )
+               kfree_skb(skb);
+ 
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12))
++      proto_unregister(&mol_proto);
++#endif
++
+       // Free private variables
+       kfree(v);
+       return 0;
+diff -ur src/netdriver/tun.c src/netdriver/tun.c
+--- src/netdriver/tun.c        2005-09-14 13:30:24.471037250 +0200
++++ src/netdriver/tun.c        2005-09-14 13:31:15.082200250 +0200
+@@ -240,7 +240,7 @@
+       DBG(KERN_INFO "%s: tun_chr_write %d\n", tun->name, count);
+ 
+       for (i = 0, len = 0; i < count; i++) {
+-              if (verify_area(VERIFY_READ, iv[i].iov_base, iv[i].iov_len))
++              if (compat_verify_area(VERIFY_READ, iv[i].iov_base, iv[i].iov_len))
+                       return -EFAULT;
+               len += iv[i].iov_len;
+       }
+@@ -304,7 +304,7 @@
+       DBG(KERN_INFO "%s: tun_chr_read\n", tun->name);
+ 
+       for (i = 0, len = 0; i < count; i++) {
+-              if (verify_area(VERIFY_WRITE, iv[i].iov_base, iv[i].iov_len))
++              if (compat_verify_area(VERIFY_WRITE, iv[i].iov_base, iv[i].iov_len))
+                       return -EFAULT;
+               len += iv[i].iov_len;
+       }
+diff -ur src/netdriver/sheep.c src/netdriver/sheep.c
+--- src/netdriver/sheep.c      2005-09-28 22:10:36.000000000 -0400
++++ src/netdriver/sheep.c      2005-09-28 22:13:44.000000000 -0400
+@@ -271,14 +271,25 @@
+       struct SheepVars *v;
+       D(bug("sheep_net: open\n"));
+ 
++#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,12))
++      if (proto_register(&mol_proto,0) < 0)
++      {
++              printk(KERN_INFO "Unable to register protocol type\n");
++              return -1;
++      }
++#endif
++
+       // Must be opened with read permissions
+       if( (f->f_flags & O_ACCMODE) == O_WRONLY )
+               return -EPERM;
+ 
+       // Allocate private variables
+-      f->private_data = v = (struct SheepVars *)kmalloc( sizeof(*v), GFP_USER );
+-      if( !v )
++      f->private_data = kmalloc(sizeof(struct SheepVars), GPF_USER);
++      if( f->private_data == NULL)
+               return -ENOMEM;
++
++      v = (struct SheepVars *) f->private_data;
++      
+       memset( v, 0, sizeof(*v) );
+       memcpy( v->fake_addr, fake_addr_, 6 );
+ 
diff --git a/app-emulation/mol/mol-0.9.71_pre1-r3.ebuild b/app-emulation/mol/mol-0.9.71_pre1-r3.ebuild
new file mode 100644 (file)
index 0000000..77c582a
--- /dev/null
@@ -0,0 +1,157 @@
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-emulation/mol/mol-0.9.71_pre1-r3.ebuild,v 1.1 2005/09/29 03:05:43 josejx Exp $
+
+inherit flag-o-matic eutils linux-mod
+
+DESCRIPTION="MOL (Mac-on-Linux) lets PPC users run MacOS (X) under Linux (rsync snapshot)"
+HOMEPAGE="http://www.maconlinux.org/"
+SRC_URI="mirror://gentoo/${P}.tar.bz2
+                mirror://gentoo/bootx.gz
+                mirror://gentoo/mol-pciproxy.patch.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="-* ~ppc"
+IUSE="vnc alsa oss fbcon X oldworld sheep debug dga usb pci"
+
+MAKEOPTS="${MAKEOPTS} -j1"
+
+DEPEND=""
+RDEPEND="net-misc/dhcp
+       net-firewall/iptables
+       alsa? ( virtual/alsa )
+       vnc? ( net-misc/vnc )
+       X? ( virtual/x11 )"
+
+
+MODULE_NAMES="mol(mol:${S}/src/kmod/Linux)
+                         sheep(net:${S}/src/netdriver)
+                         tun(net:${S}/src/netdriver)"
+
+pkg_setup() {
+       echo
+       einfo "If you want to use MOL fullscreen on a virtual console"
+       einfo "be sure to have the USE-flag \"fbcon\" set!"
+       echo
+
+       linux-mod_pkg_setup
+}
+
+src_unpack() {
+       unpack ${A}
+
+       cd ${S}
+       epatch ${FILESDIR}/${PN}-module-fix.patch
+       epatch ${FILESDIR}/${P}-nopriority.patch
+
+       # Fixes bug 79428
+       epatch ${FILESDIR}/${P}-linux-2.6.9.patch
+
+       # Adds big filesystem (>2Gb) image support, bug #80098
+       epatch ${FILESDIR}/${P}-big-filesystem.patch
+
+       # Fixes bug tmp-offset access violation
+       epatch ${FILESDIR}/${P}-tmp-offset.patch
+
+       # dhcp config fix and show dchpd messages on starting mol
+       sed -i "s:#ddns-update-style:ddns-update-style:g" Doc/config/dhcpd-mol.conf || die
+       sed -i "s:DHCPD\ -q\ -cf:DHCPD\ -cf:g" Doc/config/tunconfig || die
+
+       # Add tiger support to MOL
+       epatch ${FILESDIR}/${PN}-tiger.patch
+
+       # Add new bootloader
+       # Boot loader courtesy of http://www-user.rkrk.uni-kl.de/~nissler/mol/
+       cp ${WORKDIR}/bootx ${S}/libimport/drivers/bootx
+       cp ${WORKDIR}/bootx ${S}/mollib/drivers/bootx
+
+       # PCI Proxy Patch
+       epatch ${WORKDIR}/${PN}-pciproxy.patch
+       # PCI Debugging Patch
+       if use debug; then
+               epatch ${FILESDIR}/${PN}-pciproxy-dump.patch
+       fi
+
+       # uname fix
+       epatch ${FILESDIR}/${PN}-uname.diff
+
+       # Kernel 2.12+ patch
+       epatch ${FILESDIR}/${PN}-verify_area.diff
+}
+
+src_compile() {
+       filter-flags -fsigned-char
+
+       export KERNEL_SOURCE="/usr/src/${FK}"
+       export LDFLAGS=""
+
+       # initialize all needed build-files
+       ./autogen.sh
+       ./configure --prefix="/usr" || die "Configure failed."
+
+       # workaround for proper module-building
+       emake defconfig || die "Make failed."
+
+       sed -i "s:CONFIG_XDGA=y:# CONFIG_XDGA is not set:" .config-ppc
+       sed -i "s:CONFIG_TAP=y:# CONFIG_TAP is not set:" .config-ppc
+       use alsa     || sed -i "s:CONFIG_ALSA=y:# CONFIG_ALSA is not set:" .config-ppc
+       use debug    && sed -i "s:# CONFIG_DEBUGGER is not set:CONFIG_DEBUGGER=y:" .config-ppc
+       use oss      || sed -i "s:CONFIG_OSS=y:# CONFIG_OSS is not set:" .config-ppc
+       use oldworld || sed -i "s:CONFIG_OLDWORLD=y:# CONFIG_OLDWORLD is not set:" .config-ppc
+       use sheep    || sed -i "s:CONFIG_SHEEP=y:# CONFIG_SHEEP is not set:" .config-ppc
+       use X        || sed -i "s:CONFIG_X11=y:# CONFIG_X11 is not set:" .config-ppc
+       use fbcon    || sed -i "s:CONFIG_FBDEV=y:# CONFIG_FBDEV is not set:" .config-ppc
+       use vnc      || sed -i "s:CONFIG_VNC=y:# CONFIG_VNC is not set:" .config-ppc
+       use dga      || sed -i "s:CONFIG_XDGA=y:# CONFIG_XDGA is not set:" .config-ppc
+       use usb      || sed -i "s:CONFIG_USBDEV=y:# CONFIG_USBDEV is not set:" .config-ppc
+       use pci          && sed -i "s:# CONFIG_PCIPROXY is not set:CONFIG_PCIPROXY=y:" .config-ppc
+
+       einfo "The configuration has been altered according to your USE-flags."
+       # reinitialize our changed configuration
+       emake oldconfig
+
+       cd ${S}
+       emake BUILD_MODS=n || die "Build failed."
+
+       # Build the modules too!
+       BUILD_PARAMS="KERNEL_SOURCE=${KV_DIR} LV=${KV_MAJOR}${KV_MINOR} MP=${KV_OBJ}
+                                 KUNAME=${KV}"
+       BUILD_TARGETS=all
+       linux-mod_src_compile
+}
+
+src_install() {
+       #linux-mod_src_install
+       cd ${S}
+       emake DESTDIR=${D} install || die "Failed to install"
+       dodoc CREDITS Doc/Boot-ROM Doc/NewWorld-ROM Doc/Sound Doc/Video
+       dodoc Doc/Networking Doc/Dev/Debugger Doc/Dev/Addresses
+       dodoc Doc/man/molvconfig.1 Doc/man/startmol.1 Doc/man/molrc.5
+}
+
+pkg_postinst() {
+       echo
+       einfo "Mac-on-Linux is now installed.  To run, use the command startmol."
+       einfo "You might want to configure video modes first with molvconfig."
+       einfo "Other configuration is in /etc/molrc.  For more info see:"
+       einfo "              http://www.maconlinux.org"
+       einfo "Also try man molrc, man molvconfig, man startmol"
+       echo
+       ewarn "For networking and sound you might install the drivers in the"
+       ewarn "folder \"MOL-Install\" on your Mac OS X-Desktop."
+       echo
+       ewarn "If errors with networking occur, make sure you have the following"
+       ewarn "kernel functions enabled:"
+       einfo "For the dhcp server:"
+       einfo "    Socket Filtering (CONFIG_FILTER)"
+       einfo "    Packet Socket (CONFIG_PACKET)"
+       einfo "For NAT:"
+       einfo "    Network packet filtering (CONFIG_NETFILTER)"
+       einfo "    Connection tracking (CONFIG_IP_NF_CONNTRACK)"
+       einfo "    IP tables support (CONFIG_IP_NF_IPTABLES)"
+       einfo "    Packet filtering (CONFIG_IP_NF_FILTER)"
+       einfo "    Full NAT (CONFIG_IP_NF_NAT)"
+       einfo "    MASQUERADE target support (CONFIG_IP_NF_TARGET_MASQUERADE)"
+       echo
+}