Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Need help writing ebuild
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Kobboi
l33t
l33t


Joined: 29 Jul 2005
Posts: 672
Location: Belgium

PostPosted: Mon Sep 22, 2008 11:40 am    Post subject: Need help writing ebuild Reply with quote

I want to create my second ebuild ever, a simple device driver ( URL: http://www.moxa.com/drivers/UPCI/Linux/V1.13/driv_linux_smart_v1.13_build_08071117.tgz ). I can compile and install perfectly in a terminal. However, running the ebuild results in the following error:

Code:

**********************************************************************
  2.6.25-gentoo-r7
 MOXA Smartio/Industio Family Multiport Board Device Driver ver 1.13.
 Release Date: 2008/07/11
**********************************************************************
Makefile:514: /usr/src/linux-2.6.25-gentoo-r7/arch/amd64/Makefile: No such file or directory
make[2]: *** No rule to make target `/usr/src/linux-2.6.25-gentoo-r7/arch/amd64/Makefile'.  Stop.


What am I missing?
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Mon Sep 22, 2008 11:57 am    Post subject: Reply with quote

You're missing showing the commands that work, and your ebuild.
Back to top
View user's profile Send private message
Kobboi
l33t
l33t


Joined: 29 Jul 2005
Posts: 672
Location: Belgium

PostPosted: Mon Sep 22, 2008 12:08 pm    Post subject: Reply with quote

It's the simplest ebuild possible :oops:

Code:
inherit eutils

DESCRIPTION="Moxa Multiport Serial Board C168H/PCI Driver"
HOMEPAGE="http://www.moxa.com/"
SRC_URI="http://www.moxa.com/drivers/UPCI/Linux/V1.13/driv_linux_smart_v1.13_build_08071117.tgz"

SLOT="0"

KEYWORDS="x86 amd64"

src_compile() {
   cd mxser
        emake || die "emake failed"
}

src_install() {
        emake DESTDIR="${D}" install || die "emake install failed"
}
Back to top
View user's profile Send private message
PaulBredbury
Watchman
Watchman


Joined: 14 Jul 2005
Posts: 7310

PostPosted: Mon Sep 22, 2008 12:17 pm    Post subject: Reply with quote

emake isn't the same as make, so use "make". Why haven't you shown the commands that work?
Back to top
View user's profile Send private message
Kobboi
l33t
l33t


Joined: 29 Jul 2005
Posts: 672
Location: Belgium

PostPosted: Mon Sep 22, 2008 12:23 pm    Post subject: Reply with quote

I wasn't sure what you meant exactly

Code:
sudo emerge moxa-drivers
Calculating dependencies... done!
>>> Verifying ebuild Manifests...

>>> Emerging (1 of 1) net-dialup/moxa-drivers-1.13 to /
 * driv_linux_smart_v1.13_build_08071117.tgz RMD160 SHA1 SHA256 size ;-) ...                                                                           [ ok ]
 * checking ebuild checksums ;-) ...                                                                                                                   [ ok ]
 * checking auxfile checksums ;-) ...                                                                                                                  [ ok ]
 * checking miscfile checksums ;-) ...                                                                                                                 [ ok ]
 * checking driv_linux_smart_v1.13_build_08071117.tgz ;-) ...                                                                                          [ ok ]
>>> Unpacking source...
>>> Unpacking driv_linux_smart_v1.13_build_08071117.tgz to /var/tmp/portage/net-dialup/moxa-drivers-1.13/work
>>> Source unpacked.
>>> Compiling source in /var/tmp/portage/net-dialup/moxa-drivers-1.13/work ...
make[1]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.
make[1]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.
**********************************************************************
  2.6.25-gentoo-r7
 MOXA Smartio/Industio Family Multiport Board Device Driver ver 1.13.
 Release Date: 2008/07/11
**********************************************************************
Build Fail! Please chech build.log for further information.
make[1]: *** [module] Error 1
make: *** [mxser] Error 2
make: *** Waiting for unfinished jobs....
 *
 * ERROR: net-dialup/moxa-drivers-1.13 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called src_compile
 *             environment, line 2112:  Called die
 * The specific snippet of code:
 *       emake || die "emake failed"
 *  The die message:
 *   emake failed
 *
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/tmp/portage/net-dialup/moxa-drivers-1.13/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/net-dialup/moxa-drivers-1.13/temp/environment'.
 *

 * Messages for package net-dialup/moxa-drivers-1.13:

 *
 * ERROR: net-dialup/moxa-drivers-1.13 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called src_compile
 *             environment, line 2112:  Called die
 * The specific snippet of code:
 *       emake || die "emake failed"
 *  The die message:
 *   emake failed
 *
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/tmp/portage/net-dialup/moxa-drivers-1.13/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/net-dialup/moxa-drivers-1.13/temp/environment'.
 *


I posted the contents of the "local" build.log file in my first post.
Back to top
View user's profile Send private message
Kobboi
l33t
l33t


Joined: 29 Jul 2005
Posts: 672
Location: Belgium

PostPosted: Mon Sep 22, 2008 1:50 pm    Post subject: Reply with quote

I created a symlink /usr/src/linux/arch/amd64 to /usr/src/linux/arch/x86 and now compiling seems to work. Don't know why it works "by hand", environment troubles? The install has sandbox issues (does this mean the script tries to install the files to absolute paths?).
Back to top
View user's profile Send private message
Genone
Retired Dev
Retired Dev


Joined: 14 Mar 2003
Posts: 9507
Location: beyond the rim

PostPosted: Mon Sep 22, 2008 3:04 pm    Post subject: Reply with quote

Kobboi wrote:
I created a symlink /usr/src/linux/arch/amd64 to /usr/src/linux/arch/x86 and now compiling seems to work. Don't know why it works "by hand", environment troubles?

Sort of, portage sets the ARCH variable which is used by both ebuilds and the kernel in different ways (e.g. the kernel expects i386 while ebuilds use x86). linux-info.eclass has helper functions to deal with that problem (set_arch_to_kernel and set_arch_to_portage).

Quote:
The install has sandbox issues (does this mean the script tries to install the files to absolute paths?).

Likely, but can't be sure without seeing the actual error messages.
Back to top
View user's profile Send private message
Kobboi
l33t
l33t


Joined: 29 Jul 2005
Posts: 672
Location: Belgium

PostPosted: Mon Sep 22, 2008 3:41 pm    Post subject: Reply with quote

What is the right way to fix this? Change all Makefiles manually or is there some portage way to deal with this?

Code:
>>> Emerging (1 of 1) net-dialup/moxa-drivers-1.13 to /
 * driv_linux_smart_v1.13_build_08071117.tgz RMD160 SHA1 SHA256 size ;-) ...                                                                           [ ok ]
 * checking ebuild checksums ;-) ...                                                                                                                   [ ok ]
 * checking auxfile checksums ;-) ...                                                                                                                  [ ok ]
 * checking miscfile checksums ;-) ...                                                                                                                 [ ok ]
 * checking driv_linux_smart_v1.13_build_08071117.tgz ;-) ...                                                                                          [ ok ]
>>> Unpacking source...
>>> Unpacking driv_linux_smart_v1.13_build_08071117.tgz to /var/tmp/portage/net-dialup/moxa-drivers-1.13/work
>>> Source unpacked.
>>> Compiling source in /var/tmp/portage/net-dialup/moxa-drivers-1.13/work ...
make[1]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.
make[1]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.
**********************************************************************
  2.6.25-gentoo-r7
 MOXA Smartio/Industio Family Multiport Board Device Driver ver 1.13.
 Release Date: 2008/07/11
**********************************************************************
  Building modules, stage 2.
>>> Source compiled.
>>> Test phase [not enabled]: net-dialup/moxa-drivers-1.13

>>> Install moxa-drivers-1.13 into /var/tmp/portage/net-dialup/moxa-drivers-1.13/image/ category net-dialup
make[1]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.
make[1]: warning: jobserver unavailable: using -j1.  Add `+' to parent make rule.
ACCESS DENIED  open_wr:   /usr/bin/msdiag
cp: cannot create regular file `/usr/bin/msdiag': Permission denied
make[2]: *** [install] Error 1
make[1]: *** [diag_install] Error 2
make: *** [utility_install] Error 2
make: *** Waiting for unfinished jobs....
**********************************************************************
  2.6.25-gentoo-r7
 MOXA Smartio/Industio Family Multiport Board Device Driver ver 1.13.
 Release Date: 2008/07/11
**********************************************************************
  Building modules, stage 2.
ACCESS DENIED  open_wr:   /lib/modules/2.6.25-gentoo-r7/kernel/drivers/char/mxser.ko
ACCESS DENIED  unlink:    /lib/modules/2.6.25-gentoo-r7/kernel/drivers/char/mxser.ko
cp: cannot remove `/lib/modules/2.6.25-gentoo-r7/kernel/drivers/char/mxser.ko': Permission denied
make[1]: *** [install] Error 1
make: *** [driver_install] Error 2
 *
 * ERROR: net-dialup/moxa-drivers-1.13 failed.
 * Call stack:
 *               ebuild.sh, line   49:  Called src_install
 *             environment, line 2117:  Called die
 * The specific snippet of code:
 *       emake install || die "emake install failed"
 *  The die message:
 *   emake install failed
 *
 * If you need support, post the topmost build error, and the call stack if relevant.
 * A complete build log is located at '/var/tmp/portage/net-dialup/moxa-drivers-1.13/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/net-dialup/moxa-drivers-1.13/temp/environment'.
 *
--------------------------- ACCESS VIOLATION SUMMARY ---------------------------
LOG FILE = "/var/log/sandbox/sandbox-5498.log"

open_wr:   /usr/bin/msdiag
open_wr:   /lib/modules/2.6.25-gentoo-r7/kernel/drivers/char/mxser.ko (symlink to /lib64/modules/2.6.25-gentoo-r7/kernel/drivers/char/mxser.ko)
unlink:    /lib/modules/2.6.25-gentoo-r7/kernel/drivers/char/mxser.ko (symlink to /lib64/modules/2.6.25-gentoo-r7/kernel/drivers/char/mxser.ko)
Back to top
View user's profile Send private message
yngwin
Retired Dev
Retired Dev


Joined: 19 Dec 2002
Posts: 4572
Location: Suzhou, China

PostPosted: Mon Sep 22, 2008 5:32 pm    Post subject: Reply with quote

You're building a kernel module. So if I were you, I'd look for an ebuild in portage that also builds a kernel module, and see how similar problems are solved in there.
_________________
"Those who deny freedom to others deserve it not for themselves." - Abraham Lincoln
Free Culture | Defective by Design | EFF
Back to top
View user's profile Send private message
Kobboi
l33t
l33t


Joined: 29 Jul 2005
Posts: 672
Location: Belgium

PostPosted: Mon Sep 22, 2008 8:55 pm    Post subject: Reply with quote

I just had no idea if the fact that things didn't work out of the box was due to the simplicity of the ebuild or due to sucky source code and makefiles. I'll look into kernel module ebuilds (say ndiswrapper).
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum